Package boofcv.abst.filter.binary
Interface BinaryContourInterface
- All Known Subinterfaces:
BinaryContourFinder
,BinaryLabelContourFinder
- All Known Implementing Classes:
BinaryContourFinderLinearExternal
,BinaryLabelContourFinderChang2004
public interface BinaryContourInterface
Common interface for binary contour finders
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Many contour algorithms require that the binary image has an outside border of all zeros. -
Method Summary
Modifier and TypeMethodDescriptionstatic 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 listReturns a list of contours/blobs found.getMaxContour
(@Nullable ConfigLength length) Returns the maximum contour.getMinContour
(@Nullable ConfigLength length) Returns the minimum contourboolean
void
loadContour
(int contourID, DogArray<Point2D_I32> storage) Used to load the pixels associated with a contour.void
setConnectRule
(ConnectRule rule) void
setMaxContour
(ConfigLength length) Specifies the maximum contour as either an absolute value in pixels or a value relative to the sqrt(width*height).void
setMinContour
(ConfigLength length) Specifies the minimum contour as either an absolute value in pixels or a value relative to the sqrt(width*height).void
setSaveInnerContour
(boolean enabled) Used to toggle on and off the saving of inner contours.void
writeContour
(int contourID, List<Point2D_I32> storage) Overwrites the coordinates of the saved contour.
-
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
Used to load the pixels associated with a contour.- Parameters:
contourID
- ID of the contour you wish to loadstorage
- Storage for the contour points. Must be set to declare new elements.
-
writeContour
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 loadstorage
- 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
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
Returns the minimum contour- Parameters:
length
- Optional storage for the contour's length- Returns:
- The contour's length
-
setMaxContour
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
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
-
getConnectRule
ConnectRule getConnectRule() -
copyContour
Convenience function which loads a contour and creates copy of all the points and returns a new list- Returns:
- New copy of contour
-