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.2.1.1150 (2.2.1.1150)

Syntax

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

Parameters

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

See Also