private void updateIntrinsic() { cameraModel.width = camWidth; cameraModel.height = camHeight; cameraModel.cx = camWidth/2; cameraModel.cy = camHeight/2; double f = (camWidth/2.0)/Math.tan(UtilAngle.degreeToRadian(hfov)/2.0); cameraModel.fx = cameraModel.fy = f; cameraModel.skew = 0; }
private void updateIntrinsic() { cameraModel.width = camWidth; cameraModel.height = camHeight; cameraModel.cx = camWidth/2; cameraModel.cy = camHeight/2; double f = (camWidth/2.0)/Math.tan(UtilAngle.degreeToRadian(hfov)/2.0); cameraModel.fx = cameraModel.fy = f; cameraModel.skew = 0; }
/** * Creates a set of intrinsic parameters, without distortion, for a camera with the specified characteristics * * @param width Image width * @param height Image height * @param hfov Horizontal FOV in degrees * @param vfov Vertical FOV in degrees * @return guess camera parameters */ public static CameraPinholeRadial createIntrinsic(int width, int height, double hfov, double vfov) { CameraPinholeRadial intrinsic = new CameraPinholeRadial(); intrinsic.width = width; intrinsic.height = height; intrinsic.cx = width / 2; intrinsic.cy = height / 2; intrinsic.fx = intrinsic.cx / Math.tan(UtilAngle.degreeToRadian(hfov/2.0)); intrinsic.fy = intrinsic.cy / Math.tan(UtilAngle.degreeToRadian(vfov/2.0)); return intrinsic; }
/** * Creates a set of intrinsic parameters, without distortion, for a camera with the specified characteristics * * @param width Image width * @param height Image height * @param hfov Horizontal FOV in degrees * @param vfov Vertical FOV in degrees * @return guess camera parameters */ public static CameraPinhole createIntrinsic(int width, int height, double hfov, double vfov) { CameraPinhole intrinsic = new CameraPinhole(); intrinsic.width = width; intrinsic.height = height; intrinsic.cx = width / 2; intrinsic.cy = height / 2; intrinsic.fx = intrinsic.cx / Math.tan(UtilAngle.degreeToRadian(hfov/2.0)); intrinsic.fy = intrinsic.cy / Math.tan(UtilAngle.degreeToRadian(vfov/2.0)); return intrinsic; }
/** * Creates a set of intrinsic parameters, without distortion, for a camera with the specified characteristics. * The focal length is assumed to be the same for x and y. * * @param width Image width * @param height Image height * @param hfov Horizontal FOV in degrees * @return guess camera parameters */ public static CameraPinholeRadial createIntrinsic(int width, int height, double hfov) { CameraPinholeRadial intrinsic = new CameraPinholeRadial(); intrinsic.width = width; intrinsic.height = height; intrinsic.cx = width / 2; intrinsic.cy = height / 2; intrinsic.fx = intrinsic.cx / Math.tan(UtilAngle.degreeToRadian(hfov/2.0)); intrinsic.fy = intrinsic.fx; return intrinsic; }
/** * Creates a set of intrinsic parameters, without distortion, for a camera with the specified characteristics. * The focal length is assumed to be the same for x and y. * * @param width Image width * @param height Image height * @param hfov Horizontal FOV in degrees * @return guess camera parameters */ public static CameraPinholeRadial createIntrinsic(int width, int height, double hfov) { CameraPinholeRadial intrinsic = new CameraPinholeRadial(); intrinsic.width = width; intrinsic.height = height; intrinsic.cx = width / 2; intrinsic.cy = height / 2; intrinsic.fx = intrinsic.cx / Math.tan(UtilAngle.degreeToRadian(hfov/2.0)); intrinsic.fy = intrinsic.fx; return intrinsic; }
@Override public void updatedOrientation(double pitch, double yaw, double roll) { synchronized (distorter) { ConvertRotation3D_F32.eulerToMatrix(EulerType.ZYX, (float)UtilAngle.degreeToRadian(yaw), (float)UtilAngle.degreeToRadian(pitch), (float)UtilAngle.degreeToRadian(roll), distorter.getRotation()); distortImage.setModel(distorter); // let it know the transform has changed if (inputMethod == InputMethod.IMAGE) { renderOutput(inputCopy); } } }
@Override public void updatedOrientation(double pitch, double yaw, double roll) { synchronized (distorter) { ConvertRotation3D_F32.eulerToMatrix(EulerType.ZYX, (float)UtilAngle.degreeToRadian(yaw), (float)UtilAngle.degreeToRadian(pitch), (float)UtilAngle.degreeToRadian(roll), distorter.getRotation()); distortImage.setModel(distorter); // let it know the transform has changed if (inputMethod == InputMethod.IMAGE) { renderOutput(inputCopy); } } }
private void determineIntrinsicParameters(int width, int height) { try { intrinsicParameters = cameraInfoSubscriber.getIntrinsicParametersBlocking(); } catch (InterruptedException e) { System.out.println("Use default intrinsic parameters"); intrinsicParameters = new IntrinsicParameters(); intrinsicParameters.width = width; intrinsicParameters.height = height; intrinsicParameters.cx = width / 2; intrinsicParameters.cy = height / 2; intrinsicParameters.fx = intrinsicParameters.cx / Math.tan(UtilAngle.degreeToRadian(30)); // assume 60 degree FOV intrinsicParameters.fy = intrinsicParameters.cx / Math.tan(UtilAngle.degreeToRadian(30)); } detector.setIntrinsic(intrinsicParameters); }
private void determineIntrinsicParameters(int width, int height) { try { intrinsicParameters = cameraInfoSubscriber.getIntrinsicParametersBlocking(); } catch (InterruptedException e) { System.out.println("Use default intrinsic parameters"); intrinsicParameters = new IntrinsicParameters(); intrinsicParameters.width = width; intrinsicParameters.height = height; intrinsicParameters.cx = width / 2; intrinsicParameters.cy = height / 2; intrinsicParameters.fx = intrinsicParameters.cx / Math.tan(UtilAngle.degreeToRadian(30)); // assume 60 degree FOV intrinsicParameters.fy = intrinsicParameters.cx / Math.tan(UtilAngle.degreeToRadian(30)); } detector.setIntrinsic(intrinsicParameters); }
public static void main(String[] args) throws IOException { List<Point3D_F64> cloudA = read("/home/pja/Downloads/scan.dat"); List<Point3D_F64> cloudB = read("/home/pja/Downloads/scan2.dat"); Se3_F64 refToCurrent = new Se3_F64(); refToCurrent.getT().set(0.3,0.05,0); RotationMatrixGenerator.eulerXYZ(0,0, UtilAngle.degreeToRadian(20),refToCurrent.getR()); for( Point3D_F64 p : cloudB ) SePointOps_F64.transform(refToCurrent,p,p); IcpCloud3D icp = new IcpCloud3D(0.2,30,1e-8); icp.setReference(cloudA); if( !icp.setCurrent(cloudB) ) throw new RuntimeException("ICP failed"); Se3_F64 found = icp.getReferenceToCurrent(); System.out.println("Found"); found.print(); System.out.println("actual"); refToCurrent.print(); System.out.println("Fit Fraction: "+icp.getFitFraction()); }