Search in sources :

Example 6 with PointToPixelTransform_F64

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

the class ImplRectifyImageOps_F64 method allInsideLeft.

public static void allInsideLeft(CameraPinholeBrown paramLeft, DMatrixRMaj rectifyLeft, DMatrixRMaj rectifyRight, DMatrixRMaj rectifyK, ImageDimension rectifiedSize) {
    // need to take in account the order in which image distort will remove rectification later on
    paramLeft = new CameraPinholeBrown(paramLeft);
    Point2Transform2_F64 tranLeft = transformPixelToRect(paramLeft, rectifyLeft);
    Point2D_F64 work = new Point2D_F64();
    RectangleLength2D_F64 bound = LensDistortionOps_F64.boundBoxInside(paramLeft.width, paramLeft.height, new PointToPixelTransform_F64(tranLeft), work);
    LensDistortionOps_F64.roundInside(bound);
    // Select scale to maintain the same number of pixels
    double scale = Math.sqrt((paramLeft.width * paramLeft.height) / (bound.width * bound.height));
    rectifiedSize.width = (int) (scale * bound.width + 0.5);
    rectifiedSize.height = (int) (scale * bound.height + 0.5);
    adjustCalibrated(rectifyLeft, rectifyRight, rectifyK, bound, scale);
}
Also used : CameraPinholeBrown(boofcv.struct.calib.CameraPinholeBrown) Point2D_F64(georegression.struct.point.Point2D_F64) SequencePoint2Transform2_F64(boofcv.struct.distort.SequencePoint2Transform2_F64) Point2Transform2_F64(boofcv.struct.distort.Point2Transform2_F64) PointToPixelTransform_F64(boofcv.struct.distort.PointToPixelTransform_F64) RectangleLength2D_F64(georegression.struct.shapes.RectangleLength2D_F64)

Example 7 with PointToPixelTransform_F64

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

the class ImplRectifyImageOps_F64 method fullViewLeft.

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

Example 8 with PointToPixelTransform_F64

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

the class ImplRectifyImageOps_F64 method fullViewLeft.

public static void fullViewLeft(CameraPinholeBrown paramLeft, DMatrixRMaj rectifyLeft, DMatrixRMaj rectifyRight, DMatrixRMaj rectifyK, ImageDimension rectifiedSize) {
    // need to take in account the order in which image distort will remove rectification later on
    paramLeft = new CameraPinholeBrown(paramLeft);
    Point2Transform2_F64 tranLeft = transformPixelToRect(paramLeft, rectifyLeft);
    Point2D_F64 work = new Point2D_F64();
    RectangleLength2D_F64 bound = DistortImageOps.boundBox_F64(paramLeft.width, paramLeft.height, new PointToPixelTransform_F64(tranLeft), work);
    // Select scale to maintain the same number of pixels
    double scale = Math.sqrt((paramLeft.width * paramLeft.height) / (bound.width * bound.height));
    rectifiedSize.width = (int) (scale * bound.width + 0.5);
    rectifiedSize.height = (int) (scale * bound.height + 0.5);
    adjustCalibrated(rectifyLeft, rectifyRight, rectifyK, bound, scale);
}
Also used : CameraPinholeBrown(boofcv.struct.calib.CameraPinholeBrown) Point2D_F64(georegression.struct.point.Point2D_F64) SequencePoint2Transform2_F64(boofcv.struct.distort.SequencePoint2Transform2_F64) Point2Transform2_F64(boofcv.struct.distort.Point2Transform2_F64) PointToPixelTransform_F64(boofcv.struct.distort.PointToPixelTransform_F64) RectangleLength2D_F64(georegression.struct.shapes.RectangleLength2D_F64)

Aggregations

PointToPixelTransform_F64 (boofcv.struct.distort.PointToPixelTransform_F64)8 Point2Transform2_F64 (boofcv.struct.distort.Point2Transform2_F64)7 Point2D_F64 (georegression.struct.point.Point2D_F64)5 CameraPinholeBrown (boofcv.struct.calib.CameraPinholeBrown)4 RectangleLength2D_F64 (georegression.struct.shapes.RectangleLength2D_F64)4 LensDistortionBrown (boofcv.alg.distort.brown.LensDistortionBrown)3 SequencePoint2Transform2_F64 (boofcv.struct.distort.SequencePoint2Transform2_F64)3 PointTransformHomography_F64 (boofcv.alg.distort.PointTransformHomography_F64)2 GrayF32 (boofcv.struct.image.GrayF32)2 GrayU8 (boofcv.struct.image.GrayU8)2 Point3D_F64 (georegression.struct.point.Point3D_F64)2 BundleAdjustmentCamera (boofcv.abst.geo.bundle.BundleAdjustmentCamera)1 LensDistortionNarrowFOV (boofcv.alg.distort.LensDistortionNarrowFOV)1 LensDistortionPinhole (boofcv.alg.distort.pinhole.LensDistortionPinhole)1 MultiViewOps (boofcv.alg.geo.MultiViewOps)1 WorldToCameraToPixel (boofcv.alg.geo.WorldToCameraToPixel)1 GImageMiscOps (boofcv.alg.misc.GImageMiscOps)1 ImageMiscOps (boofcv.alg.misc.ImageMiscOps)1 ImageStatistics (boofcv.alg.misc.ImageStatistics)1 DisparityParameters (boofcv.alg.mvs.DisparityParameters)1