Interface PointsToPolyline

All Known Implementing Classes:
NewSplitMerge_to_PointsToPolyline, SplitMergeLineRefine_to_PointsToPolyline

public interface PointsToPolyline
Interface for algorithm which convert a continuous sequence of pixel coordinates into a polyline. A polyline is a polygon which is specified using points along the contour. Polyline can be a loop or it can be disconnected.
  • Method Summary

    Modifier and Type Method Description
    int getMaximumSides()  
    int getMinimumSides()  
    boolean isConvex()  
    boolean isLoop()
    Is it configured for loops or lines?
    boolean process​(List<Point2D_I32> input, DogArray_I32 vertexes)
    Computes a polyline from the set of image pixels.
    void setConvex​(boolean convex)
    Specifies if the found polygons will be convex or not.
    void setMaximumSides​(int maximum)
    Specifies the maximum allowed sides.
    void setMinimumSides​(int minimum)
    Specifies the minimum number of sides in a polyline that's returned By default the minimum is 3.
  • Method Details

    • process

      boolean process​(List<Point2D_I32> input, DogArray_I32 vertexes)
      Computes a polyline from the set of image pixels.
      Parameters:
      input - (Input) List of points in order
      vertexes - (Output) Indexes in the input list which are corners in the polyline
      Returns:
      true if successful or false if no fit could be found which matched the requirements
    • setMinimumSides

      void setMinimumSides​(int minimum)
      Specifies the minimum number of sides in a polyline that's returned By default the minimum is 3.
      Parameters:
      minimum - The minimum number of allowed vertices
    • getMinimumSides

      int getMinimumSides()
    • setMaximumSides

      void setMaximumSides​(int maximum)
      Specifies the maximum allowed sides. How this is interpreted is implementation specific. For example, two possible interpretations are that it could abort if the number of sides is more than this or to only considered up to this number of sides. The number of found sides will never exceed this number. By default the maximum is Integer.MAX_VALUE.
      Parameters:
      maximum - The maximum number of allowed vertices
    • getMaximumSides

      int getMaximumSides()
    • isLoop

      boolean isLoop()
      Is it configured for loops or lines?
      Returns:
      true means it assumes the input points form a loop.
    • setConvex

      void setConvex​(boolean convex)
      Specifies if the found polygons will be convex or not. If the polyline doesn't sloop this should be set to false. Default is true.
    • isConvex

      boolean isConvex()