Documentation of 'boofcv.alg.distort.LensDistortionOps' Java class
LensDistortionOps
boofcv.alg.distort

Class LensDistortionOps



  • public class LensDistortionOps
    extends java.lang.Object
    Operations related to manipulating lens distortion in images
    • Constructor Detail

      • LensDistortionOps

        public LensDistortionOps()
    • Method Detail

      • imageRemoveDistortion

        public static <T extends ImageBase> ImageDistort<T,T> imageRemoveDistortion(AdjustmentType type,
                                                                                    BorderType borderType,
                                                                                    IntrinsicParameters param,
                                                                                    IntrinsicParameters paramAdj,
                                                                                    ImageType<T> imageType)

        Creates an ImageDistort class which will remove the lens distortion. The user can select how the view is adjusted.

        If BorderType.VALUE then pixels outside the image will be filled in with a value of 0. For viewing purposes it is recommended that BorderType.VALUE be used and BorderType.EXTENDED in computer vision applications. VALUE creates harsh edges which can cause false positives when detecting features, which EXTENDED minimizes.

        Parameters:
        type - The type of adjustment it will do
        borderType - Specifies how the image border is handled. Null means borders are ignored.
        param - Original intrinsic parameters.
        paramAdj - (output) Intrinsic parameters which reflect the undistorted image. Can be null.
        imageType - Type of image it will undistort
        Returns:
        ImageDistort which removes lens distortion
      • transform_F32

        public static PointTransform_F32 transform_F32(AdjustmentType type,
                                                       IntrinsicParameters param,
                                                       IntrinsicParameters paramAdj,
                                                       boolean undistortedToDistorted)
        Creates a PointTransform_F32 for adding and removing lens distortion.
        Parameters:
        type - The type of adjustment it will apply to the transform
        param - Intrinsic camera parameters.
        paramAdj - If not null, the new camera parameters for the undistorted view are stored here.
        undistortedToDistorted - If true then the transform's input is assumed to be pixels in the adjusted undistorted image and the output will be in distorted image, if false then the reverse transform is returned.
        Returns:
        The requested transform
      • transform_F64

        public static PointTransform_F64 transform_F64(AdjustmentType type,
                                                       IntrinsicParameters param,
                                                       IntrinsicParameters paramAdj,
                                                       boolean undistortedToDistorted)
        Creates a PointTransform_F64 for adding and removing lens distortion.
        Parameters:
        type - The type of adjustment it will apply to the transform
        param - Intrinsic camera parameters.
        paramAdj - If not null, the new camera parameters for the undistorted view are stored here.
        undistortedToDistorted - If true then the transform's input is assumed to be pixels in the adjusted undistorted image and the output will be in distorted image, if false then the reverse transform is returned.
        Returns:
        The requested transform
      • transformPoint

        public static LensDistortionPinhole transformPoint(IntrinsicParameters param)

        Creates the lens distortion for the specified camera parameters. Call this to create transforms to and from pixel and normalized image coordinates with and without lens distortion. Automatically switches algorithm depending on the type of distortion or lack thereof.

        Example:

        PointTransform_F64 normToPixel = LensDistortionOps.distortTransform(param).distort_F64(false,true);
        Creates a transform from normalized image coordinates into pixel coordinates.

      • boundBoxInside

        public static RectangleLength2D_F32 boundBoxInside(int srcWidth,
                                                           int srcHeight,
                                                           PixelTransform_F32 transform)
        Finds the maximum area axis-aligned rectangle contained inside the transformed image which does not include any pixels outside the sources border. Assumes that the coordinates are not flipped and some other stuff too.
        Parameters:
        srcWidth - Width of the source image
        srcHeight - Height of the source image
        transform - Transform being applied to the image
        Returns:
        Bounding box
      • boundBoxInside

        public static RectangleLength2D_F64 boundBoxInside(int srcWidth,
                                                           int srcHeight,
                                                           PixelTransform_F64 transform)
        Finds the maximum area axis-aligned rectangle contained inside the transformed image which does not include any pixels outside the sources border. Assumes that the coordinates are not flipped and some other stuff too.
        Parameters:
        srcWidth - Width of the source image
        srcHeight - Height of the source image
        transform - Transform being applied to the image
        Returns:
        Bounding box
      • roundInside

        public static void roundInside(RectangleLength2D_F32 bound)
        Adjust bound to ensure the entire image is contained inside, otherwise there might be single pixel wide black regions
      • roundInside

        public static void roundInside(RectangleLength2D_F64 bound)
        Adjust bound to ensure the entire image is contained inside, otherwise there might be single pixel wide black regions

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.