Thread Subject: color based segmentation

Subject: color based segmentation

From: rubionelove

Date: 2 Jul, 2009 10:32:02

Message: 1 of 8

Hi all,
I did the tutorials with LAB color space in the demo section but in my case the image don't have well separated regions. In my image regions of different colours are very close one from another and do not have strong edges.
I don't want to use tools like "ginput", "roipoly" or similar to define colour region because, I've to analyze a sequence and colours may change a lot.

I would like to classify areas that have similar colours, create a blob for each area, and label the blobs.

any suggestions?

Thanks to all

Subject: color based segmentation

From: ImageAnalyst

Date: 2 Jul, 2009 13:02:49

Message: 2 of 8

On Jul 2, 6:32 am, "rubionelove " <rubionel...@gmail.com> wrote:
> Hi all,
> I did the tutorials with LAB color space in the demo section but in my case the image don't have well separated regions. In my image regions of different colours are very close one from another and do not have strong edges.
> I don't want to use tools like "ginput", "roipoly" or similar to define colour region because, I've to analyze a sequence and colours may change a lot.
>
> I would like to classify areas that have similar colours, create a blob for each area, and label the blobs.
>
> any suggestions?
>
> Thanks to all

-------------------------------------------------------------------------------------------------------------------
Yes, that's true. Often you don't have well separated color
clusters. The colors often just blend continuously from one to
another and there's often no clear dividing line. For example, look
at the color ramps in the MATLAB help documentation for the colormap()
function. Now where does the "winter" ramp change from blue to
green? Where does the "spring" ramp change from magenta to yellow.
As you can see, it's a judgement call. As another example, look at
the photo of the rose on this page:
http://en.wikipedia.org/wiki/Color_quantization
and look at the gamut on the same page. You can see that the gamut is
continuous with no clear dividing lines. You can also see there one
possible way of dividing the gamut up into a smaller number of color
classes.

But there is no "right" answer, except that if it works for your
situation, then it's "right" for you. So you just have to carve up
the color space in some sort of way that produces acceptable
segmentation for you. There are lots of color segmentation method
based on clustering. I can't give a tutorial on all of them because
there's way too many and I don't have the time, so all I can do is to
give you a few suggestions (like you asked) to research it further.
Other than the Wikipedia page, you might try downloading this plug in
for ImageJ:
http://rsb.info.nih.gov/ij/plugins/color-inspector.html
It's an excellent tool for visualizing the gamut of your image(s) and
may help you decide where to segment.

Good Luck

Subject: color based segmentation

From: rubionelove

Date: 2 Jul, 2009 13:11:01

Message: 3 of 8

briefly I have to create blobs for each image region that have similar colour
thanks to all again

regards

Subject: color based segmentation

From: rubionelove

Date: 2 Jul, 2009 13:25:02

Message: 4 of 8

thanks Image Analyst,
I understand... but I'm working on a sequence of aerial images of cars.
Cars can assume a range of different colours. I can't define a way to segment a colour, I would like a scalable solution.

I would like to define a treshold and then join in a separate blob each uniform area, for example, in the case of the rose, I would like a green blob and a yellow blob.
How can I do that?

thank you very much

Subject: color based segmentation

From: ImageAnalyst

Date: 2 Jul, 2009 14:01:09

Message: 5 of 8

On Jul 2, 9:25 am, "rubionelove " <rubionel...@gmail.com> wrote:
> thanks Image Analyst,
> I understand...  but I'm working on a sequence of aerial images of cars.
> Cars can assume a range of different colours. I can't define a way to segment a colour, I would like a scalable solution.
>
> I would like to define a treshold and then join in a separate blob each uniform area, for example, in the case of the rose, I would like a green blob and a yellow blob.
> How can I do that?
>
> thank you very much

-----------------------------------------------------------------------------------------
Can you post a photo somewhere? What do you really want to do? Do
you want to count cars? Do you want to get the size distribution of
cars? Do you want to give a distribution of the dominant car colors?
The answer to this question will determine if you really even need to
do color classification or if you should do some standard image
processing such as edge detection, morphology, etc.

Subject: color based segmentation

From: rubionelove

Date: 3 Jul, 2009 10:03:01

Message: 6 of 8

ok I try to explain clearly

this is my original image named Im

http://www.flickr.com/photos/andreconte/3683396613/sizes/l/
----------------------------
then I apply a treshold to each colorplane and I recombine in one binary image

imR = squeeze(Im(:,:,1));
imG = squeeze(Im(:,:,2));
imB = squeeze(Im(:,:,3));

imBinaryR = im2bw(imR,graythresh(imR));
imBinaryG = im2bw(imG,graythresh(imG));
imBinaryB = im2bw(imB,graythresh(imB));
imBinary = imcomplement(imBinaryR&imBinaryG&imBinaryB);

result :
http://www.flickr.com/photos/andreconte/3683396643/sizes/l/
----------------------------
I made a ROI mask for all the sequence

http://www.flickr.com/photos/andreconte/3684208260/sizes/l/
----------------------------
after that I fill holes with 'imfill' function
the final result is

http://www.flickr.com/photos/andreconte/3683396699/sizes/l/

-------------------------

now I would like to identify separates blob for each region that have similar colour in this image

http://www.flickr.com/photos/andreconte/3683439445/sizes/m/

Is it possible to make it with a simple approach (color segmentation and edge detection)?
I would avoid machine learning on car features because is too much complicated for the experience I have.

Thank you for your advices Imageanalyst
best regards

Subject: color based segmentation

From: hima

Date: 3 Jul, 2009 10:37:01

Message: 7 of 8

"rubionelove " <rubionelove@gmail.com> wrote in message <h2i2b1$2aq$1@fred.mathworks.com>...
> Hi all,
> I did the tutorials with LAB color space in the demo section but in my case the image don't have well separated regions. In my image regions of different colours are very close one from another and do not have strong edges.
> I don't want to use tools like "ginput", "roipoly" or similar to define colour region because, I've to analyze a sequence and colours may change a lot.
>
> I would like to classify areas that have similar colours, create a blob for each area, and label the blobs.
>
> any suggestions?
>
> Thanks to all

hii all,
im doing my work on images.i wat the images to be segmented.can i have a code for that??

Subject: color based segmentation

From: rubionelove

Date: 7 Jul, 2009 07:46:07

Message: 8 of 8

Image analist, have you any suggestions?
regards

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
color segmentation rubionelove 2 Jul, 2009 06:34:04
lab space rubionelove 2 Jul, 2009 06:34:03
rssFeed for this Thread

Contact us at files@mathworks.com