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 (in Emgu.CV.dll) Version: 2.4.2.1777 (2.4.2.1777)

Syntax

C#
public static int cvKMeans2(
	IntPtr samples,
	int clusterCount,
	IntPtr labels,
	MCvTermCriteria termcrit,
	int attempts,
	IntPtr rng,
	KMeansInitType flags,
	IntPtr centers,
	IntPtr compactness
)
Visual Basic
Public Shared Function cvKMeans2 ( _
	samples As IntPtr, _
	clusterCount As Integer, _
	labels As IntPtr, _
	termcrit As MCvTermCriteria, _
	attempts As Integer, _
	rng As IntPtr, _
	flags As KMeansInitType, _
	centers As IntPtr, _
	compactness As IntPtr _
) As Integer
Visual C++
public:
static int cvKMeans2(
	IntPtr samples, 
	int clusterCount, 
	IntPtr labels, 
	MCvTermCriteria termcrit, 
	int attempts, 
	IntPtr rng, 
	KMeansInitType flags, 
	IntPtr centers, 
	IntPtr compactness
)

Parameters

samples
Type: System..::..IntPtr
Floating-point matrix of input samples, one row per sample
clusterCount
Type: System..::..Int32
Number of clusters to split the set by
labels
Type: System..::..IntPtr
Output integer vector storing cluster indices for every sample
termcrit
Type: Emgu.CV.Structure..::..MCvTermCriteria
Specifies maximum number of iterations and/or accuracy (distance the centers move by between the subsequent iterations)
attempts
Type: System..::..Int32
The number of attemps. Use 2 if not sure
rng
Type: System..::..IntPtr
Pointer to CvRNG, use IntPtr.Zero if not sure
flags
Type: Emgu.CV.CvEnum..::..KMeansInitType
Flags, use 0 if not sure
centers
Type: System..::..IntPtr
Pointer to array of centers, use IntPtr.Zero if not sure
compactness
Type: System..::..IntPtr
Pointer to array of doubles, use IntPtr.Zero if not sure

Return Value

[Missing <returns> documentation for "M:Emgu.CV.CvInvoke.cvKMeans2(System.IntPtr,System.Int32,System.IntPtr,Emgu.CV.Structure.MCvTermCriteria,System.Int32,System.IntPtr,Emgu.CV.CvEnum.KMeansInitType,System.IntPtr,System.IntPtr)"]

See Also