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(() => cffi.Mat_MeanStdDev(src.ref, mean, stddev))
      : cvRun(() => cffi.Mat_MeanStdDevWithMask(src.ref, mean, stddev, mask.ref));
  return (Scalar.fromPointer(mean), Scalar.fromPointer(stddev));
}