C# Class OpenCvSharp.CascadeClassifier

Cascade classifier class for object detection.
Inheritance: OpenCvSharp.DisposableCvObject
ファイルを表示 Open project: shimat/opencvsharp Class Usage Examples

Public Methods

Method Description
CascadeClassifier ( ) : System

Default constructor

CascadeClassifier ( string fileName ) : System

Loads a classifier from a file.

DetectMultiScale ( OpenCvSharp.Mat image, double scaleFactor = 1.1, int minNeighbors = 3, HaarDetectionType flags, Size minSize = null, Size maxSize = null ) : Rect[]

Detects objects of different sizes in the input image. The detected objects are returned as a list of rectangles.

DetectMultiScale ( OpenCvSharp.Mat image, int &rejectLevels, double &levelWeights, double scaleFactor = 1.1, int minNeighbors = 3, HaarDetectionType flags, Size minSize = null, Size maxSize = null, bool outputRejectLevels = false ) : Rect[]

Detects objects of different sizes in the input image. The detected objects are returned as a list of rectangles.

Empty ( ) : bool

Checks whether the classifier has been loaded.

GetFeatureType ( ) : int

GetOriginalWindowSize ( ) : Size

IsOldFormatCascade ( ) : bool

Load ( string fileName ) : bool

Loads a classifier from a file.

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Clean up any resources being used.

Method Details

CascadeClassifier() public method

Default constructor
public CascadeClassifier ( ) : System
return System

CascadeClassifier() public method

Loads a classifier from a file.
public CascadeClassifier ( string fileName ) : System
fileName string Name of the file from which the classifier is loaded.
return System

DetectMultiScale() public method

Detects objects of different sizes in the input image. The detected objects are returned as a list of rectangles.
public DetectMultiScale ( OpenCvSharp.Mat image, double scaleFactor = 1.1, int minNeighbors = 3, HaarDetectionType flags, Size minSize = null, Size maxSize = null ) : Rect[]
image OpenCvSharp.Mat Matrix of the type CV_8U containing an image where objects are detected.
scaleFactor double Parameter specifying how much the image size is reduced at each image scale.
minNeighbors int Parameter specifying how many neighbors each candidate rectangle should have to retain it.
flags HaarDetectionType Parameter with the same meaning for an old cascade as in the function cvHaarDetectObjects. /// It is not used for a new cascade.
minSize Size Minimum possible object size. Objects smaller than that are ignored.
maxSize Size Maximum possible object size. Objects larger than that are ignored.
return Rect[]

DetectMultiScale() public method

Detects objects of different sizes in the input image. The detected objects are returned as a list of rectangles.
public DetectMultiScale ( OpenCvSharp.Mat image, int &rejectLevels, double &levelWeights, double scaleFactor = 1.1, int minNeighbors = 3, HaarDetectionType flags, Size minSize = null, Size maxSize = null, bool outputRejectLevels = false ) : Rect[]
image OpenCvSharp.Mat Matrix of the type CV_8U containing an image where objects are detected.
rejectLevels int
levelWeights double
scaleFactor double Parameter specifying how much the image size is reduced at each image scale.
minNeighbors int Parameter specifying how many neighbors each candidate rectangle should have to retain it.
flags HaarDetectionType Parameter with the same meaning for an old cascade as in the function cvHaarDetectObjects. /// It is not used for a new cascade.
minSize Size Minimum possible object size. Objects smaller than that are ignored.
maxSize Size Maximum possible object size. Objects larger than that are ignored.
outputRejectLevels bool
return Rect[]

Dispose() protected method

Clean up any resources being used.
protected Dispose ( bool disposing ) : void
disposing bool /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. ///
return void

Empty() public method

Checks whether the classifier has been loaded.
public Empty ( ) : bool
return bool

GetFeatureType() public method

public GetFeatureType ( ) : int
return int

GetOriginalWindowSize() public method

public GetOriginalWindowSize ( ) : Size
return Size

IsOldFormatCascade() public method

public IsOldFormatCascade ( ) : bool
return bool

Load() public method

Loads a classifier from a file.
public Load ( string fileName ) : bool
fileName string Name of the file from which the classifier is loaded. /// The file may contain an old HAAR classifier trained by the haartraining application /// or a new cascade classifier trained by the traincascade application.
return bool