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) {
  final center = calloc<cvg.CvPoint2f>();
  final pRadius = calloc<ffi.Float>();
  cvRun(() => cimgproc.cv_minEnclosingCircle(points.ref, center, pRadius, ffi.nullptr));
  final rval = (Point2f.fromPointer(center), pRadius.value);
  calloc.free(pRadius);
  return rval;
}