public static < T extends ImageBase < T > , O extends CameraPinhole , D extends CameraPinhole > ImageDistort < T , T > changeCameraModel ( AdjustmentType type , BorderType borderType , O original , D desired , 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 ; }
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 .