4.13953

4.1 | 43 ratings Rate this file 377 Downloads (last 30 days) File Size: 1.59 KB File ID: #8379
image thumbnail

kmeans image segmentation

by Jose Vicente Manjon-Herrera

 

28 Aug 2005 (Updated 29 Aug 2005)

Application of kmeans clustering algorithm to segment a grey scale image on diferent classes.

| Watch this File

File Information
Description

This program gets an image and the desidered number of partitions and finds the means of the different classes and provides a clasified image
(mask).

MATLAB release MATLAB 6.5.1 (R13SP1)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (61)
17 Sep 2005 Ramir Sokurka

Excellent!

25 Oct 2005 Bashar Nusir  
13 Nov 2005 Stanley Zietz

Excellent. Works well.

13 Jan 2006 Xin Huang

K-means is a classic un-supervised classification algorithm. In your code, is there new ideas about k-means? And can you compare the k-means,ISODATA,SOM mathods?

13 Feb 2006 Jean-Paul Kouma

Very good and fast!

01 Mar 2006 Davor Conejo

Just Perfect. Very fast and great code.

01 Apr 2006 kosala jayakody  
02 Apr 2006 cool coolleen

i m doing my final year project of mini portions segmentation method in face recognition using matlab. may i know how to put my cropped small portions of the face into matrix (eg: 6x9 matrix, where 6 refer to number of photos, n 9 refer to the number of small portions). by the way, i also would like to know how can i compare the matrix column by column in order to get the eigenvalues. n i m new to matlab, so i hope u will help me to clear my doubts. if u have to source code, pls send a copy to me. thanks and really appreciate for your help. Hope can hear from u soon.

30 Apr 2006 Raj Pai Panandiker  
15 May 2006 Milind Potdar  
11 Jul 2006 mohammad sadeghzadeh  
10 Aug 2006 Elena Cher

workes good

07 Sep 2006 Mikel Rodriguez (www.cs.ucf.edu/~mikel)

No errors, well done. For some applications you might want to use Jose Vicente Manjon-Herrera's EM image segmentation implementation though.

21 Oct 2006 oscar forero  
23 Nov 2006 John Thebridge  
03 May 2007 Yurniar Supanggi

Good work, this code very useful for me, but I need method hierarchical clustering for image..., Any idea for me?

02 Aug 2007 Volker E.  
15 Aug 2007 smiled fisher  
15 Jan 2008 AYEB YAKOUB

this function works only for integer values of gray level, not for double

22 Jan 2008 Santhosh Kumar

I need a help from u to solve a paper in image processing

23 Jan 2008 manoj kumar

helpful

05 Feb 2008 Adrian López  
19 Feb 2008 Gustavo Meschino

Very fast implementation!
It would be great if it is improved to enter more than one input image.

09 May 2008 Chris Yang

please help me, how to use this code

20 May 2008 Ghassan alyami  
27 May 2008 fd fdafd

good

30 May 2008 mcasarah tucker  
08 Aug 2008 Abirami Balasubramaniyan

good

03 Oct 2008 Patirniche Dinu  
13 Mar 2009 kiruba mani

im doing my final year project in image segmentation based on MRF with ANT COLONY SYSTEM,i dont have any idea ab't that,can u help me,my first module is k-means,can u explain k-mans in depth.

16 Apr 2009 ASHWINI SAPKAL

I want to apply kmeans for landsat images pls help me for dat

27 May 2009 hbu 

it is very beauteful,excellent!

20 Jul 2009 Assaf Zaritsky

Small bug at line#73, should be:
c=abs(copy(i,j)-mi-mu);
instead of:
c=abs(copy(i,j)-mu); % (mi missing)

Also, performance can be quite improved

24 Nov 2009 Tai Fei

Dank!

07 Dec 2009 Aditya Gupta

Thanks, works good.

07 Jan 2010 Bhanu

Please help me how to execute this code in matlab

08 Jan 2010 Bhanu

Please tell how to execute this code

11 Mar 2010 TRAN VietDung

nice !

31 Mar 2010 Airballman

Works fine, thanks!

A bit long when used on high resolution images. But I guess it comes from the kmeans methods itself :)

30 Apr 2010 Seena Ghazi

trabajo bién

17 Jun 2010 Liu Zhidan

good

03 Jul 2010 Nitin Kumar  
26 Sep 2010 Mahmoud Shehadeh  
01 Oct 2010 spectral

anyone can help me..why i didn't successfully execute the results..
i'm using the jpeg image.tq

01 Oct 2010 Mahmoud Shehadeh

sorry that was not the right code :)

04 Oct 2010 spectral

'Mahmoud'..do you have the corrected code

05 Oct 2010 Mahmoud Shehadeh

I'm gonna send you an email.

05 Oct 2010 spectral

>Mahmoud Shehadeh I'm gonna send you an email.

k..tq..does it works on the grayscale image..
 

25 Nov 2010 sanny

mahmoud can yo send me the right code?

21 Dec 2010 Rekha G R  
22 Dec 2010 Ömer KAYA

there is a problem if there is a total range of grey levels in the image then it is going to be a kind of problem with the solution.

The ımage is complete white?

What shall we do/do not about it?

Nice code...

29 Dec 2010 Anna

Can you pls tell me for which k=? did you obtain the result from the image?

13 Jan 2011 Vinkle kumar

good one..

05 Feb 2011 osunmbs unduo  
01 May 2011 Ahmed  
08 May 2011 ops OPS

i don't how its work with image !! do u have GUI ?

27 Jun 2011 David Smith  
27 Jun 2011 David Smith

Doesn't work for me. Tried to run it on the Shepp-Logan phantom:

>> [u,m]=kmeans(phantom(128),4);

??? Attempted to access h(1.2); index must be a positive integer or logical.

Error in ==> kmeans at 35
  if(ima(i)>0) h(ima(i))=h(ima(i))+1;end;

27 Sep 2011 Saleh

The segmented image should be multi colors, based on number of clusters. But I have mask with only one color "always red", Why? I need the segmented image
Help me please...

18 Nov 2011 Vipul  
31 Jan 2012 lbrce

xddfd

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
morphology Jose Vicente Manjon-Herrera 22 Oct 2008 07:56:46
segmentation Jose Vicente Manjon-Herrera 22 Oct 2008 07:56:46
kmeans segmentation Jose Vicente Manjon-Herrera 22 Oct 2008 07:56:46
image processing Jose Vicente Manjon-Herrera 22 Oct 2008 07:56:46
clustering Jose Vicente Manjon-Herrera 22 Oct 2008 07:56:46
partitions Jose Vicente Manjon-Herrera 22 Oct 2008 07:56:46
classes Jose Vicente Manjon-Herrera 22 Oct 2008 07:56:47
image processing Claudia 14 Feb 2009 19:50:39
kmeans segmentation ASHWINI SAPKAL 16 Apr 2009 04:28:53
clustering Juan Rodríguez Pulido 14 Oct 2009 04:51:39
kmeans segmentation Teja Muppirala 14 Oct 2009 20:59:14
kmeans segmentation Tencilen 24 Oct 2009 13:18:51
mean shift USST Zhao 01 Nov 2009 20:45:30
morphology tencilen m 25 Nov 2009 21:26:47
classes ahmad ana 20 Dec 2009 19:39:36
segmentation puja 03 Feb 2010 15:09:37
classes Sanjay rajput 07 Feb 2010 22:39:35
cell segmentation dinesh chandra saini 26 Mar 2010 06:20:28
cell segmentation Joseph Eom 16 Sep 2010 10:57:00
clustering Renjith Menon 12 Nov 2010 10:35:24
clustering umair ali 08 Dec 2010 00:25:51
kmeans segmentation YIMING 08 Jan 2011 22:19:56
kmeans segmentation Sebastián Giusti 01 Mar 2011 14:21:01
cell segmentation Mahsa 21 Apr 2011 15:43:34
kmeans segmentation ILyas 28 Apr 2011 05:29:18
cell segmentation seffih 04 May 2011 12:13:58
clustering Oranit 09 Jun 2011 02:05:12
mean shift WALID 13 Jul 2011 01:19:21
cell segmentation WALID 13 Jul 2011 01:19:26
classes WALID 13 Jul 2011 01:19:29
clustering WALID 13 Jul 2011 01:19:31
image processing WALID 13 Jul 2011 01:19:33
partitions WALID 13 Jul 2011 01:19:37
segmentation WALID 13 Jul 2011 01:19:46
kmeans segmentation WALID 13 Jul 2011 01:19:48
kmeans segmentation Ricky Gogoi 03 Oct 2011 01:23:50
mean shift Hassan 19 Oct 2011 01:15:51
kmeans segmentation Ondrej Fousek 19 Oct 2011 08:33:25
cell segmentation Vipul 18 Nov 2011 04:08:38
classes Vipul 18 Nov 2011 04:08:41
fuzzyc khairul nizam 29 Nov 2011 03:29:06
segmentation Michael 01 Dec 2011 16:04:25
chest field segmentation shen 06 Dec 2011 02:22:13
clustering Amit Ruf 11 Jan 2012 04:44:55
cell segmentation ECE MATLAB 26 Jan 2012 04:12:38
ccc lbrce 31 Jan 2012 02:13:38

Contact us at files@mathworks.com