filterSpeckles
import { filterSpeckles } from '@banou/opencv-wasm'Use after await initOpenCV(). See the initialization and named imports guide.
Filters off small noise blobs (speckles) in the disparity map
filterSpeckles(img: Mat, newVal: number, maxSpeckleSize: number, maxDiff: number, buf: Mat): void;2 available overloads
filterSpeckles(img: Mat, newVal: number, maxSpeckleSize: number, maxDiff: number): void;filterSpeckles(img: Mat, newVal: number, maxSpeckleSize: number, maxDiff: number, buf: Mat): void;imgInput/output value, modified by the native operation. The input 16-bit signed disparity image
newValThe disparity value used to paint-off the speckles
maxSpeckleSizeThe maximum speckle size to consider it a speckle. Larger blobs are not affected by the algorithm
maxDiffMaximum difference between neighbor disparity pixels to put them into the same blob. Note that since StereoBM, StereoSGBM and may be other algorithms return a fixed-point disparity map, where disparity values are multiplied by 16, this scale factor should be taken into account when specifying this parameter value.
bufInput/output value, modified by the native operation. The optional temporary buffer to avoid memory allocation within the function.
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.