hasNonZero
import { hasNonZero } from '@banou/opencv-wasm'Use after await initOpenCV(). See the initialization and named imports guide.
Checks for the presence of at least one non-zero array element.
The function returns whether there are non-zero elements in src
The function do not work with multi-channel arrays. If you need to check non-zero array elements across all the channels, use Mat::reshape first to reinterpret the array as single-channel. Or you may extract the particular channel using either extractImageCOI, or mixChannels, or split.
Note: - CV_16F/CV_16BF/CV_Bool/CV_64U/CV_64S/CV_32U are not supported for src.
- If the location of non-zero array elements is important,
findNonZerois helpful. - If the count of non-zero array elements is important,
countNonZerois helpful.
See: mean, meanStdDev, norm, minMaxLoc, calcCovarMatrix See: findNonZero, countNonZero
hasNonZero(src: Mat): boolean;srcsingle-channel array.
The boolean 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.