detect (cv.CascadeClassifier) - MATLAB File Help |
Detects objects of different sizes in the input image
boxes = classifier.detect(im)
[boxes, numDetections] = classifier.detect(im)
[boxes, rejectLevels, levelWeights] = classifier.detect(im)
[...] = classifier.detect(im, 'OptionName', optionValue, ...)
uint8
containing an image where
objects are detected.OutputRejectLevels=true
.OutputRejectLevels=true
.MaxSize == MinSize
model is evaluated
on single scale. Not set by default.rejectLevels
and
levelWeights
. default falsecvHaarDetectObjects
. It is not
used for a new cascade. default falsecvHaarDetectObjects
. It is not
used for a new cascade. default falsecvHaarDetectObjects
. It is
not used for a new cascade. default falsecvHaarDetectObjects
. It is not
used for a new cascade. default falseThe detected objects are returned as a cell array of rectangles. Note that the function has three variants based on the number of output arguments.
The function is parallelized with the TBB library.
The third variant allows you to retrieve the final stage
decision certainty of classification. For this, one needs to set
OutputRejectLevels
to true and request the rejectLevels
and
levelWeights
output arguments. 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:
model = cv.CascadeClassifier('/path/to/your/model.xml');
[boxes, levels, weights] = model.detect(img, 'OutputRejectLevels',true);
fprintf('Detection [%d,%d,%d,%d] with weight %f\n', boxes{1}, weights(1));
Access | public |
Sealed | false |
Static | false |