Method TrainM
- Namespace
- OpenCvSharp
- Assembly
- OpenCvSharp.dll
TrainM(InputArray, InputArray, OutputArray, OutputArray, OutputArray)
Estimate the Gaussian mixture parameters from a samples set.
public virtual bool TrainM(InputArray samples, InputArray probs0, OutputArray logLikelihoods = default, OutputArray labels = default, OutputArray probs = default)
Parameters
samplesInputArraySamples from which the Gaussian mixture model will be estimated. It should be a one-channel matrix, each row of which is a sample. If the matrix does not have CV_64F type it will be converted to the inner matrix of such type for the further computing.
probs0InputArraythe probabilities
logLikelihoodsOutputArrayThe optional output matrix that contains a likelihood logarithm value for each sample. It has \f$nsamples \times 1\f$ size and CV_64FC1 type.
labelsOutputArrayThe optional output "class label" for each sample: \f$\texttt{labels}_i=\texttt{arg max}k(p{i,k}), i=1..N\f$ (indices of the most probable mixture component for each sample). It has \f$nsamples \times 1\f$ size and CV_32SC1 type.
probsOutputArrayThe optional output matrix that contains posterior probabilities of each Gaussian mixture component given the each sample. It has \f$nsamples \times nclusters\f$ size and CV_64FC1 type.