K-means segmentation

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

K-means segmentation

Priscilla Mendes
Hi everyone,

I am new at using ImageJ and I would like to know how can I segmentate an
image using k-means method.
Thanks since now,

Priscilla Mendes
Computer Engineering Student
University of Pernambuco, Brazil
Reply | Threaded
Open this post in threaded view
|

Re: K-means segmentation

Sami Badawi-2
Hi Priscilla Mendes,

I have done this in the ShapeLogic plugin for a color particle analyzer.
The k-means method is implemented in BaseParticleCounter.java.

You can see the code here:
http://code.google.com/p/shapelogic/source/browse/trunk/src/main/java/org/shapelogic/imageprocessing/BaseParticleCounter.java

-Sami Badawi
http://www.shapelogic.org

On Tue, Jan 27, 2009 at 9:00 PM, Priscilla Mendes
<[hidden email]> wrote:

> Hi everyone,
>
> I am new at using ImageJ and I would like to know how can I segmentate an
> image using k-means method.
> Thanks since now,
>
> Priscilla Mendes
> Computer Engineering Student
> University of Pernambuco, Brazil
>
Reply | Threaded
Open this post in threaded view
|

Re: K-means segmentation

Gabriel Landini
In reply to this post by Priscilla Mendes
On Wednesday 28 January 2009 02:00:41 Priscilla Mendes wrote:
> Hi everyone,
>
> I am new at using ImageJ and I would like to know how can I segmentate an
> image using k-means method.
> Thanks since now,

The one I use is the plugin by Jarek Sacha in sourceforge.net
Search google for: k-means segmentation imagej

G.
Reply | Threaded
Open this post in threaded view
|

Re: K-means segmentation

Marcel
In reply to this post by Priscilla Mendes
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.htm

The 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