Click or drag to resize

CvInvokeKmeans Method

http://www.emgu.com
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: 4.1.1.3497 (4.1.1.3497)
Syntax
public static double Kmeans(
	IInputArray data,
	int k,
	IOutputArray bestLabels,
	MCvTermCriteria termcrit,
	int attempts,
	KMeansInitType flags,
	IOutputArray centers = null
)

Parameters

data
Type: Emgu.CVIInputArray
Floating-point matrix of input samples, one row per sample
k
Type: SystemInt32
Number of clusters to split the set by.
bestLabels
Type: Emgu.CVIOutputArray
Output integer vector storing cluster indices for every sample
termcrit
Type: Emgu.CV.StructureMCvTermCriteria
Specifies maximum number of iterations and/or accuracy (distance the centers move by between the subsequent iterations)
attempts
Type: SystemInt32
The number of attempts. Use 2 if not sure
flags
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