Search in sources :

Example 6 with LensDistortionPinhole

use of boofcv.alg.distort.pinhole.LensDistortionPinhole in project BoofCV by lessthanoptimal.

the class DisplayFisheyeCalibrationPanel method setCalibration.

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();
}
Also used : LensDistortionPinhole(boofcv.alg.distort.pinhole.LensDistortionPinhole) Planar(boofcv.struct.image.Planar) LensDistortionUniversalOmni(boofcv.alg.distort.universal.LensDistortionUniversalOmni)

Aggregations

LensDistortionPinhole (boofcv.alg.distort.pinhole.LensDistortionPinhole)6 LensDistortionUniversalOmni (boofcv.alg.distort.universal.LensDistortionUniversalOmni)3 CameraPinhole (boofcv.struct.calib.CameraPinhole)3 ConvertBufferedImage (boofcv.io.image.ConvertBufferedImage)2 CameraUniversalOmni (boofcv.struct.calib.CameraUniversalOmni)2 Planar (boofcv.struct.image.Planar)2 BufferedImage (java.awt.image.BufferedImage)2 File (java.io.File)2 PointToPixelTransform_F32 (boofcv.alg.distort.PointToPixelTransform_F32)1 ListDisplayPanel (boofcv.gui.ListDisplayPanel)1 GrayU8 (boofcv.struct.image.GrayU8)1