ClusteringComponents

ClusteringComponents[array]
gives an array in which each element at the lowest level of array is replaced by an integer index representing the cluster in which the element lies.

ClusteringComponents[array,n]
finds at most n clusters.

ClusteringComponents[array,n,level]
finds clusters at the specified level in array.

ClusteringComponents[image]
finds clusters of pixels with similar values in image.

ClusteringComponents[image,n]
finds at most n clusters in image.

Details and OptionsDetails and Options

ExamplesExamplesopen allclose all

Basic Examples  (3)Basic Examples  (3)

Label two clusters of values in a list:

In[1]:=
Click for copyable input
Out[1]=

Cluster analysis of an MR image:

In[1]:=
Click for copyable input
Out[1]=

Find a color segmentation of a satellite image:

In[1]:=
Click for copyable input
Out[1]=
Introduced in 2010
(8.0)
| Updated in 2012
(9.0)