minEnclosingCircle function

(Point2f, double) minEnclosingCircle(
  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

(Point2f center, double radius) minEnclosingCircle(VecPoint points) {
  return cvRunArena<(Point2f, double)>((arena) {
    final center = calloc<cvg.Point2f>();
    final radius = arena<ffi.Float>();
    cvRun(() => cimgproc.MinEnclosingCircle(points.ref, center, radius));
    return (Point2f.fromPointer(center), radius.value);
  });
}