ximgproc_segmentation_GraphSegmentation
import { ximgproc_segmentation_GraphSegmentation } from '@banou/opencv-wasm'Use after await initOpenCV(). See the initialization and named imports guide.
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;The this result.
processImage
Segment an image and store output in dst
processImage(src: Mat, dst: Mat): void;srcThe input image. Any number of channel (1 (Eg: Gray), 3 (Eg: RGB), 4 (Eg: RGB-D)) can be provided
dstOutput 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;sigmasigma argument (number).
getSigma
Return the sigma configured on this ximgproc_segmentation_GraphSegmentation object.
getSigma(): number;The number result.
setK
Set the k used by this ximgproc_segmentation_GraphSegmentation object.
setK(k: number): void;kk argument (number).
getK
Return the k configured on this ximgproc_segmentation_GraphSegmentation object.
getK(): number;The number result.
setMinSize
Set the min size used by this ximgproc_segmentation_GraphSegmentation object.
setMinSize(min_size: number): void;min_sizemin size argument (number).
getMinSize
Return the min size configured on this ximgproc_segmentation_GraphSegmentation object.
getMinSize(): number;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.