calcCovarMatrix function

(Mat, Mat) calcCovarMatrix(
  1. InputArray samples,
  2. InputOutputArray mean,
  3. int flags, {
  4. OutputArray? covar,
  5. int ctype = MatType.CV_64F,
})

CalcCovarMatrix calculates the covariance matrix of a set of vectors.

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

Implementation

(Mat covar, Mat mean) calcCovarMatrix(
  InputArray samples,
  InputOutputArray mean,
  int flags, {
  OutputArray? covar,
  int ctype = MatType.CV_64F,
}) {
  covar ??= Mat.empty();
  cvRun(
    () => ccore.Mat_CalcCovarMatrix(
      samples.ref,
      covar!.ref,
      mean.ref,
      flags,
      ctype,
    ),
  );
  return (covar, mean);
}