Skip to content

groupRectangles

xobjdetectfunctionOpenCV 5.0.0
import { groupRectangles } from '@banou/opencv-wasm'

Use after await initOpenCV(). See the initialization and named imports guide.

ARGUMENTSrectList, weights, groupThreshold, eps
FUNCTIONgroupRectangles
RETURN TYPEvoid
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

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;
rectList

Input/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.)

weights

Output destination, filled by the native operation. weights argument (IntVector).

groupThreshold

Minimum possible number of rectangles minus 1. The threshold is used in a group of rectangles to retain it.

eps

Relative 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.