Path: news.mathworks.com!newsfeed-00.mathworks.com!NNTP.WPI.EDU!elk.ncren.net!newsflash.concordia.ca!canopus.cc.umanitoba.ca!not-for-mail
From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)
Newsgroups: comp.soft-sys.matlab
Subject: Re: machine vision-Color Matching
Date: Wed, 20 Feb 2008 09:12:02 +0000 (UTC)
Organization: National Research Council Canada - Conseil national de rechereches Canada
Lines: 29
Message-ID: <fpgqt2$fn0$1@canopus.cc.umanitoba.ca>
References: <fpgn52$9ij$1@fred.mathworks.com>
NNTP-Posting-Host: origin.ibd.nrc.ca
X-Trace: canopus.cc.umanitoba.ca 1203498722 16096 192.70.172.160 (20 Feb 2008 09:12:02 GMT)
X-Complaints-To: abuse@cc.umanitoba.ca
NNTP-Posting-Date: Wed, 20 Feb 2008 09:12:02 +0000 (UTC)
Originator: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)
Xref: news.mathworks.com comp.soft-sys.matlab:452579


In article <fpgn52$9ij$1@fred.mathworks.com>,
Vihang Patil <vihang_patil@yahoo.com> wrote:

>1. The object to be detected for color change comes in the 
>following 4 colors;Metallic BLOOD RED, Metallic BlACK, 
>Metallic SILVER, Metallic BLUE. 

>Suppose I have got these values for the colors from the 
>reference image

>Now it is pretty obvious that due to the ambient lighting 
>condition and other factors, you will not get the same 
>color match or perfect match for the object in test 
>condition and I get a  value which is say

>color = [80 110 217]; 
>My question is "How do we determine and tell that it is 
>blue"

I suggest you experiment with rgb2hsv and examine the hue (H).
Red, silver, and blue should all be well seperated in hue;
to distinguish black you -might- need examine intensity
(black could be a "very dark" of any of the hues.)

Or you could try sum(abs(color - reference)) or
sum((color - reference).^2) for each of the reference colors
and find the minimum difference.
-- 
  "All is vanity."                                   -- Ecclesiastes