You can also use Bio7 (sorry for this house advertising) which embedds ImageJ and R to cluster image data.
A GUI is available to use the clara algorithm(which gives similar results to kmeans).
http://www.uni-bielefeld.de/biologie/Oekosystembiologie/bio7app/flashtut/cluster.htmThe kmeans itself can be expressed in a three-liner R-Script and the afore mentioned GUI can
be used to only transfer the R,G,B layers:
RScript:
x <- data.frame(image1,image2,image3)
#Convert R,G,B image data to a dataframe
kl <- kmeans(x, 6)
#Cluster with the amount of centres.
imageMatrix<-matrix(as.double(kl$cluster),507,446)
#Convert to a matrix with the default name(and the width,height of the image)The matrix then can easily transferred back to ImageJ with Bio7.
The kmeans works well for smaller images (<3000*3000).
With the afore mentioned clara method i was able to cluster an R,G,B image with
5000*5000 pixel (Windows Vista,3GB RAM, 32-bit).
Beside these unsupervised techniques supervised methods can also be adapted for ImageJ.
With kind regards
M.Austenfeld