Interface BinaryContourInterface

All Known Subinterfaces:
BinaryContourFinder, BinaryLabelContourFinder
All Known Implementing Classes:
BinaryContourFinderLinearExternal, BinaryLabelContourFinderChang2004

public interface BinaryContourInterface
Common interface for binary contour finders
  • Method Details

    • getContours

      List<ContourPacked> getContours()
      Returns a list of contours/blobs found. WARNING: List is recycled on the next call to process().
      Returns:
      List of contours.
    • loadContour

      void loadContour(int contourID, DogArray<Point2D_I32> storage)
      Used to load the pixels associated with a contour.
      Parameters:
      contourID - ID of the contour you wish to load
      storage - Storage for the contour points. Must be set to declare new elements.
    • writeContour

      void writeContour(int contourID, List<Point2D_I32> storage)
      Overwrites the coordinates of the saved contour. Useful when points have been undistorted and you're trying to minimize memory by not saving another copy
      Parameters:
      contourID - ID of the contour you wish to load
      storage - Storage for the contour points. Must be set to declare new elements.
    • setSaveInnerContour

      void setSaveInnerContour(boolean enabled)
      Used to toggle on and off the saving of inner contours.
      Parameters:
      enabled - true to enable or false to disable
    • isSaveInternalContours

      boolean isSaveInternalContours()
    • setMinContour

      void setMinContour(ConfigLength length)
      Specifies the minimum contour as either an absolute value in pixels or a value relative to the sqrt(width*height). Threshold ≤ 0 will be treated as infinite.
    • getMinContour

      ConfigLength getMinContour(@Nullable @Nullable ConfigLength length)
      Returns the minimum contour
      Parameters:
      length - Optional storage for the contour's length
      Returns:
      The contour's length
    • setMaxContour

      void setMaxContour(ConfigLength length)
      Specifies the maximum contour as either an absolute value in pixels or a value relative to the sqrt(width*height). Threshold ≤ 0 will be treated as infinite.
    • getMaxContour

      ConfigLength getMaxContour(@Nullable @Nullable ConfigLength length)
      Returns the maximum contour. Threshold %le; 0 will be treated as infinite.
      Parameters:
      length - Optional storage for the contour's length
      Returns:
      The contour's length
    • setConnectRule

      void setConnectRule(ConnectRule rule)
    • getConnectRule

      ConnectRule getConnectRule()
    • copyContour

      static List<Point2D_I32> copyContour(BinaryContourInterface finder, int contourID)
      Convenience function which loads a contour and creates copy of all the points and returns a new list
      Returns:
      New copy of contour