connectedComponentsWithStats function

int connectedComponentsWithStats(
  1. Mat src,
  2. Mat labels,
  3. Mat stats,
  4. Mat centroids,
  5. int connectivity,
  6. int ltype,
  7. int ccltype,
)

ConnectedComponentsWithStats computes the connected components labeled image of boolean image and also produces a statistics output for each label.

For further details, please see: https:///docs.opencv.org/master/d3/dc0/group__imgproc__shape.html#ga107a78bf7cd25dec05fb4dfc5c9e765f

Implementation

int connectedComponentsWithStats(
  Mat src,
  Mat labels,
  Mat stats,
  Mat centroids,
  int connectivity,
  int ltype,
  int ccltype,
) {
  return cvRunArena<int>((arena) {
    final p = arena<ffi.Int>();
    cvRun(
      () => cffi.ConnectedComponentsWithStats(
        src.ref,
        labels.ref,
        stats.ref,
        centroids.ref,
        connectivity,
        ltype,
        ccltype,
        p,
      ),
    );
    return p.value;
  });
}