ximgproc_segmentation_SelectiveSearchSegmentationStrategy
import { ximgproc_segmentation_SelectiveSearchSegmentationStrategy } 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.
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;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;imgThe input image. Any number of channel can be provided
regionsA segmentation of the image. The parameter must be the same size of img.
sizesThe sizes of different regions
image_idIf 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;r1The first region
r2The second region
The number result.
merge
Inform the strategy that two regions will be merged
merge(r1: number, r2: number): void;r1The first region
r2The 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.