Skip to content

ximgproc_segmentation_SelectiveSearchSegmentationStrategy

Extended image processingclassOpenCV 5.0.0
import { ximgproc_segmentation_SelectiveSearchSegmentationStrategy } from '@banou/opencv-wasm'

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

ARGUMENTSConstructor or factory
CLASSximgproc_segmentation_SelectiveSearchSegmentationStrategy
RETURN TYPEOwned native handle
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

Native object: release it with using or delete(). Factories can return null; check before calling methods. Inherits Algorithm.

Strategie for the selective search segmentation algorithm The class implements a generic stragery for the algorithm described in [uijlings2013selective].

Constructors and members

clone

Create another handle to the same native object. This retains the object without copying its pixels or algorithm state; dispose both handles separately.

clone(): this;
Returns

The this result.

setImage

Set a initial image, with a segmentation.

setImage(img: Mat, regions: Mat, sizes: Mat, image_id: number): void;
2 available overloads
setImage(img: Mat, regions: Mat, sizes: Mat): void;
setImage(img: Mat, regions: Mat, sizes: Mat, image_id: number): void;
img

The input image. Any number of channel can be provided

regions

A segmentation of the image. The parameter must be the same size of img.

sizes

The sizes of different regions

image_id

If not set to -1, try to cache pre-computations. If the same set og (img, regions, size) is used, the image_id need to be the same.

get

Return the score between two regions (between 0 and 1)

get(r1: number, r2: number): number;
r1

The first region

r2

The second region

Returns

The number result.

merge

Inform the strategy that two regions will be merged

merge(r1: number, r2: number): void;
r1

The first region

r2

The second region

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.