OpenCV453
|
Cascade classifier class for object detection. [詳解]
#include <objdetect.hpp>
公開メンバ関数 | |
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. The detected objects are returned as a list of rectangles. [詳解] | |
CV_WRAP_AS (detectMultiScale2) void detectMultiScale(InputArray image | |
CV_WRAP_AS (detectMultiScale3) void detectMultiScale(InputArray image | |
CV_WRAP bool | isOldFormatCascade () const |
CV_WRAP Size | getOriginalWindowSize () const |
CV_WRAP int | getFeatureType () const |
void * | getOldCascade () |
void | setMaskGenerator (const Ptr< BaseCascadeClassifier::MaskGenerator > &maskGenerator) |
Ptr< BaseCascadeClassifier::MaskGenerator > | getMaskGenerator () |
静的公開メンバ関数 | |
static CV_WRAP bool | convert (const String &oldcascade, const String &newcascade) |
公開変数類 | |
CV_OUT std::vector< Rect > & | objects |
CV_OUT std::vector< Rect > CV_OUT std::vector< int > & | numDetections |
CV_OUT std::vector< Rect > CV_OUT std::vector< int > double | scaleFactor =1.1 |
CV_OUT std::vector< Rect > CV_OUT std::vector< int > double int | minNeighbors =3 |
CV_OUT std::vector< Rect > CV_OUT std::vector< int > double int int | flags =0 |
CV_OUT std::vector< Rect > CV_OUT std::vector< int > double int int Size | minSize =Size() |
CV_OUT std::vector< Rect > CV_OUT std::vector< int > double int int Size Size | maxSize =Size() ) |
CV_OUT std::vector< Rect > CV_OUT std::vector< int > & | rejectLevels |
CV_OUT std::vector< Rect > CV_OUT std::vector< int > CV_OUT std::vector< double > & | levelWeights |
CV_OUT std::vector< Rect > CV_OUT std::vector< int > CV_OUT std::vector< double > double | scaleFactor = 1.1 |
CV_OUT std::vector< Rect > CV_OUT std::vector< int > CV_OUT std::vector< double > double int | minNeighbors = 3 |
CV_OUT std::vector< Rect > CV_OUT std::vector< int > CV_OUT std::vector< double > double int int | flags = 0 |
CV_OUT std::vector< Rect > CV_OUT std::vector< int > CV_OUT std::vector< double > double int int Size | minSize = Size() |
CV_OUT std::vector< Rect > CV_OUT std::vector< int > CV_OUT std::vector< double > double int int Size Size | maxSize = Size() |
CV_OUT std::vector< Rect > CV_OUT std::vector< int > CV_OUT std::vector< double > double int int Size Size bool | outputRejectLevels = false ) |
Ptr< BaseCascadeClassifier > | cc |
Cascade classifier class for object detection.
CV_WRAP cv::CascadeClassifier::CascadeClassifier | ( | const String & | filename | ) |
Loads a classifier from a file.
filename | Name of the file from which the classifier is loaded. |
cv::CascadeClassifier::CV_WRAP_AS | ( | detectMultiScale2 | ) |
これはオーバーロードされたメンバ関数です。利便性のために用意されています。元の関数との違いは引き数のみです。
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. If maxSize == minSize model is evaluated on single scale. |
cv::CascadeClassifier::CV_WRAP_AS | ( | detectMultiScale3 | ) |
これはオーバーロードされたメンバ関数です。利便性のために用意されています。元の関数との違いは引き数のみです。 This function allows you to retrieve the final stage decision certainty of classification. For this, one needs to set outputRejectLevels
on true and provide the rejectLevels
and levelWeights
parameter. For each resulting detection, levelWeights
will then contain the certainty of classification at the final stage. This value can then be used to separate strong from weaker classifications.
A code sample on how to use it efficiently can be found below:
CV_WRAP void cv::CascadeClassifier::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.
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. If maxSize == minSize model is evaluated on single scale. |
The function is parallelized with the TBB library.
CV_WRAP bool cv::CascadeClassifier::load | ( | const String & | filename | ) |
Loads a classifier from a file.
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 cv::CascadeClassifier::read | ( | const FileNode & | node | ) |
Reads a classifier from a FileStorage node.