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