connectedComponents function

int connectedComponents(
  1. Mat image,
  2. Mat labels,
  3. int connectivity,
  4. int ltype,
  5. int ccltype,
)

ConnectedComponents computes the connected components labeled image of boolean image.

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

Implementation

int connectedComponents(Mat image, Mat labels, int connectivity, int ltype, int ccltype) {
  return cvRunArena<int>((arena) {
    final p = arena<ffi.Int>();
    cvRun(() => cimgproc.ConnectedComponents(image.ref, labels.ref, connectivity, ltype, ccltype, p));
    return p.value;
  });
}