Skip to content

gapi_countNonZero

gapifunctionOpenCV 5.0.0
import { gapi_countNonZero } from '@banou/opencv-wasm'

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

ARGUMENTSsrc
FUNCTIONgapi_countNonZero
RETURN TYPEGOpaque_int
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

Counts non-zero array elements.

The function returns the number of non-zero elements in src :

\sum _{I: \; \texttt{src} (I) \ne0 } 1

Supported matrix data types are CV_8UC1, CV_16UC1, CV_16SC1, CV_32FC1.

Note: Function textual ID is "org.opencv.core.matrixop.countNonZero"

See: mean, min, max

gapi_countNonZero(src: GMat): GOpaque_int;
src

input single-channel matrix.

Returns

The GOpaque_int result. Release returned native handles with using or delete(), including handles nested in results.

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.