Interface PolygonHelper

    • Method Detail

      • setImageShape

        void setImageShape​(int width,
                           int height)
        Specifies width and height of the image being processed
        Parameters:
        width - Image width in pixels
        height - Image height in pixels
      • filterContour

        boolean filterContour​(java.util.List<Point2D_I32> contour,
                              boolean touchesBorder,
                              boolean distorted)
        User defined filter to accept/reject or modify the contour of a shape. Called at most twice. First with distorted pixels and after distortion has been removed.
        Parameters:
        contour - External contour around a shape. Can be modified
        touchesBorder - true if the contour touches the image border or false if it doesnt
        distorted - True if pixels are distorted or false for undistorted pixel coordinates
        Returns:
        true to keep the contour for further processing or false to reject it
      • filterPixelPolygon

        boolean filterPixelPolygon​(Polygon2D_F64 undistorted,
                                   Polygon2D_F64 distorted,
                                   GrowQueue_B touches,
                                   boolean touchesBorder)
        Function which allows a custom filter function to be used on the pixel level precise polygon
        Parameters:
        undistorted - Polygon in undistorted image pixels.
        distorted - Polygon in distorted/original image pixels.
        touches - Array of booleans indicating which corners touch the image border. Only valid if part of it touches
        touchesBorder - true if the contour touches the image border or false if it doesnt
        Returns:
        true to keep the contour for further processing or false to reject it
      • configureBeforePolyline

        void configureBeforePolyline​(PointsToPolyline contourToPolyline,
                                     boolean touchesBorder)
        Provide an oportunity to configure the polyline fit based on what's currently known