Search in sources :

Example 1 with PointTransformHomography_F64

use of boofcv.alg.distort.PointTransformHomography_F64 in project BoofCV by lessthanoptimal.

the class ImplRectifyImageOps_F64 method transformPixelToRect.

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);
}
Also used : PointTransformHomography_F64(boofcv.alg.distort.PointTransformHomography_F64) SequencePoint2Transform2_F64(boofcv.struct.distort.SequencePoint2Transform2_F64) Point2Transform2_F64(boofcv.struct.distort.Point2Transform2_F64) SequencePoint2Transform2_F64(boofcv.struct.distort.SequencePoint2Transform2_F64)

Example 2 with PointTransformHomography_F64

use of boofcv.alg.distort.PointTransformHomography_F64 in project BoofCV by lessthanoptimal.

the class ImplRectifyImageOps_F64 method transformPixelToRectNorm.

public static Point2Transform2_F64 transformPixelToRectNorm(CameraPinholeBrown param, DMatrixRMaj rectify, DMatrixRMaj rectifyK) {
    if (rectifyK.get(0, 1) != 0)
        throw new IllegalArgumentException("Skew should be zero in rectified images");
    Point2Transform2_F64 remove_p_to_p = narrow(param).undistort_F64(true, true);
    PointTransformHomography_F64 rectifyDistort = new PointTransformHomography_F64(rectify);
    PinholePtoN_F64 pixelToNorm = new PinholePtoN_F64();
    pixelToNorm.setK(rectifyK.get(0, 0), rectifyK.get(1, 1), rectifyK.get(0, 1), rectifyK.get(0, 2), rectifyK.get(1, 2));
    return new SequencePoint2Transform2_F64(remove_p_to_p, rectifyDistort, pixelToNorm);
}
Also used : PinholePtoN_F64(boofcv.alg.distort.pinhole.PinholePtoN_F64) PointTransformHomography_F64(boofcv.alg.distort.PointTransformHomography_F64) SequencePoint2Transform2_F64(boofcv.struct.distort.SequencePoint2Transform2_F64) Point2Transform2_F64(boofcv.struct.distort.Point2Transform2_F64) SequencePoint2Transform2_F64(boofcv.struct.distort.SequencePoint2Transform2_F64)

Example 3 with PointTransformHomography_F64

use of boofcv.alg.distort.PointTransformHomography_F64 in project BoofCV by lessthanoptimal.

the class ImplRectifyImageOps_F64 method transformPixelToRectNorm.

public static Point2Transform2_F64 transformPixelToRectNorm(CameraPinholeRadial param, DMatrixRMaj rectify, DMatrixRMaj rectifyK) {
    if (rectifyK.get(0, 1) != 0)
        throw new IllegalArgumentException("Skew should be zero in rectified images");
    Point2Transform2_F64 remove_p_to_p = narrow(param).undistort_F64(true, true);
    PointTransformHomography_F64 rectifyDistort = new PointTransformHomography_F64(rectify);
    PinholePtoN_F64 pixelToNorm = new PinholePtoN_F64();
    pixelToNorm.set(rectifyK.get(0, 0), rectifyK.get(1, 1), rectifyK.get(0, 1), rectifyK.get(0, 2), rectifyK.get(1, 2));
    return new SequencePoint2Transform2_F64(remove_p_to_p, rectifyDistort, pixelToNorm);
}
Also used : PinholePtoN_F64(boofcv.alg.distort.pinhole.PinholePtoN_F64) PointTransformHomography_F64(boofcv.alg.distort.PointTransformHomography_F64) SequencePoint2Transform2_F64(boofcv.struct.distort.SequencePoint2Transform2_F64) Point2Transform2_F64(boofcv.struct.distort.Point2Transform2_F64) SequencePoint2Transform2_F64(boofcv.struct.distort.SequencePoint2Transform2_F64)

Example 4 with PointTransformHomography_F64

use of boofcv.alg.distort.PointTransformHomography_F64 in project BoofCV by lessthanoptimal.

the class ImplRectifyImageOps_F64 method transformRectToPixel.

public static Point2Transform2_F64 transformRectToPixel(CameraPinholeRadial param, DMatrixRMaj rectify) {
    Point2Transform2_F64 add_p_to_p = narrow(param).distort_F64(true, true);
    DMatrixRMaj rectifyInv = new DMatrixRMaj(3, 3);
    CommonOps_DDRM.invert(rectify, rectifyInv);
    PointTransformHomography_F64 removeRect = new PointTransformHomography_F64(rectifyInv);
    return new SequencePoint2Transform2_F64(removeRect, add_p_to_p);
}
Also used : PointTransformHomography_F64(boofcv.alg.distort.PointTransformHomography_F64) SequencePoint2Transform2_F64(boofcv.struct.distort.SequencePoint2Transform2_F64) Point2Transform2_F64(boofcv.struct.distort.Point2Transform2_F64) DMatrixRMaj(org.ejml.data.DMatrixRMaj) SequencePoint2Transform2_F64(boofcv.struct.distort.SequencePoint2Transform2_F64)

Example 5 with PointTransformHomography_F64

use of boofcv.alg.distort.PointTransformHomography_F64 in project BoofCV by lessthanoptimal.

the class ImplRectifyImageOps_F64 method allInsideLeft.

public static void allInsideLeft(int imageWidth, int imageHeight, DMatrixRMaj rectifyLeft, DMatrixRMaj rectifyRight) {
    PointTransformHomography_F64 tranLeft = new PointTransformHomography_F64(rectifyLeft);
    Point2D_F64 work = new Point2D_F64();
    RectangleLength2D_F64 bound = LensDistortionOps_F64.boundBoxInside(imageWidth, imageHeight, new PointToPixelTransform_F64(tranLeft), work);
    double scaleX = imageWidth / bound.width;
    double scaleY = imageHeight / bound.height;
    double scale = Math.max(scaleX, scaleY);
    adjustUncalibrated(rectifyLeft, rectifyRight, bound, scale);
}
Also used : Point2D_F64(georegression.struct.point.Point2D_F64) PointTransformHomography_F64(boofcv.alg.distort.PointTransformHomography_F64) PointToPixelTransform_F64(boofcv.struct.distort.PointToPixelTransform_F64) RectangleLength2D_F64(georegression.struct.shapes.RectangleLength2D_F64)

Aggregations

PointTransformHomography_F64 (boofcv.alg.distort.PointTransformHomography_F64)8 Point2Transform2_F64 (boofcv.struct.distort.Point2Transform2_F64)7 SequencePoint2Transform2_F64 (boofcv.struct.distort.SequencePoint2Transform2_F64)7 PinholePtoN_F64 (boofcv.alg.distort.pinhole.PinholePtoN_F64)2 PointToPixelTransform_F64 (boofcv.struct.distort.PointToPixelTransform_F64)2 Point2D_F64 (georegression.struct.point.Point2D_F64)2 RectangleLength2D_F64 (georegression.struct.shapes.RectangleLength2D_F64)2 DMatrixRMaj (org.ejml.data.DMatrixRMaj)2