imcount function

int imcount(
  1. String filename, {
  2. int flags = IMREAD_ANYCOLOR,
})

Returns the number of images inside the give file.

The function imcount will return the number of pages in a multi-page image, or 1 for single-page images

https://docs.opencv.org/4.10.0/d4/da8/group__imgcodecs.html#ga02237b2aad2d4ae41c9489a83781f202

Implementation

int imcount(String filename, {int flags = IMREAD_ANYCOLOR}) {
  final cname = filename.toNativeUtf8().cast<ffi.Char>();
  final rval = cimgcodecs.cv_imcount(cname, flags);
  calloc.free(cname);
  return rval;
}