public void configure(LensDistortionNarrowFOV distortion, int width , int height , boolean cache ) {
Point2Transform2_F32 pointSquareToInput;
Point2Transform2_F32 pointDistToUndist = distortion.undistort_F32(true,true);
Point2Transform2_F32 pointUndistToDist = distortion.distort_F32(true,true);
PixelTransform2_F32 distToUndist = new PointToPixelTransform_F32(pointDistToUndist);
PixelTransform2_F32 undistToDist = new PointToPixelTransform_F32(pointUndistToDist);
if( cache ) {
distToUndist = new PixelTransformCached_F32(width, height, distToUndist);
undistToDist = new PixelTransformCached_F32(width, height, undistToDist);
}
squareDetector.setLensDistortion(width, height,distToUndist,undistToDist);
pointSquareToInput = new SequencePoint2Transform2_F32(transformHomography,pointUndistToDist);
PixelTransform2_F32 squareToInput= new PointToPixelTransform_F32(pointSquareToInput);
removePerspective.setModel(squareToInput);
this.undistToDist = distortion.distort_F64(true,true);
}