Calculates the covariation matrix and, optionally, mean vector of the set of input vectors.

C# | Visual Basic | Visual C++ |
public static void cvCalcCovarMatrix( IntPtr[] vects, int count, IntPtr covMat, IntPtr avg, COVAR_METHOD flags )
Public Shared Sub cvCalcCovarMatrix ( _ vects As IntPtr(), _ count As Integer, _ covMat As IntPtr, _ avg As IntPtr, _ flags As COVAR_METHOD _ )
public: static void cvCalcCovarMatrix( array<IntPtr>^ vects, int count, IntPtr covMat, IntPtr avg, COVAR_METHOD flags )

- vects (array< IntPtr >[]()[])
- The input vectors. They all must have the same type and the same size. The vectors do not have to be 1D, they can be 2D (e.g. images) etc
- count (Int32)
- The number of input vectors
- covMat (IntPtr)
- The output covariation matrix that should be floating-point and square
- avg (IntPtr)
- The input or output (depending on the flags) array - the mean (average) vector of the input vectors.
- flags (COVAR_METHOD)
- The operation flags

The function can be used for PCA, for comparing vectors using Mahalanobis distance etc.