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, 'Option', optionValue, ...)
Input
- im Matrix of the type
uint8
containing an image where
objects are detected.
Output
- boxes Cell array of rectangles where each rectangle
contains the detected object, the rectangles may be
partially outside the original image.
- numDetections optional 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.
- rejectLevels optional output vector of integers. Implies
OutputRejectLevels=true
.
- levelWeights optional output vector of doubles. Implies
OutputRejectLevels=true
.
Options
- ScaleFactor Parameter specifying how much the image size
is reduced at each image scale. default 1.1
- MinNeighbors Parameter specifying how many neighbors each
candiate rectangle should have to retain it. default 3
- MinSize Minimum possible object size. Objects smaller than
that are ignored. Not set by default.
- MaxSize Maximum possible object size. Objects larger than
that are ignored. Not set by default.
- OutputRejectLevels if is true returns
rejectLevels
and
levelWeights
. default false
- DoCannyPruning Parameter with the same meaning for an old
cascade as in the function
cvHaarDetectObjects
. It is
not used for a new cascade. default false
- ScaleImage Parameter with the same meaning for an old
cascade as in the function
cvHaarDetectObjects
. It is
not used for a new cascade. default false
- FindBiggestObject Parameter with the same meaning for an
old cascade as in the function
cvHaarDetectObjects
. It
is not used for a new cascade. default false
- DoRoughSearch Parameter with the same meaning for an old
cascade as in the function
cvHaarDetectObjects
. It is
not used for a new cascade. default false
The 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.