Class HaarClassifierCascade
Represents a cascade or tree of boosted Haar stage classifiers.
Namespace: OpenCV.Net
Assembly: OpenCV.Net.dll
Syntax
public class HaarClassifierCascade : CVHandle
Methods
| Improve this Doc View SourceDetectObjects(Arr, MemStorage, Double, Int32, HaarDetectObjectFlags, Size, Size)
Detects objects in the image.
Declaration
public Seq DetectObjects(Arr image, MemStorage storage, double scaleFactor = 1.1, int minNeighbors = 3, HaarDetectObjectFlags flags = default(HaarDetectObjectFlags), Size minSize = default(Size), Size maxSize = default(Size))
Parameters
Type | Name | Description |
---|---|---|
Arr | image | Image to detect objects in. |
MemStorage | storage | Memory storage to store the resultant sequence of the object candidate rectangles. |
Double | scaleFactor | The factor by which the search window is scaled between the subsequent scans, 1.1 means increasing window by 10%. |
Int32 | minNeighbors | Minimum number (minus 1) of neighbor rectangles that make up an object. All the groups of a smaller number of
rectangles than |
HaarDetectObjectFlags | flags | Mode of operation. |
Size | minSize | Minimum window size. By default, it is set to the size of samples the classifier has been trained on (20x20 for face detection). |
Size | maxSize | Maximum window size. By default, it is set to the total image size. |
Returns
Type | Description |
---|---|
Seq | The sequence of grouped (or ungrouped) object rectangles. |
Load(String)
Loads a boosted Haar classifier cascade from a file. This method ensures that all dependencies are loaded and is a temporary workaround to ensure Load<TElement>(String, MemStorage, String) does not throw an error.
Declaration
public static HaarClassifierCascade Load(string fileName)
Parameters
Type | Name | Description |
---|---|---|
String | fileName | The path to the trained classifier cascade. |
Returns
Type | Description |
---|---|
HaarClassifierCascade | A new instance of the HaarClassifierCascade class. |
ReleaseHandle()
Executes the code required to free the native HaarClassifierCascade handle.
Declaration
protected override bool ReleaseHandle()
Returns
Type | Description |
---|---|
Boolean | true if the handle is released successfully; otherwise, in the event of a catastrophic failure, false. |