Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!33g2000vbe.googlegroups.com!not-for-mail
From: ImageAnalyst <imageanalyst@mailinator.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: How to extract yellow color under different iluminations
Date: Tue, 20 Oct 2009 05:53:37 -0700 (PDT)
Organization: http://groups.google.com
Lines: 39
Message-ID: <76b3be5d-f7d7-466f-b7d6-3d3894a62aa0@33g2000vbe.googlegroups.com>
References: <hbhgam$3ok$1@fred.mathworks.com> <hbhira$906$1@fred.mathworks.com> 
	<hbjsju$c0g$1@fred.mathworks.com>
NNTP-Posting-Host: 192.44.136.113
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1256043217 22670 127.0.0.1 (20 Oct 2009 12:53:37 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Tue, 20 Oct 2009 12:53:37 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: 33g2000vbe.googlegroups.com; posting-host=192.44.136.113; 
	posting-account=0rLUzAkAAABojYSRC64DkTbtiSCX77HH
User-Agent: G2/1.0
X-HTTP-Via: 1.1 bdci2px (NetCache NetApp/6.0.7)
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; 
	CyberSafe-IWA-Enable; .NET CLR 1.1.4322; .NET CLR 2.0.50727; MS-RTC LM 8; 
	.NET CLR 3.0.04506.648; .NET CLR 3.5.21022),gzip(gfe),gzip(gfe)
Xref: news.mathworks.com comp.soft-sys.matlab:578676


On Oct 20, 4:33 am, "Prasanna " <pmgunaward...@gmail.com> wrote:
> Thank u very much for your immediate reply.I am going to identify the traffic sign (.jpg) image. And it is rectangular shape sign image, no border. back ground of the sign is yellow.middle of the sign contain the "left bend" sign with black color. I have taken the several pictures of that under different light conditions. I want extract the yellow color area and do some further analysis. Unfortunately I don't have the pictures right now. I will send them bit later. Until that if you get a rough idea please share it with me.
>
> Regards
> Prasanna.
--------------------------------------------------------------------------------------------------------------
My colleague used to joke that he was amazed that they would pay us
big salaries when all we do is thresholding.  In some sense it's
true.  In virtually all image processing situations you go through a
bunch of operations to identify the things you DO want and DON'T want
in your scene, but one of the final steps in this potentially long
process is thresholding.  Most image processing applications look
something like this:

(bunch of operations to get an image that can be thresholded)
threshold the image
do connected components labeling (if you have multiple regions that
need to be separately measured) - can use the MATLAB function
bwconncomp()
measure the objects - can use the MATLAB function regionprops()

In you case the first step might be to do some sort of color
classification.  If you're lucky this may be as easy as simply calling
rgb2hsv().  If all the pixels that you consider to be "yellow" fall
into a certain range of gray levels in the hue image, you're home
free.  Just threshold, throw out spurious yellow objects that aren't
signs (e.g. maybe they're not large enough) and measure what's left.

Here's a tutorial I wrote that uses thresholding. You may find it
helpful if you're new to image processing:
http://www.mathworks.com/matlabcentral/fileexchange/25157