classifyNearest

[ XITE Reference Manual | XITE home ]

Name

classifyNearest - classify to nearest class

Syntax

 #include <xite/classification.h>

 int classifyNearest( IMAGE input, IBAND oldres,
    IBAND newres, float* means[], int k,
    int metric, int* changes );

Description

Classifies the input image to the nearest of the specified class means.

input may be multi band image. oldres is previous classification result. newres is the classification result. means refers to the class mean vectors. k is the number of classes. metric must be one of
   1 => Euclidian distance
   2 => City block distance
   3 => Chess distance
changes is the number of changes from previous classification.

Identical arguments may be given for oldres and newres.

Restrictions

input, oldres and newres must have pixel type unsigned byte. means must be an array of pointers to arrays of floats, indexable on the interval
 means[0..k-1][1..Inbands(input)].

Return value

 0 => ok
 1 => bad pixel type in input image
 2 => bad pixel type in oldres
 3 => bad pixel type in newres
 4 => bad k value (less than 2)
 5 => unknown metric

Author

Tor Lønnestad, BLAB, Ifi, UiO.

Id

$Id: kMeansCluster.c,v 1.25 1997/01/29 10:38:27 svein Exp $