Skip to content

ximgproc_segmentation_GraphSegmentation

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

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

ARGUMENTSConstructor or factory
CLASSximgproc_segmentation_GraphSegmentation
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.

Graph Based Segmentation Algorithm. The class implements the algorithm described in [PFF2004] .

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.

processImage

Segment an image and store output in dst

processImage(src: Mat, dst: Mat): void;
src

The input image. Any number of channel (1 (Eg: Gray), 3 (Eg: RGB), 4 (Eg: RGB-D)) can be provided

dst

Output destination, filled by the native operation. The output segmentation. It's a CV_32SC1 Mat with the same number of cols and rows as input image, with an unique, sequential, id for each pixel.

setSigma

Set the sigma used by this ximgproc_segmentation_GraphSegmentation object.

setSigma(sigma: number): void;
sigma

sigma argument (number).

getSigma

Return the sigma configured on this ximgproc_segmentation_GraphSegmentation object.

getSigma(): number;
Returns

The number result.

setK

Set the k used by this ximgproc_segmentation_GraphSegmentation object.

setK(k: number): void;
k

k argument (number).

getK

Return the k configured on this ximgproc_segmentation_GraphSegmentation object.

getK(): number;
Returns

The number result.

setMinSize

Set the min size used by this ximgproc_segmentation_GraphSegmentation object.

setMinSize(min_size: number): void;
min_size

min size argument (number).

getMinSize

Return the min size configured on this ximgproc_segmentation_GraphSegmentation object.

getMinSize(): number;
Returns

The number result.

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.