groupRectangles
import { groupRectangles } from '@banou/opencv-wasm'Use after await initOpenCV(). See the initialization and named imports guide.
Groups the object candidate rectangles.
groupRectangles(rectList: RectVector, weights: IntVector, groupThreshold: number, eps: number): void;2 available overloads
groupRectangles(rectList: RectVector, weights: IntVector, groupThreshold: number): void;groupRectangles(rectList: RectVector, weights: IntVector, groupThreshold: number, eps: number): void;rectListInput/output value, modified by the native operation. Input/output vector of rectangles. Output vector includes retained and grouped rectangles. (The Python list is not modified in place.)
weightsOutput destination, filled by the native operation. weights argument (IntVector).
groupThresholdMinimum possible number of rectangles minus 1. The threshold is used in a group of rectangles to retain it.
epsRelative difference between sides of the rectangles to merge them into a group.
The function is a wrapper for the generic function partition . 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
\texttt{eps}\rightarrow +\inf, all the rectangles are put in one cluster. Then, the small clusters containing less than or equal to groupThreshold rectangles are rejected. In each other cluster, the average rectangle is computed and put into the output rectangle list.
These signatures describe this package. Upstream documentation can mention optional backends that are absent from this build. Check runtime compatibility before choosing a backend or file format.