kMeansCluster

[ XITE Reference Manual | XITE home ]

Name

kMeansCluster - Kmeans clustering

Syntax

kMeansCluster <inimage> <outimage> <k> [<metric>]

Description

Classifies the multi band input image iteratively to the nearest cluster mean. Algorithm:

 Ask user for k mean vectors
 REPEAT
   classify input image to nearest mean
   Recalculate class means
   Report classification result
 UNTIL user is satisfied OR no changes

Arguments

inimage
Multi band input image.

outimage
Single band classification result.

k
The number of classes.

metric
One of
1
Euclidian distance.
2
City block distance.
3
Chess distance.

Default value 1.

Restrictions

All bands of inimage must have pixel type unsigned byte. For every class, a mean vector with n float components must be given, where n = number of bands in input image. k must be between 2 and 100.

See also

classifyNearest(3), classMeans(3)

Author

Tor Lønnestad, BLAB, Ifi, UiO

Examples

 kMeansCluster landsat.img classes.img 5
 kMeansCluster landsat.img classes.img 5 3