MATLAB File Help: cv.groupRectangles | Index |
Groups the object candidate rectangles
rects = cv.groupRectangles(rects)
[rects,weights,levelWeights] = cv.groupRectangles(...)
[...] = cv.groupRectangles(..., 'OptionName', optionValue, ...)
{[x,y,w,h], ...}
, or a numeric
Nx4/Nx1x4/1xNx4 array.rects
(either Nx4 numeric array or cell array). Grouped
rectangles are the average of all rectangles in that cluster.rects
. See Weights
option. Corresponding grouped weights
are the maximum weights of all rectangles in that cluster.rects
. See LevelWeights
option.rects
. Not set by defaultrects
. Not set by defaultThe function is a wrapper for the generic partition function. It clusters
all the input rectangles using the rectangle equivalence criteria that
combines rectangles with similar sizes and similar locations. The similarity
is defined by EPS
. When EPS=0
, no clustering is done at all. If
EPS -> +inf
, all the rectangles are put in one cluster. Then, the small
clusters containing less than or equal to Thresh
rectangles are rejected.
In each other cluster, the average rectangle is computed and put into the
output rectangle list. The function also filters out small rectangles inside
larger ones that have more hits.
The function is useful for non-max suppression of object detections.