minMaxLocAsync function

Future<(double, double, Point, Point)> minMaxLocAsync(
  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

Future<(double minVal, double maxVal, Point minLoc, Point maxLoc)> minMaxLocAsync(
  InputArray src, {
  InputArray? mask,
}) async =>
    cvRunAsync4(
        (callback) => mask == null
            ? ccore.core_MinMaxLoc_Async(src.ref, callback)
            : ccore.core_MinMaxLoc_Mask_Async(src.ref, mask.ref, callback), (c, p, p1, p2, p3) {
      final minv = p.cast<ffi.Double>().value;
      calloc.free(p);
      final maxv = p1.cast<ffi.Double>().value;
      calloc.free(p1);
      c.complete((minv, maxv, Point.fromPointer(p2.cast()), Point.fromPointer(p3.cast())));
    });