meanStdDev function

(Scalar, Scalar) meanStdDev(
  1. InputArray src, {
  2. InputArray? mask,
})

MeanStdDev calculates a mean and standard deviation of array elements.

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

Implementation

(Scalar mean, Scalar stddev) meanStdDev(InputArray src, {InputArray? mask}) {
  final mean = calloc<cvg.Scalar>();
  final stddev = calloc<cvg.Scalar>();
  mask == null
      ? cvRun(() => ccore.cv_meanStdDev(src.ref, mean, stddev, ffi.nullptr))
      : cvRun(() => ccore.cv_meanStdDev_1(src.ref, mean, stddev, mask.ref, ffi.nullptr));
  return (Scalar.fromPointer(mean), Scalar.fromPointer(stddev));
}