public static void allInsideLeft(CameraPinholeRadial paramLeft, DMatrixRMaj rectifyLeft, DMatrixRMaj rectifyRight, DMatrixRMaj rectifyK) { // need to take in account the order in which image distort will remove rectification later on paramLeft = new CameraPinholeRadial(paramLeft); Point2Transform2_F64 tranLeft = transformPixelToRect(paramLeft, rectifyLeft); RectangleLength2D_F64 bound = LensDistortionOps_F64.boundBoxInside(paramLeft.width, paramLeft.height, new PointToPixelTransform_F64(tranLeft)); LensDistortionOps_F64.roundInside(bound); double scaleX = paramLeft.width/(double)bound.width; double scaleY = paramLeft.height/(double)bound.height; double scale = Math.max(scaleX, scaleY); adjustCalibrated(rectifyLeft, rectifyRight, rectifyK, bound, scale); }
bound = DistortImageOps.boundBox_F64(paramOriginal.width, paramOriginal.height, new PointToPixelTransform_F64(ori_to_des)); } else if( type == AdjustmentType.EXPAND) { bound = LensDistortionOps_F64.boundBoxInside(paramOriginal.width, paramOriginal.height, new PointToPixelTransform_F64(ori_to_des)); LensDistortionOps_F64.roundInside(bound); } else if( type == AdjustmentType.CENTER) { bound = LensDistortionOps_F64.centerBoxInside(paramOriginal.width, paramOriginal.height, new PointToPixelTransform_F64(ori_to_des)); } else if( type == AdjustmentType.NONE ) { bound = new RectangleLength2D_F64(0,0,paramDesired.width, paramDesired.height);
PixelTransform2_F64 transform) List<Point2D_F64> points = computeBoundingPoints(srcWidth, srcHeight, transform); Point2D_F64 center = new Point2D_F64(); UtilPoint2D_F64.mean(points,center);
public static void allInsideLeft( int imageWidth,int imageHeight, DMatrixRMaj rectifyLeft, DMatrixRMaj rectifyRight ) { PointTransformHomography_F64 tranLeft = new PointTransformHomography_F64(rectifyLeft); RectangleLength2D_F64 bound = LensDistortionOps_F64.boundBoxInside(imageWidth, imageHeight, new PointToPixelTransform_F64(tranLeft)); double scaleX = imageWidth/(double)bound.width; double scaleY = imageHeight/(double)bound.height; double scale = Math.max(scaleX, scaleY); adjustUncalibrated(rectifyLeft, rectifyRight, bound, scale); }
PixelTransform2_F64 transform) { List<Point2D_F64> points = computeBoundingPoints(srcWidth, srcHeight, transform);