Click or drag to resize

CvInvokeKmeans Method
Implements k-means algorithm that finds centers of cluster_count clusters and groups the input samples around the clusters. On output labels(i) contains a cluster index for sample stored in the i-th row of samples matrix

Namespace:  Emgu.CV
Assembly:  Emgu.CV.World (in Emgu.CV.World.dll) Version: (
public static double Kmeans(
	IInputArray data,
	int k,
	IOutputArray bestLabels,
	MCvTermCriteria termcrit,
	int attempts,
	KMeansInitType flags,
	IOutputArray centers = null


Type: Emgu.CVIInputArray
Floating-point matrix of input samples, one row per sample
Type: SystemInt32
Number of clusters to split the set by.
Type: Emgu.CVIOutputArray
Output integer vector storing cluster indices for every sample
Type: Emgu.CV.StructureMCvTermCriteria
Specifies maximum number of iterations and/or accuracy (distance the centers move by between the subsequent iterations)
Type: SystemInt32
The number of attempts. Use 2 if not sure
Type: Emgu.CV.CvEnumKMeansInitType
Flags, use 0 if not sure
centers (Optional)
Type: Emgu.CVIOutputArray
Pointer to array of centers, use IntPtr.Zero if not sure

Return Value

Type: Double
The function returns the compactness measure. The best (minimum) value is chosen and the corresponding labels and the compactness value are returned by the function.
See Also