countNonZero function

int countNonZero(
  1. Mat src
)

CountNonZero counts non-zero array elements.

For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#gaa4b89393263bb4d604e0fe5986723914

Implementation

int countNonZero(Mat src) {
  return cvRunArena<int>((arena) {
    final p = arena<ffi.Int>();
    ccore.Mat_CountNonZero(src.ref, p);
    return p.value;
  });
}