use of boofcv.struct.distort.PointToPixelTransform_F32 in project BoofCV by lessthanoptimal.
the class LensDistortionOps method changeCameraModel.
/**
* Creates a distortion for modifying the input image from one camera model into another camera model. If
* requested the camera model can be further modified to ensure certain visibility requirements are meet
* and the adjusted camera model will be returned.
*
* @param type How it should modify the image model to ensure visibility of pixels.
* @param borderType How the image border is handled
* @param original The original camera model
* @param desired The desired camera model
* @param modified (Optional) The desired camera model after being rescaled. Can be null.
* @param imageType Type of image.
* @return Image distortion from original camera model to the modified one.
*/
public static <T extends ImageBase<T>, O extends CameraPinhole, D extends CameraPinhole> ImageDistort<T, T> changeCameraModel(AdjustmentType type, BorderType borderType, O original, D desired, @Nullable D modified, ImageType<T> imageType) {
Class bandType = imageType.getImageClass();
boolean skip = borderType == BorderType.SKIP;
// it has to process the border at some point, so if skip is requested just skip stuff truly outside the image
if (skip)
borderType = BorderType.EXTENDED;
InterpolatePixelS interp = FactoryInterpolation.createPixelS(0, 255, InterpolationType.BILINEAR, borderType, bandType);
Point2Transform2_F32 undistToDist = LensDistortionOps_F32.transformChangeModel(type, original, desired, true, modified);
ImageDistort<T, T> distort = FactoryDistort.distort(true, interp, imageType);
distort.setModel(new PointToPixelTransform_F32(undistToDist));
distort.setRenderAll(!skip);
return distort;
}
use of boofcv.struct.distort.PointToPixelTransform_F32 in project BoofCV by lessthanoptimal.
the class VisOdomPixelDepthPnP_to_DepthVisualOdometry method setCalibration.
@Override
public void setCalibration(CameraPinholeBrown paramVisual, Point2Transform2_F32 visToDepth) {
PointToPixelTransform_F32 visToDepth_pixel = new PointToPixelTransform_F32(visToDepth);
sparse3D.configure(narrow(paramVisual), visToDepth_pixel);
alg.setCamera(paramVisual);
distance.setIntrinsic(0, paramVisual);
}
Aggregations