public NarrowToWidePtoP_F32(LensDistortionNarrowFOV narrow, LensDistortionWideFOV wide) { configure(narrow, wide); }
private void changeFocus(MouseEvent e) { double scale = panelFisheye.scale; double omniX = e.getX()/scale; double omniY = e.getY()/scale; if( !fisheye.isInBounds((int)omniX,(int)omniY)) return; panelPinhole.grabFocus(); synchronized (imageLock) { Point3D_F32 norm = new Point3D_F32(); fisheyeDistort.undistortPtoS_F32().compute((float)omniX, (float)omniY, norm); Rodrigues_F32 rotation = new Rodrigues_F32(); Vector3D_F32 canonical = new Vector3D_F32(0,0,1); rotation.theta = UtilVector3D_F32.acute(new Vector3D_F32(norm),canonical); GeometryMath_F32.cross(canonical,norm,rotation.unitAxisRotation); rotation.unitAxisRotation.normalize(); FMatrixRMaj R = ConvertRotation3D_F32.rodriguesToMatrix(rotation,null); distorter.setRotationWideToNarrow(R); distortImage.setModel(new PointToPixelTransform_F32(distorter)); if (inputMethod == InputMethod.IMAGE) { rerenderPinhole(); } } }
public void setCalibration(CameraUniversalOmni fisheyeModel) { BoofSwingUtil.checkGuiThread(); LensDistortionNarrowFOV pinholeDistort = new LensDistortionPinhole(pinholeModel); fisheyeDistort = new LensDistortionUniversalOmni(fisheyeModel); distorter = new NarrowToWidePtoP_F32(pinholeDistort,fisheyeDistort); // Create the image distorter which will render the image InterpolatePixel<Planar<GrayF32>> interp = FactoryInterpolation. createPixel(0, 255, InterpolationType.BILINEAR, BorderType.ZERO, imageFisheye.getImageType()); distortImage = FactoryDistort.distort(false,interp,imageFisheye.getImageType()); // Pass in the transform created above distortImage.setModel(new PointToPixelTransform_F32(distorter)); setPinholeCenter(fisheyeModel.width/2,fisheyeModel.height/2); renderPinhole(); }
public void setPinholeCenter( double pixelX , double pixelY ) { this.pixelX = pixelX; this.pixelY = pixelY; Point3D_F32 norm = new Point3D_F32(); fisheyeDistort.undistortPtoS_F32().compute((float)pixelX, (float)pixelY, norm); Rodrigues_F32 rotation = new Rodrigues_F32(); Vector3D_F32 canonical = new Vector3D_F32(0,0,1); rotation.theta = UtilVector3D_F32.acute(new Vector3D_F32(norm),canonical); GeometryMath_F32.cross(canonical,norm,rotation.unitAxisRotation); rotation.unitAxisRotation.normalize(); FMatrixRMaj R = ConvertRotation3D_F32.rodriguesToMatrix(rotation,null); distorter.setRotationWideToNarrow(R); distortImage.setModel(new PointToPixelTransform_F32(distorter)); }
public NarrowToWidePtoP_F32(LensDistortionNarrowFOV narrow, LensDistortionWideFOV wide) { configure(narrow, wide); }
@Override public void openFile(File file) { File intrinsicFile = new File( file.getParent() , "front.yaml"); CameraUniversalOmni fisheyeModel = CalibrationIO.load(intrinsicFile); fisheyeDistort = new LensDistortionUniversalOmni(fisheyeModel); distorter.configure(new LensDistortionPinhole(cameraModel),fisheyeDistort); super.openFile(file); }
distorter.configure(new LensDistortionPinhole(cameraModel),fisheyeDistort); distortImage.setModel(new PointToPixelTransform_F32(distorter));