public class DetectQuadBlobsBinary
extends java.lang.Object
Detects blobs inside a binary image which are at least approximate a quadrilateral crudely. Blobs have a minimum contour size and side ratio. If the number of blobs is known before hand processing is reduced by specifying that minimum number.
For each blob that it finds it will find the approximate location of the four corners. Other information is computed for each blob such as its contour and side length. Blobs are removed if they touch the image border and have a hole inside.
| Constructor and Description |
|---|
DetectQuadBlobsBinary(int minContourSize,
double polySideRatio,
int minimumBlobCount)
Constructor and specify pruning parameters
|
| Modifier and Type | Method and Description |
|---|---|
java.util.List<QuadBlob> |
getDetected()
List of valid quadrilateral blobs.
|
java.util.List<QuadBlob> |
getInvalid()
List of found blobs that did not pass geometric tests..
|
boofcv.struct.image.ImageSInt32 |
getLabeledImage()
Return the labeled blob image.
|
java.lang.String |
getMessage()
Message explaining failure case.
|
int |
getNumLabels()
Number of objects in the labeled image.
|
boolean |
process(boofcv.struct.image.ImageUInt8 binary)
Detects quadrilateral like blobs in the binary image.
|
void |
setMinContourSize(int minContourSize)
Specify the minimum size of a blob's contour
|
public DetectQuadBlobsBinary(int minContourSize,
double polySideRatio,
int minimumBlobCount)
minContourSize - Minimum allowed pixels in blob contour. Try 10polySideRatio - Prune threshold based on side length. 0 to 1. Typically 0.25minimumBlobCount - Stop processing if fewer than this number of blobs have been detectedpublic void setMinContourSize(int minContourSize)
minContourSize - Contour size in pixelspublic boolean process(boofcv.struct.image.ImageUInt8 binary)
getMessage() for more information
of the failure.binary - Binary image being processed.public java.util.List<QuadBlob> getDetected()
public java.util.List<QuadBlob> getInvalid()
public java.lang.String getMessage()
public boofcv.struct.image.ImageSInt32 getLabeledImage()
getNumLabels() to get the number of labeled objects inside.public int getNumLabels()