minEnclosingCircle2fAsync function

Future<(Point2f, double)> minEnclosingCircle2fAsync(
  1. VecPoint2f points
)

MinEnclosingCircle finds a circle of the minimum area enclosing the input 2D point set.

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

Implementation

Future<(Point2f center, double radius)> minEnclosingCircle2fAsync(VecPoint2f points) async {
  final center = calloc<cvg.CvPoint2f>();
  final pRadius = calloc<ffi.Float>();
  return cvRunAsync0((callback) => cimgproc.cv_minEnclosingCircle2f(points.ref, center, pRadius, callback), (
    c,
  ) {
    final rval = (Point2f.fromPointer(center), pRadius.value);
    calloc.free(pRadius);
    return c.complete(rval);
  });
}