threshold function

(double, Mat) threshold(
  1. InputArray src,
  2. double thresh,
  3. double maxval,
  4. int type, {
  5. OutputArray? dst,
})

Threshold applies a fixed-level threshold to each array element.

For further details, please see: https:///docs.opencv.org/3.3.0/d7/d1b/group__imgproc__misc.html#gae8a4a146d1ca78c626a53577199e9c57

Implementation

(double, Mat dst) threshold(
  InputArray src,
  double thresh,
  double maxval,
  int type, {
  OutputArray? dst,
}) {
  dst ??= Mat.empty();
  final rval = cvRunArena<double>((arena) {
    final p = arena<ffi.Double>();
    cvRun(() => cimgproc.Threshold(src.ref, dst!.ref, thresh, maxval, type, p));
    return p.value;
  });
  return (rval, dst);
}