Class RemovePerspectiveDistortion<T extends boofcv.struct.image.ImageBase<T>>


  • public class RemovePerspectiveDistortion<T extends boofcv.struct.image.ImageBase<T>>
    extends java.lang.Object
    Class which simplifies the removal of perspective distortion from a region inside an image. Given the ordered corners of a quadrilateral in the input image it applies a homography transform which reprojects the region into the input image into a rectangular output image.
    • Constructor Summary

      Constructors 
      Constructor Description
      RemovePerspectiveDistortion​(int width, int height)
      Creates the variables for computing the transform but not rendering the image
      RemovePerspectiveDistortion​(int width, int height, boofcv.struct.image.ImageType<T> imageType)
      Constructor which specifies the characteristics of the undistorted image
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean apply​(T input, georegression.struct.point.Point2D_F64 corner0, georegression.struct.point.Point2D_F64 corner1, georegression.struct.point.Point2D_F64 corner2, georegression.struct.point.Point2D_F64 corner3)
      Applies distortion removal to the specified region in the input image.
      boolean createTransform​(georegression.struct.point.Point2D_F64 tl, georegression.struct.point.Point2D_F64 tr, georegression.struct.point.Point2D_F64 br, georegression.struct.point.Point2D_F64 bl)
      Compues the distortion removal transform
      org.ejml.data.DMatrixRMaj getH()  
      T getOutput()
      Returns the undistorted output image
      boofcv.alg.distort.PointTransformHomography_F32 getTransform()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RemovePerspectiveDistortion

        public RemovePerspectiveDistortion​(int width,
                                           int height,
                                           boofcv.struct.image.ImageType<T> imageType)
        Constructor which specifies the characteristics of the undistorted image
        Parameters:
        width - Width of undistorted image
        height - Height of undistorted image
        imageType - Type of undistorted image
      • RemovePerspectiveDistortion

        public RemovePerspectiveDistortion​(int width,
                                           int height)
        Creates the variables for computing the transform but not rendering the image
        Parameters:
        width - Width of undistorted image
        height - Height of undistorted image
    • Method Detail

      • apply

        public boolean apply​(T input,
                             georegression.struct.point.Point2D_F64 corner0,
                             georegression.struct.point.Point2D_F64 corner1,
                             georegression.struct.point.Point2D_F64 corner2,
                             georegression.struct.point.Point2D_F64 corner3)
        Applies distortion removal to the specified region in the input image. The undistorted image is returned.
        Parameters:
        input - Input image
        corner0 - Top left corner
        corner1 - Top right corner
        corner2 - Bottom right corner
        corner3 - Bottom left corner
        Returns:
        true if successful or false if it failed
      • createTransform

        public boolean createTransform​(georegression.struct.point.Point2D_F64 tl,
                                       georegression.struct.point.Point2D_F64 tr,
                                       georegression.struct.point.Point2D_F64 br,
                                       georegression.struct.point.Point2D_F64 bl)
        Compues the distortion removal transform
        Parameters:
        tl - Top left corner
        tr - Top right corner
        br - Bottom right corner
        bl - Bottom left corner
        Returns:
        true if successful or false if it failed
      • getH

        public org.ejml.data.DMatrixRMaj getH()
      • getTransform

        public boofcv.alg.distort.PointTransformHomography_F32 getTransform()
      • getOutput

        public T getOutput()
        Returns the undistorted output image