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) {
  final p = calloc<ffi.Int>();
  cvRun(
    () => cimgproc.cv_connectedComponents(
      image.ref,
      labels.ref,
      connectivity,
      ltype,
      ccltype,
      p,
      ffi.nullptr,
    ),
  );
  final rval = p.value;
  calloc.free(p);
  return rval;
}