View Source Evision.CascadeClassifier (Evision v0.1.8)
Link to this section Summary
cv
Python prototype (for reference):
Loads a classifier from a file.
Positional Arguments
image:
Evision.Mat
.
Positional Arguments
image:
Evision.Mat
.
Positional Arguments
- image:
Evision.Mat
Keyword Arguments
- scaleFactor:
double
. - minNeighbors:
int
. - flags:
int
. - minSize:
Size
. - maxSize:
Size
. - outputRejectLevels:
bool
.
Return
- objects:
[Rect]
- rejectLevels:
[int]
- levelWeights:
[double]
Has overloading in C++
Positional Arguments
- image:
Evision.Mat
Keyword Arguments
- scaleFactor:
double
. - minNeighbors:
int
. - flags:
int
. - minSize:
Size
. - maxSize:
Size
. - outputRejectLevels:
bool
.
Return
- objects:
[Rect]
- rejectLevels:
[int]
- levelWeights:
[double]
Has overloading in C++
Detects objects of different sizes in the input image. The detected objects are returned as a list of rectangles.
Detects objects of different sizes in the input image. The detected objects are returned as a list of rectangles.
Checks whether the classifier has been loaded.
Python prototype (for reference):
Python prototype (for reference):
Python prototype (for reference):
Loads a classifier from a file.
Reads a classifier from a FileStorage node.
Functions
Raising version of cascadeClassifier/0
.
Raising version of cascadeClassifier/1
.
Raising version of convert/2
.
Raising version of detectMultiScale2/2
.
Raising version of detectMultiScale2/3
.
Raising version of detectMultiScale3/2
.
Raising version of detectMultiScale3/3
.
Raising version of detectMultiScale/2
.
Raising version of detectMultiScale/3
.
Raising version of empty/1
.
Raising version of getFeatureType/1
.
Raising version of getOriginalWindowSize/1
.
Raising version of isOldFormatCascade/1
.
Raising version of load/2
.
Raising version of read/2
.
Link to this section cv
Python prototype (for reference):
CascadeClassifier() -> <CascadeClassifier object>
Loads a classifier from a file.
Positional Arguments
filename:
String
.Name of the file from which the classifier is loaded.
Python prototype (for reference):
CascadeClassifier(filename) -> <CascadeClassifier object>
Positional Arguments
Python prototype (for reference):
convert(oldcascade, newcascade) -> retval
Positional Arguments
image:
Evision.Mat
.Matrix of the type CV_8U containing an image where objects are detected.
Keyword Arguments
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:
int
.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. If
maxSize == minSize
model is evaluated on single scale.
Return
objects:
[Rect]
.Vector of rectangles where each rectangle contains the detected object, the rectangles may be partially outside the original image.
numDetections:
[int]
.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.
Has overloading in C++
Python prototype (for reference):
detectMultiScale2(image[, scaleFactor[, minNeighbors[, flags[, minSize[, maxSize]]]]]) -> objects, numDetections
Positional Arguments
image:
Evision.Mat
.Matrix of the type CV_8U containing an image where objects are detected.
Keyword Arguments
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:
int
.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. If
maxSize == minSize
model is evaluated on single scale.
Return
objects:
[Rect]
.Vector of rectangles where each rectangle contains the detected object, the rectangles may be partially outside the original image.
numDetections:
[int]
.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.
Has overloading in C++
Python prototype (for reference):
detectMultiScale2(image[, scaleFactor[, minNeighbors[, flags[, minSize[, maxSize]]]]]) -> objects, numDetections
Positional Arguments
- image:
Evision.Mat
Keyword Arguments
- scaleFactor:
double
. - minNeighbors:
int
. - flags:
int
. - minSize:
Size
. - maxSize:
Size
. - outputRejectLevels:
bool
.
Return
- objects:
[Rect]
- rejectLevels:
[int]
- levelWeights:
[double]
Has overloading in C++
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:
Mat img;
vector<double> weights;
vector<int> levels;
vector<Rect> detections;
CascadeClassifier model("/path/to/your/model.xml");
model.detectMultiScale(img, detections, levels, weights, 1.1, 3, 0, Size(), Size(), true);
cerr << "Detection " << detections[0] << " with weight " << weights[0] << endl;
Python prototype (for reference):
detectMultiScale3(image[, scaleFactor[, minNeighbors[, flags[, minSize[, maxSize[, outputRejectLevels]]]]]]) -> objects, rejectLevels, levelWeights
Positional Arguments
- image:
Evision.Mat
Keyword Arguments
- scaleFactor:
double
. - minNeighbors:
int
. - flags:
int
. - minSize:
Size
. - maxSize:
Size
. - outputRejectLevels:
bool
.
Return
- objects:
[Rect]
- rejectLevels:
[int]
- levelWeights:
[double]
Has overloading in C++
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:
Mat img;
vector<double> weights;
vector<int> levels;
vector<Rect> detections;
CascadeClassifier model("/path/to/your/model.xml");
model.detectMultiScale(img, detections, levels, weights, 1.1, 3, 0, Size(), Size(), true);
cerr << "Detection " << detections[0] << " with weight " << weights[0] << endl;
Python prototype (for reference):
detectMultiScale3(image[, scaleFactor[, minNeighbors[, flags[, minSize[, maxSize[, outputRejectLevels]]]]]]) -> objects, rejectLevels, levelWeights
Detects objects of different sizes in the input image. The detected objects are returned as a list of rectangles.
Positional Arguments
image:
Evision.Mat
.Matrix of the type CV_8U containing an image where objects are detected.
Keyword Arguments
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:
int
.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. If
maxSize == minSize
model is evaluated on single scale.
Return
objects:
[Rect]
.Vector of rectangles where each rectangle contains the detected object, the rectangles may be partially outside the original image.
Python prototype (for reference):
detectMultiScale(image[, scaleFactor[, minNeighbors[, flags[, minSize[, maxSize]]]]]) -> objects
Detects objects of different sizes in the input image. The detected objects are returned as a list of rectangles.
Positional Arguments
image:
Evision.Mat
.Matrix of the type CV_8U containing an image where objects are detected.
Keyword Arguments
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:
int
.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. If
maxSize == minSize
model is evaluated on single scale.
Return
objects:
[Rect]
.Vector of rectangles where each rectangle contains the detected object, the rectangles may be partially outside the original image.
Python prototype (for reference):
detectMultiScale(image[, scaleFactor[, minNeighbors[, flags[, minSize[, maxSize]]]]]) -> objects
Checks whether the classifier has been loaded.
Python prototype (for reference):
empty() -> retval
Python prototype (for reference):
getFeatureType() -> retval
Python prototype (for reference):
getOriginalWindowSize() -> retval
Python prototype (for reference):
isOldFormatCascade() -> retval
Loads a classifier from a file.
Positional Arguments
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.
Python prototype (for reference):
load(filename) -> retval
Reads a classifier from a FileStorage node.
Positional Arguments
- node:
FileNode
Note: The file may contain a new cascade classifier (trained by the traincascade application) only.
Python prototype (for reference):
read(node) -> retval
Link to this section Functions
Raising version of cascadeClassifier/0
.
Raising version of cascadeClassifier/1
.
Raising version of convert/2
.
Raising version of detectMultiScale2/2
.
Raising version of detectMultiScale2/3
.
Raising version of detectMultiScale3/2
.
Raising version of detectMultiScale3/3
.
Raising version of detectMultiScale/2
.
Raising version of detectMultiScale/3
.
Raising version of empty/1
.
Raising version of getFeatureType/1
.
Raising version of getOriginalWindowSize/1
.
Raising version of isOldFormatCascade/1
.
Raising version of load/2
.
Raising version of read/2
.