/** * Specifies the intrinsic parameters. * @param distortion Intrinsic camera parameters */ public void setLensDistoriton(LensDistortionNarrowFOV distortion ) { pixelToNorm = distortion.undistort_F64(true,false); normToPixel = distortion.distort_F64(false, true); }
public void configure(LensDistortionNarrowFOV narrow, LensDistortionWideFOV wide) { narrowToNorm = narrow.undistort_F32(true,false); unitToWide = wide.distortStoP_F32(); }
/** * Specifies the image's intrinsic parameters and target size * * @param distortion Lens distortion * @param width Image width * @param height Image height * @param cache If there's lens distortion should it cache the transforms? Speeds it up by about 12%. Ignored * if no lens distortion */ public void configure(LensDistortionNarrowFOV distortion, int width , int height , boolean cache ) { Point2Transform2_F32 pointSquareToInput; Point2Transform2_F32 pointDistToUndist = distortion.undistort_F32(true,true); Point2Transform2_F32 pointUndistToDist = distortion.distort_F32(true,true); PixelTransform2_F32 distToUndist = new PointToPixelTransform_F32(pointDistToUndist); PixelTransform2_F32 undistToDist = new PointToPixelTransform_F32(pointUndistToDist); if( cache ) { distToUndist = new PixelTransformCached_F32(width, height, distToUndist); undistToDist = new PixelTransformCached_F32(width, height, undistToDist); } squareDetector.setLensDistortion(width, height,distToUndist,undistToDist); pointSquareToInput = new SequencePoint2Transform2_F32(transformHomography,pointUndistToDist); // provide intrinsic camera parameters PixelTransform2_F32 squareToInput= new PointToPixelTransform_F32(pointSquareToInput); removePerspective.setModel(squareToInput); this.undistToDist = distortion.distort_F64(true,true); }
/** * Specifies intrinsic camera parameters and the transform from world to camera. * @param distortion camera parameters * @param worldToCamera transform from world to camera */ public void configure(LensDistortionNarrowFOV distortion , Se3_F64 worldToCamera ) { this.worldToCamera = worldToCamera; normToPixel = distortion.distort_F64(false,true); }
@Override public void setLensDistortion(LensDistortionNarrowFOV distortion) { if( distortion != null ) { this.hasCameraModel = true; this.lensDistortion = distortion; this.pixelToNorm = lensDistortion.undistort_F64(true, false); } else { this.hasCameraModel = false; this.lensDistortion = null; this.pixelToNorm = null; } }
public static Point2D_F32 convertPixelToNorm(CameraModel param , Point2D_F32 pixel , Point2D_F32 norm ) { if( norm == null ) norm = new Point2D_F32(); Point2Transform2_F32 pixelToNorm = LensDistortionFactory.narrow(param).distort_F32(true, false); pixelToNorm.compute(pixel.x,pixel.y,norm); return norm; }
LensDistortionNarrowFOV desired = LensDistortionFactory.narrow(paramDesired); Point2Transform2_F32 ori_p_to_n = original.undistort_F32(true, false); Point2Transform2_F32 des_n_to_p = desired.distort_F32(false, true); Point2Transform2_F32 des_p_to_n = desired.undistort_F32(true, false); Point2Transform2_F32 ori_n_to_p = original.distort_F32(false, true); PointTransformHomography_F32 adjust = new PointTransformHomography_F32(A); return new SequencePoint2Transform2_F32(adjust,des_p_to_n,ori_n_to_p);
/** * Specifies intrinsic camera parameters and the transform from world to camera. * @param distortion camera parameters * @param worldToCamera transform from world to camera */ public void configure(LensDistortionNarrowFOV distortion , Se3_F64 worldToCamera ) { this.worldToCamera = worldToCamera; normToPixel = distortion.distort_F64(false,true); }
public void configure(LensDistortionNarrowFOV narrow, LensDistortionWideFOV wide) { narrowToNorm = narrow.undistort_F64(true,false); unitToWide = wide.distortStoP_F64(); }
public static Point2D_F32 convertNormToPixel(CameraModel param , float x , float y , Point2D_F32 pixel ) { if( pixel == null ) pixel = new Point2D_F32(); Point2Transform2_F32 normToPixel = LensDistortionFactory.narrow(param).distort_F32(false,true); normToPixel.compute(x,y,pixel); return pixel; }
@Override public void setLensDistortion(LensDistortionNarrowFOV distortion) { super.setLensDistortion(distortion); if( distortion == null ) { distToUndist = new DoNothing2Transform2_F64(); undistToDist = new DoNothing2Transform2_F64(); } else { poseEstimator.setLensDistoriton(distortion); distToUndist = distortion.undistort_F64(true, true); undistToDist = distortion.distort_F64(true, true); } }
public static Point2D_F64 convertPixelToNorm(CameraModel param , Point2D_F64 pixel , Point2D_F64 norm ) { if( norm == null ) norm = new Point2D_F64(); Point2Transform2_F64 pixelToNorm = LensDistortionFactory.narrow(param).distort_F64(true, false); pixelToNorm.compute(pixel.x,pixel.y,norm); return norm; }
public void configure(LensDistortionNarrowFOV narrow, LensDistortionWideFOV wide) { narrowToNorm = narrow.undistort_F64(true,false); unitToWide = wide.distortStoP_F64(); }
/** * <p> * Convenient function for converting from normalized image coordinates to the original image pixel coordinate. * If speed is a concern then {@link PinholeNtoP_F32} should be used instead. * </p> * * @param param Intrinsic camera parameters * @param x X-coordinate of normalized. * @param y Y-coordinate of normalized. * @param pixel Optional storage for output. If null a new instance will be declared. * @return pixel image coordinate */ public static Point2D_F32 convertNormToPixel(CameraPinholeRadial param , float x , float y , Point2D_F32 pixel ) { if( pixel == null ) pixel = new Point2D_F32(); Point2Transform2_F32 normToPixel = LensDistortionOps.transformPoint(param).distort_F32(false, true); normToPixel.compute(x,y,pixel); return pixel; }
public void configure(LensDistortionNarrowFOV narrow, LensDistortionWideFOV wide) { narrowToNorm = narrow.undistort_F32(true,false); unitToWide = wide.distortStoP_F32(); }
LensDistortionNarrowFOV desired = LensDistortionFactory.narrow(paramDesired); Point2Transform2_F64 ori_p_to_n = original.undistort_F64(true, false); Point2Transform2_F64 des_n_to_p = desired.distort_F64(false, true); Point2Transform2_F64 des_p_to_n = desired.undistort_F64(true, false); Point2Transform2_F64 ori_n_to_p = original.distort_F64(false, true); PointTransformHomography_F64 adjust = new PointTransformHomography_F64(A); return new SequencePoint2Transform2_F64(adjust,des_p_to_n,ori_n_to_p);
public static Point2D_F64 convertNormToPixel(CameraModel param , double x , double y , Point2D_F64 pixel ) { if( pixel == null ) pixel = new Point2D_F64(); Point2Transform2_F64 normToPixel = LensDistortionFactory.narrow(param).distort_F64(false,true); normToPixel.compute(x,y,pixel); return pixel; }
public static Point2Transform2_F64 transformPixelToRect(CameraPinholeRadial param, DMatrixRMaj rectify) { Point2Transform2_F64 remove_p_to_p = narrow(param).undistort_F64(true, true); PointTransformHomography_F64 rectifyDistort = new PointTransformHomography_F64(rectify); return new SequencePoint2Transform2_F64(remove_p_to_p,rectifyDistort); }
/** * <p> * Convenient function for converting from original image pixel coordinate to normalized< image coordinates. * If speed is a concern then {@link PinholePtoN_F32} should be used instead. * </p> * * NOTE: norm and pixel can be the same instance. * * @param param Intrinsic camera parameters * @param pixel Pixel coordinate * @param norm Optional storage for output. If null a new instance will be declared. * @return normalized image coordinate */ public static Point2D_F32 convertPixelToNorm(CameraPinholeRadial param , Point2D_F32 pixel , Point2D_F32 norm ) { if( norm == null ) norm = new Point2D_F32(); Point2Transform2_F32 pixelToNorm = LensDistortionOps.transformPoint(param).distort_F32(true, false); pixelToNorm.compute(pixel.x,pixel.y,norm); return norm; }
public static Point2Transform2_F32 transformPixelToRect(CameraPinholeRadial param, FMatrixRMaj rectify) { Point2Transform2_F32 remove_p_to_p = narrow(param).undistort_F32(true, true); PointTransformHomography_F32 rectifyDistort = new PointTransformHomography_F32(rectify); return new SequencePoint2Transform2_F32(remove_p_to_p,rectifyDistort); }