Search in sources :

Example 16 with Point2Transform2_F32

use of boofcv.struct.distort.Point2Transform2_F32 in project BoofCV by lessthanoptimal.

the class ImplPerspectiveOps_F32 method convertPixelToNorm.

public static Point2D_F32 convertPixelToNorm(CameraModel param, Point2D_F32 pixel, Point2D_F32 norm) {
    if (norm == null)
        norm = new Point2D_F32();
    Point2Transform2_F32 pixelToNorm = LensDistortionOps.narrow(param).distort_F32(true, false);
    pixelToNorm.compute(pixel.x, pixel.y, norm);
    return norm;
}
Also used : Point2D_F32(georegression.struct.point.Point2D_F32) Point2Transform2_F32(boofcv.struct.distort.Point2Transform2_F32)

Example 17 with Point2Transform2_F32

use of boofcv.struct.distort.Point2Transform2_F32 in project BoofCV by lessthanoptimal.

the class ImplPerspectiveOps_F32 method convertNormToPixel.

public static Point2D_F32 convertNormToPixel(CameraModel param, float x, float y, Point2D_F32 pixel) {
    if (pixel == null)
        pixel = new Point2D_F32();
    Point2Transform2_F32 normToPixel = LensDistortionOps.narrow(param).distort_F32(false, true);
    normToPixel.compute(x, y, pixel);
    return pixel;
}
Also used : Point2D_F32(georegression.struct.point.Point2D_F32) Point2Transform2_F32(boofcv.struct.distort.Point2Transform2_F32)

Example 18 with Point2Transform2_F32

use of boofcv.struct.distort.Point2Transform2_F32 in project BoofCV by lessthanoptimal.

the class ImplRectifyImageOps_F32 method transformPixelToRect.

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);
}
Also used : PointTransformHomography_F32(boofcv.alg.distort.PointTransformHomography_F32) SequencePoint2Transform2_F32(boofcv.struct.distort.SequencePoint2Transform2_F32) Point2Transform2_F32(boofcv.struct.distort.Point2Transform2_F32) SequencePoint2Transform2_F32(boofcv.struct.distort.SequencePoint2Transform2_F32)

Example 19 with Point2Transform2_F32

use of boofcv.struct.distort.Point2Transform2_F32 in project BoofCV by lessthanoptimal.

the class ImplRectifyImageOps_F32 method fullViewLeft.

public static void fullViewLeft(CameraPinholeRadial paramLeft, FMatrixRMaj rectifyLeft, FMatrixRMaj rectifyRight, FMatrixRMaj rectifyK) {
    // need to take in account the order in which image distort will remove rectification later on
    paramLeft = new CameraPinholeRadial(paramLeft);
    Point2Transform2_F32 tranLeft = transformPixelToRect(paramLeft, rectifyLeft);
    RectangleLength2D_F32 bound = DistortImageOps.boundBox_F32(paramLeft.width, paramLeft.height, new PointToPixelTransform_F32(tranLeft));
    float scaleX = paramLeft.width / bound.width;
    float scaleY = paramLeft.height / bound.height;
    float scale = (float) Math.min(scaleX, scaleY);
    adjustCalibrated(rectifyLeft, rectifyRight, rectifyK, bound, scale);
}
Also used : CameraPinholeRadial(boofcv.struct.calib.CameraPinholeRadial) PointToPixelTransform_F32(boofcv.alg.distort.PointToPixelTransform_F32) RectangleLength2D_F32(georegression.struct.shapes.RectangleLength2D_F32) SequencePoint2Transform2_F32(boofcv.struct.distort.SequencePoint2Transform2_F32) Point2Transform2_F32(boofcv.struct.distort.Point2Transform2_F32)

Example 20 with Point2Transform2_F32

use of boofcv.struct.distort.Point2Transform2_F32 in project BoofCV by lessthanoptimal.

the class ImplRectifyImageOps_F32 method fullViewLeft.

public static void fullViewLeft(int imageWidth, int imageHeight, FMatrixRMaj rectifyLeft, FMatrixRMaj rectifyRight) {
    Point2Transform2_F32 tranLeft = new PointTransformHomography_F32(rectifyLeft);
    RectangleLength2D_F32 bound = DistortImageOps.boundBox_F32(imageWidth, imageHeight, new PointToPixelTransform_F32(tranLeft));
    float scaleX = imageWidth / bound.width;
    float scaleY = imageHeight / bound.height;
    float scale = (float) Math.min(scaleX, scaleY);
    adjustUncalibrated(rectifyLeft, rectifyRight, bound, scale);
}
Also used : PointTransformHomography_F32(boofcv.alg.distort.PointTransformHomography_F32) PointToPixelTransform_F32(boofcv.alg.distort.PointToPixelTransform_F32) RectangleLength2D_F32(georegression.struct.shapes.RectangleLength2D_F32) SequencePoint2Transform2_F32(boofcv.struct.distort.SequencePoint2Transform2_F32) Point2Transform2_F32(boofcv.struct.distort.Point2Transform2_F32)

Aggregations

Point2Transform2_F32 (boofcv.struct.distort.Point2Transform2_F32)26 CameraPinholeRadial (boofcv.struct.calib.CameraPinholeRadial)10 SequencePoint2Transform2_F32 (boofcv.struct.distort.SequencePoint2Transform2_F32)9 Point2D_F32 (georegression.struct.point.Point2D_F32)9 Test (org.junit.Test)9 CameraPinhole (boofcv.struct.calib.CameraPinhole)7 PointToPixelTransform_F32 (boofcv.alg.distort.PointToPixelTransform_F32)5 FMatrixRMaj (org.ejml.data.FMatrixRMaj)5 PointTransformHomography_F32 (boofcv.alg.distort.PointTransformHomography_F32)4 RectangleLength2D_F32 (georegression.struct.shapes.RectangleLength2D_F32)4 LensDistortionRadialTangential (boofcv.alg.distort.radtan.LensDistortionRadialTangential)2 InterpolatePixelS (boofcv.alg.interpolate.InterpolatePixelS)2 Point2D_F64 (georegression.struct.point.Point2D_F64)2 PixelTransformCached_F32 (boofcv.alg.distort.PixelTransformCached_F32)1 PinholePtoN_F32 (boofcv.alg.distort.pinhole.PinholePtoN_F32)1 ImagePanel (boofcv.gui.image.ImagePanel)1 PixelTransform2_F32 (boofcv.struct.distort.PixelTransform2_F32)1 Point2Transform2_F64 (boofcv.struct.distort.Point2Transform2_F64)1 GrayU8 (boofcv.struct.image.GrayU8)1 Point3D_F32 (georegression.struct.point.Point3D_F32)1