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