ximgproc_createScanSegment
import { ximgproc_createScanSegment } from '@banou/opencv-wasm'Use after await initOpenCV(). See the initialization and named imports guide.
Initializes a ScanSegment object.
The function initializes a ScanSegment object for the input image. It stores the parameters of the image: image_width and image_height. It also sets the parameters of the F-DBSCAN superpixel algorithm, which are: num_superpixels, threads, and merge_small.
ximgproc_createScanSegment(image_width: number, image_height: number, num_superpixels: number, slices: number, merge_small: boolean): ximgproc_ScanSegment | null;3 available overloads
ximgproc_createScanSegment(image_width: number, image_height: number, num_superpixels: number): ximgproc_ScanSegment | null;ximgproc_createScanSegment(image_width: number, image_height: number, num_superpixels: number, slices: number): ximgproc_ScanSegment | null;ximgproc_createScanSegment(image_width: number, image_height: number, num_superpixels: number, slices: number, merge_small: boolean): ximgproc_ScanSegment | null;image_widthImage width.
image_heightImage height.
num_superpixelsDesired number of superpixels. Note that the actual number may be smaller due to restrictions (depending on the image size). Use getNumberOfSuperpixels() to get the actual number.
slicesNumber of processing threads for parallelisation. Setting -1 uses the maximum number of threads. In practice, four threads is enough for smaller images and eight threads for larger ones.
merge_smallmerge small segments to give the desired number of superpixels. Processing is much faster without merging, but many small segments will be left in the image.
The ximgproc_ScanSegment | 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.