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);
}
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);
}
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);
}
Aggregations