/// <summary> /// computes covariation matrix of a set of samples /// </summary> /// <param name="samples"></param> /// <param name="covar"></param> /// <param name="mean"></param> /// <param name="flags"></param> /// <param name="ctype"></param> public static void CalcCovarMatrix(InputArray samples, OutputArray covar, InputOutputArray mean, CovarFlags flags, MatType ctype) { if (samples == null) throw new ArgumentNullException("samples"); if (covar == null) throw new ArgumentNullException("covar"); if (mean == null) throw new ArgumentNullException("mean"); samples.ThrowIfDisposed(); covar.ThrowIfNotReady(); mean.ThrowIfNotReady(); NativeMethods.core_calcCovarMatrix_InputArray(samples.CvPtr, covar.CvPtr, mean.CvPtr, (int)flags, ctype); GC.KeepAlive(samples); covar.Fix(); mean.Fix(); }
/// <summary> /// computes covariation matrix of a set of samples /// </summary> /// <param name="samples"></param> /// <param name="covar"></param> /// <param name="mean"></param> /// <param name="flags"></param> /// <param name="ctype"></param> public static void CalcCovarMatrix(Mat[] samples, Mat covar, Mat mean, CovarFlags flags, MatType ctype) { if (samples == null) throw new ArgumentNullException("samples"); if (covar == null) throw new ArgumentNullException("covar"); if (mean == null) throw new ArgumentNullException("mean"); covar.ThrowIfDisposed(); mean.ThrowIfDisposed(); IntPtr[] samplesPtr = EnumerableEx.SelectPtrs(samples); NativeMethods.core_calcCovarMatrix_Mat(samplesPtr, samples.Length, covar.CvPtr, mean.CvPtr, (int)flags, ctype); GC.KeepAlive(samples); GC.KeepAlive(covar); GC.KeepAlive(mean); }
/// <summary> /// computes covariation matrix of a set of samples /// </summary> /// <param name="samples"></param> /// <param name="covar"></param> /// <param name="mean"></param> /// <param name="flags"></param> public static void CalcCovarMatrix(InputArray samples, OutputArray covar, InputOutputArray mean, CovarFlags flags) { CalcCovarMatrix(samples, covar, mean, flags, MatType.CV_64F); }
/// <summary> /// computes covariation matrix of a set of samples /// </summary> /// <param name="samples"></param> /// <param name="covar"></param> /// <param name="mean"></param> /// <param name="flags"></param> public static void CalcCovarMatrix(Mat[] samples, Mat covar, Mat mean, CovarFlags flags) { CalcCovarMatrix(samples, covar, mean, flags, MatType.CV_64F); }