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.10.1935 (2.4.10.1935)

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
)
F#
static member cvKMeans2 : 
        samples : IntPtr * 
        clusterCount : int * 
        labels : IntPtr * 
        termcrit : MCvTermCriteria * 
        attempts : int * 
        rng : IntPtr * 
        flags : KMeansInitType * 
        centers : IntPtr * 
        compactness : IntPtr -> int 

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

Type: Int32

[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