Package boofcv.abst.filter.binary
Class BinaryContourFinderLinearExternal
java.lang.Object
boofcv.abst.filter.binary.BinaryContourFinderLinearExternal
- All Implemented Interfaces:
BinaryContourFinder
,BinaryContourInterface
,BinaryContourInterface.Padded
public class BinaryContourFinderLinearExternal extends Object implements BinaryContourFinder, BinaryContourInterface.Padded
Wrapper around
LinearExternalContours
-
Nested Class Summary
Nested classes/interfaces inherited from interface boofcv.abst.filter.binary.BinaryContourInterface
BinaryContourInterface.Padded
-
Constructor Summary
Constructors Constructor Description BinaryContourFinderLinearExternal()
-
Method Summary
Modifier and Type Method Description ConnectRule
getConnectRule()
List<ContourPacked>
getContours()
Returns a list of contours/blobs found.int
getMaxContour()
int
getMinContour()
boolean
isCreatePaddedCopy()
boolean
isSaveInternalContours()
void
loadContour(int contourID, DogArray<Point2D_I32> storage)
Used to load the pixels associated with a contour.void
process(GrayU8 binary)
Processes the binary image to find the contour.void
setConnectRule(ConnectRule rule)
void
setCoordinateAdjustment(int x, int y)
Adjustment applied to pixel coordinate of contour points.void
setCreatePaddedCopy(boolean padded)
If this is set o true then internally it will create a copy of the input image with a 1-pixel border added.void
setMaxContour(int length)
void
setMinContour(int length)
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.
-
Constructor Details
-
BinaryContourFinderLinearExternal
public BinaryContourFinderLinearExternal()
-
-
Method Details
-
process
Description copied from interface:BinaryContourFinder
Processes the binary image to find the contour. If you let the input be modified you really need to read up on how the contour algorithm works. Setting the outside border to zero is typical- Specified by:
process
in interfaceBinaryContourFinder
- Parameters:
binary
- Input binary image. Not modified.
-
getContours
Description copied from interface:BinaryContourInterface
Returns a list of contours/blobs found. WARNING: List is recycled on the next call to process().- Specified by:
getContours
in interfaceBinaryContourInterface
- Returns:
- List of contours.
-
loadContour
Description copied from interface:BinaryContourInterface
Used to load the pixels associated with a contour.- Specified by:
loadContour
in interfaceBinaryContourInterface
- Parameters:
contourID
- ID of the contour you wish to loadstorage
- Storage for the contour points. Must be set to declare new elements.
-
writeContour
Description copied from interface:BinaryContourInterface
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- Specified by:
writeContour
in interfaceBinaryContourInterface
- Parameters:
contourID
- ID of the contour you wish to loadstorage
- Storage for the contour points. Must be set to declare new elements.
-
setSaveInnerContour
public void setSaveInnerContour(boolean enabled)Description copied from interface:BinaryContourInterface
Used to toggle on and off the saving of inner contours.- Specified by:
setSaveInnerContour
in interfaceBinaryContourInterface
- Parameters:
enabled
- true to enable or false to disable
-
isSaveInternalContours
public boolean isSaveInternalContours()- Specified by:
isSaveInternalContours
in interfaceBinaryContourInterface
-
setMinContour
public void setMinContour(int length)- Specified by:
setMinContour
in interfaceBinaryContourInterface
-
getMinContour
public int getMinContour()- Specified by:
getMinContour
in interfaceBinaryContourInterface
-
setMaxContour
public void setMaxContour(int length)- Specified by:
setMaxContour
in interfaceBinaryContourInterface
-
getMaxContour
public int getMaxContour()- Specified by:
getMaxContour
in interfaceBinaryContourInterface
-
setConnectRule
- Specified by:
setConnectRule
in interfaceBinaryContourInterface
-
getConnectRule
- Specified by:
getConnectRule
in interfaceBinaryContourInterface
-
setCreatePaddedCopy
public void setCreatePaddedCopy(boolean padded)Description copied from interface:BinaryContourInterface.Padded
If this is set o true then internally it will create a copy of the input image with a 1-pixel border added. You probably want to also adjust the coordinates using a value of (1,1)- Specified by:
setCreatePaddedCopy
in interfaceBinaryContourInterface.Padded
-
isCreatePaddedCopy
public boolean isCreatePaddedCopy()- Specified by:
isCreatePaddedCopy
in interfaceBinaryContourInterface.Padded
-
setCoordinateAdjustment
public void setCoordinateAdjustment(int x, int y)Description copied from interface:BinaryContourInterface.Padded
Adjustment applied to pixel coordinate of contour points. Only used if a padded copy is NOT done.- Specified by:
setCoordinateAdjustment
in interfaceBinaryContourInterface.Padded
-