minMaxLoc function

(double, double, Point, Point) minMaxLoc(
  1. InputArray src, {
  2. InputArray? mask,
})

MinMaxLoc finds the global minimum and maximum in an array.

For further details, please see: https://docs.opencv.org/trunk/d2/de8/group__core__array.html#gab473bf2eb6d14ff97e89b355dac20707

Implementation

(double minVal, double maxVal, Point minLoc, Point maxLoc) minMaxLoc(InputArray src, {InputArray? mask}) {
  return using<(double, double, Point, Point)>((arena) {
    final minValP = arena<ffi.Double>();
    final maxValP = arena<ffi.Double>();
    final minLocP = calloc<cvg.Point>();
    final maxLocP = calloc<cvg.Point>();
    cvRun(() => cffi.Mat_MinMaxLoc(src.ref, minValP, maxValP, minLocP, maxLocP));
    return (minValP.value, maxValP.value, Point.fromPointer(minLocP), Point.fromPointer(maxLocP));
  });
}