Code covered by the BSD License  

Highlights from
color Image Segmentation

4.0

4.0 | 9 ratings Rate this file 236 Downloads (last 30 days) File Size: 16.39 KB File ID: #25257
image thumbnail

color Image Segmentation

by Athi

 

08 Sep 2009 (Updated 07 Jun 2011)

Segments a color image into regions.

| Watch this File

File Information
Description

This program segments a color image into different regions.
The steps followed for segmentation in this program is as follows:

1. The input color image will be coarsely represented using 25 bins.
2. Coarse representation uses the spatial information from a Histogram based windowing process.
3. K-Means is used to cluster the coarse image data.

Those who are new to Matlab Programming can see the "SampleUsage.m" file for the usage of the script "colImgSeg.m".

Those who are already familiar with Matlab Programming can directly use the script "colImgSeg.m".

Required Products Image Processing Toolbox
MATLAB release MATLAB 6.5 (R13)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (19)
11 Sep 2009 Venkat R

Hi Athi,
Nice contribution.
When we run the program on same image, different results are coming. It appears there is some bug in your terminating criterion in clustering. Can you fix it.

regards,
ramana

11 Sep 2009 Venkat R  
12 Sep 2009 Athi

Dear Ramana Murthy,

The output matrix will be same.
But the coloring may differ. Because of default color usage & K-Means.
Am I answered your question?

13 Sep 2009 Vignesh

Its working fine. It helps me to understand color histogram fuzzification. Thanks a lot.

14 Sep 2009 jichao zhao

why I have the following error, I do not have Image Processing Toolbox?

??? Undefined function or method 'kmeans' for input arguments of type 'double'.

Error in ==> colImgSeg at 81
fusedMap = kmeans(inImg_1D,nClass, 'EmptyAction', 'singleton');

Error in ==> SampleUsage at 18
outImg = colImgSeg(inImg, nBins, winSize, nClass);

19 Oct 2009 nanang krisdianto

hi Athi

when i am running the code,
Why i have notification like this

??? Input argument "inImg" is undefined.

Error in ==> colImgSeg at 24
s = size(inImg);

29 Nov 2009 Ashok Kumar  
23 Dec 2009 Farie

Hi, I tried your program but got lot of errors, like not in the loop, unused variables. Can you fix it?

05 Jan 2010 Theodoros Giannakopoulos  
19 May 2010 zhao qiang

Hi Athi,
Nice contribution.
your program is unstabe ,this is because of the function kmeans,you can try it.
and i want konw what is the meaning of the following statements?

lab = floor(mat(i,j,1)/divis)*(nBins*nBins);
                lab = lab + floor(mat(i,j,2)/divis)*(nBins);
                lab = lab + floor(mat(i,j,3)/divis);
                lab = lab + 1;
                TabLabel(lab) = TabLabel(lab) + 1;
                sum_lab = sum_lab + lab;
i think this is a weighted action?but why?
look for your reply~
regards,
zq

19 May 2010 zhao qiang  
08 Jul 2010 Juan Du

Hi Athi,

Thank you. This is very useful tool. I also want to segmenting HSI images. But it does not work with this code. This code seems only works on RGB image. Can you help me to solve the problem?

Thanks.
JD

06 Oct 2010 Biao

thank you so much! it's useful!

07 Oct 2010 Biao

if the illustration algorithm is more specific, this program will be more honorable!

09 Jun 2011 Saravanan

Its good,

fusedMap = kmeans(inImg_1D,nClass, 'EmptyAction', 'singleton');

I am working on medical images, where the fusedMap becomes NULL.

Whether its for particular type of images ?

18 Jul 2011 AMIT

hi athi
thnx dude
can you plz send me the Literature of this program
it will help me in myproject

thnx
amit

03 Aug 2011 Thendral

Hi Athi
When i am running this code i am getting error like this

Error in ==> colImgSeg at 24
s = size(inImg);
Plz help me

14 Oct 2011 waseem ahmad

hi athi,
i need to find the center of a colored region if u can help me,plz?

31 Jan 2012 lbrce

fff

Please login to add a comment or rating.
Updates
07 Jun 2011

Author Info Updated

Tag Activity for this File
Tag Applied By Date/Time
image segmentation Athi 08 Sep 2009 14:33:35
segmentation Athi 08 Sep 2009 14:33:36
clustering Athi 08 Sep 2009 14:33:36
image processing Athi 08 Sep 2009 14:33:36
region extraction Athi 08 Sep 2009 14:33:36
object identification Athi 09 Sep 2009 13:46:39
object extraction Athi 09 Sep 2009 13:46:40
image segmentation mahebilla rethinam 02 Mar 2010 12:00:06
segmentation mahebilla rethinam 02 Mar 2010 12:00:11
segmentation azka 13 Jun 2010 17:53:03
segmentation hanan bayyoumi 10 Nov 2010 13:34:39
clustering AYUSH 25 Apr 2011 14:30:02
image segmentation Al-moutaz Mobaydeen 17 Jun 2011 09:02:19
object extraction Al-moutaz Mobaydeen 15 Oct 2011 14:47:15

Contact us at files@mathworks.com