Documentation of 'boofcv.alg.shapes.corner.RefineCornerLinesToImage' Java class
RefineCornerLinesToImage
boofcv.alg.shapes.corner

Class RefineCornerLinesToImage<T extends ImageGray>



  • public class RefineCornerLinesToImage<T extends ImageGray>
    extends java.lang.Object

    Refines the estimate of a corner. A corner is defined as the intersection of two straight edges. The inside edge is either all darker or lighter than the background. The optimization function when refining the edge seeks to maximize the difference between the inside and outside of the edge. Internally SnapToEdge is used to perform this optimization.

    The corner is defined using three points. One corner and two line end points. One is to the left of the right line. Left is defined as counter-clockwise. Optimization is done by fitting a line with that initial seed. It is then iteratively updated by finding new end points with the new line that are the same distance away. Pixels near the corner are excluded from the optimization because the edge is less clear at that point.

    For input polygons which are in undistorted coordinates by with a distorted image call getSnapToEdge() and invoke BaseIntegralEdge.setTransform(PixelTransform_F32)}.

    • Constructor Detail

      • RefineCornerLinesToImage

        public RefineCornerLinesToImage(double cornerOffset,
                                        int maxLineSamples,
                                        int sampleRadius,
                                        int maxIterations,
                                        double convergeTolPixels,
                                        double maxCornerChange,
                                        java.lang.Class<T> imageType)
        Constructor which provides full access to all parameters. See code documents value a description of these variables.
        Parameters:
        cornerOffset - pixels this close to the corner will be ignored. Try 2
        maxLineSamples - Number of points along the line which will be sampled. try 10
        sampleRadius - How far away from the line will it sample pixels. ≥ 1
        maxIterations - Maximum number of iterations it will perform. Try 10
        convergeTolPixels - When the corner changes less than this amount it will stop iterating. Try 1e-5
        maxCornerChange - maximum change in corner location allowed from previous iteration in pixels. Try 2.0
      • RefineCornerLinesToImage

        public RefineCornerLinesToImage(java.lang.Class<T> imageType)
        Simplified constructor which uses reasonable default values for most variables
        Parameters:
        imageType - Type of input image it processes
    • Method Detail

      • refine

        public boolean refine(Point2D_F64 corner,
                              Point2D_F64 endLeft,
                              Point2D_F64 endRight)
        Refines the fit a polygon by snapping it to the edges.
        Parameters:
        corner - (input) Initial estimate of polygon corner. Not modified.
        endLeft - (input) End point of left line. Not modified.
        endRight - (input) End point of right line. Not modified.
      • getRefinedCorner

        public Point2D_F64 getRefinedCorner()
      • getRefinedEndLeft

        public Point2D_F64 getRefinedEndLeft()
      • getRefinedEndRight

        public Point2D_F64 getRefinedEndRight()

DataMelt 3.0 © DataMelt by jWork.ORG

Ads help maintain this website.