Login  Register

Re: k-means Clustering

Posted by Toby Cornish on Dec 07, 2007; 3:31pm
URL: http://imagej.273.s1.nabble.com/k-means-Clustering-tp3697801p3697808.html

It might be helpful to know what sort of images these are.

I haven't worked a lot with k-means for color discrimination, but AFAIK this is just using kmeans clustering based on pixel RGB value distances, so it doesn't really know "blue."  You could follow up the kmeans with a little algorithm that looks at the pixels in each cluster and evaluates which cluster is the most red and which is the most blue.

Alternatively, you could use other means of segmenting an image into colors, such as HSV colorspace segmentation.

toby

>Date:    Thu, 6 Dec 2007 09:53:04 +0000
>From:    Richard Han <[hidden email]>
>Subject: k-means Clustering
>
>Dear All,
>
>I am using k-means Clustering to measure the blue and red in my  
>images. I use the threshold to move from one cluster to another. In  
>some images the k-means clustering could produce very good matches  
>(I'd say spot on), but in others the results were less desirable. My  
>settings are
>
>Number of clusters to: 4
>Cluster center tolerance: 0.0001
>Enable randomization seed: ticked
>Randomization seed: 48
>The other options were not ticked
>
>Could I do anything more to improve the analysis? and... Is it  
>possible to pre-define the red and blue clusters (ie, assign cluster  
>1 to be blue)?
>
>Any help will be appreciated. Thanking you.
>
>Richard Han
>University of Edinburgh


Toby C. Cornish, M.D., Ph.D.
Pathology Resident
Johns Hopkins Medical Institutions
[hidden email]