Starts with Expectation step. Initial values of the model parameters will be estimated by the k-means algorithm.

Namespace: Emgu.CV.ML
Assembly: Emgu.CV.ML (in Emgu.CV.ML.dll) Version: (


public bool Train(
	Matrix<float> samples,
	Matrix<int> labels,
	Matrix<float> probs,
	Matrix<double> logLikelihoods
Visual Basic
Public Function Train ( 
	samples As Matrix(Of Single),
	labels As Matrix(Of Integer),
	probs As Matrix(Of Single),
	logLikelihoods As Matrix(Of Double)
) As Boolean
Visual C++
bool Train(
	Matrix<float>^ samples, 
	Matrix<int>^ labels, 
	Matrix<float>^ probs, 
	Matrix<double>^ logLikelihoods
member Train : 
        samples : Matrix<float32> * 
        labels : Matrix<int> * 
        probs : Matrix<float32> * 
        logLikelihoods : Matrix<float> -> bool 


Type: Emgu.CV..::..Matrix<(Of <(<'Single>)>)>
The training data. A 32-bit floating-point, single-channel matrix, one vector per row
Type: Emgu.CV..::..Matrix<(Of <(<'Int32>)>)>
Can be null if not needed. Optionally computed output "class label" for each sample
Type: Emgu.CV..::..Matrix<(Of <(<'Single>)>)>
Can be null if not needed. Initial probabilities p_{i,k} of sample i to belong to mixture component k. It is a one-channel floating-point matrix of nsamples x nclusters size.
Type: Emgu.CV..::..Matrix<(Of <(<'Double>)>)>
Can be null if not needed. The optional output matrix that contains a likelihood logarithm value for each sample. It has nsamples x 1 size and CV_64FC1 type.

Return Value

Type: Boolean
The methods return true if the Gaussian mixture model was trained successfully, otherwise it returns false.

See Also