opencv on mbed
CascadeClassifier Class Reference
[Object Detection]
Cascade classifier class for object detection. More...
#include <objdetect.hpp>
Public Member Functions | |
CV_WRAP | CascadeClassifier (const String &filename) |
Loads a classifier from a file. | |
CV_WRAP bool | empty () const |
Checks whether the classifier has been loaded. | |
CV_WRAP bool | load (const String &filename) |
Loads a classifier from a file. | |
CV_WRAP bool | read (const FileNode &node) |
Reads a classifier from a FileStorage node. | |
CV_WRAP void | detectMultiScale (InputArray image, CV_OUT std::vector< Rect > &objects, double scaleFactor=1.1, int minNeighbors=3, int flags=0, Size minSize=Size(), Size maxSize=Size()) |
Detects objects of different sizes in the input image. | |
CV_WRAP_AS (detectMultiScale2) void detectMultiScale(InputArray image | |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
CV_WRAP_AS (detectMultiScale3) void detectMultiScale(InputArray image | |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. if `outputRejectLevels` is `true` returns `rejectLevels` and `levelWeights`. |
Detailed Description
Cascade classifier class for object detection.
Definition at line 220 of file objdetect.hpp.
Constructor & Destructor Documentation
CV_WRAP CascadeClassifier | ( | const String & | filename ) |
Loads a classifier from a file.
- Parameters:
-
filename Name of the file from which the classifier is loaded.
Member Function Documentation
CV_WRAP_AS | ( | detectMultiScale2 | ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- Parameters:
-
image Matrix of the type CV_8U containing an image where objects are detected. objects Vector of rectangles where each rectangle contains the detected object, the rectangles may be partially outside the original image. numDetections Vector of detection numbers for the corresponding objects. An object's number of detections is the number of neighboring positively classified rectangles that were joined together to form the object. scaleFactor Parameter specifying how much the image size is reduced at each image scale. minNeighbors Parameter specifying how many neighbors each candidate rectangle should have to retain it. flags Parameter with the same meaning for an old cascade as in the function cvHaarDetectObjects. It is not used for a new cascade. minSize Minimum possible object size. Objects smaller than that are ignored. maxSize Maximum possible object size. Objects larger than that are ignored.
CV_WRAP_AS | ( | detectMultiScale3 | ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. if `outputRejectLevels` is `true` returns `rejectLevels` and `levelWeights`.
CV_WRAP void detectMultiScale | ( | InputArray | image, |
CV_OUT std::vector< Rect > & | objects, | ||
double | scaleFactor = 1.1 , |
||
int | minNeighbors = 3 , |
||
int | flags = 0 , |
||
Size | minSize = Size() , |
||
Size | maxSize = Size() |
||
) |
Detects objects of different sizes in the input image.
The detected objects are returned as a list of rectangles.
- Parameters:
-
image Matrix of the type CV_8U containing an image where objects are detected. objects Vector of rectangles where each rectangle contains the detected object, the rectangles may be partially outside the original image. scaleFactor Parameter specifying how much the image size is reduced at each image scale. minNeighbors Parameter specifying how many neighbors each candidate rectangle should have to retain it. flags Parameter with the same meaning for an old cascade as in the function cvHaarDetectObjects. It is not used for a new cascade. minSize Minimum possible object size. Objects smaller than that are ignored. maxSize Maximum possible object size. Objects larger than that are ignored.
The function is parallelized with the TBB library.
- Note:
- (Python) A face detection example using cascade classifiers can be found at opencv_source_code/samples/python/facedetect.py
CV_WRAP bool empty | ( | ) | const |
Checks whether the classifier has been loaded.
CV_WRAP bool load | ( | const String & | filename ) |
Loads a classifier from a file.
- Parameters:
-
filename 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.
CV_WRAP bool read | ( | const FileNode & | node ) |
Reads a classifier from a FileStorage node.
- Note:
- The file may contain a new cascade classifier (trained traincascade application) only.
Generated on Tue Jul 12 2022 16:42:44 by 1.7.2