minEnclosingCircleAsync function

Future<(Point2f, double)> minEnclosingCircleAsync(
  1. VecPoint 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)> minEnclosingCircleAsync(VecPoint points) async {
  final center = calloc<cvg.CvPoint2f>();
  final pRadius = calloc<ffi.Float>();
  return cvRunAsync0(
    (callback) => cimgproc.cv_minEnclosingCircle(points.ref, center, pRadius, callback),
    (c) {
      final rval = (Point2f.fromPointer(center), pRadius.value);
      calloc.free(pRadius);
      return c.complete(rval);
    },
  );
}