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