Skip to content

ximgproc_createSuperpixelLSC

Extended image processingfunctionOpenCV 5.0.0
import { ximgproc_createSuperpixelLSC } from '@banou/opencv-wasm'

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

Class implementing the LSC (Linear Spectral Clustering) superpixels

ximgproc_createSuperpixelLSC(image: Mat, region_size: number, ratio: number): ximgproc_SuperpixelLSC | null;
3 available overloads
ximgproc_createSuperpixelLSC(image: Mat): ximgproc_SuperpixelLSC | null;
ximgproc_createSuperpixelLSC(image: Mat, region_size: number): ximgproc_SuperpixelLSC | null;
ximgproc_createSuperpixelLSC(image: Mat, region_size: number, ratio: number): ximgproc_SuperpixelLSC | null;
image

Image to segment

region_size

Chooses an average superpixel size measured in pixels

ratio

Chooses the enforcement of superpixel compactness factor of superpixel

The function initializes a SuperpixelLSC object for the input image. It sets the parameters of superpixel algorithm, which are: region_size and ruler. It preallocate some buffers for future computing iterations over the given image. An example of LSC is ilustrated in the following picture. For enanched results it is recommended for color images to preprocess image with little gaussian blur with a small 3 x 3 kernel and additional conversion into CieLAB color space.

image

Returns

The ximgproc_SuperpixelLSC | null 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.