connectedComponentsWithStatsAsync 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
Future<int> connectedComponentsWithStatsAsync(
Mat src,
Mat labels,
Mat stats,
Mat centroids,
int connectivity,
int ltype,
int ccltype,
) {
final p = calloc<ffi.Int>();
return cvRunAsync0(
(callback) => cimgproc.cv_connectedComponents_1(
src.ref,
labels.ref,
stats.ref,
centroids.ref,
connectivity,
ltype,
ccltype,
p,
callback,
),
(c) {
final rval = p.value;
calloc.free(p);
return c.complete(rval);
},
);
}