MadSci Network: Engineering

Re: What sensor do I use to identify colors?

Date: Tue Sep 4 15:36:49 2001
Posted By: Todd Jamison, Staff, Image Science, Observera, Inc.
Area of science: Engineering
ID: 998632474.Eg

A standard color camera allows one to identify the various shades of color 
that most humans see.  Typically, these cameras capture energy in the red, 
green and blue parts of the visible spectrum.  There are parts outside of 
the camera's range, which is known as the gamut, that we can see, but are 
not captured by the camera.  One example is the "neon" glow of neon colored 
paper, which is usually not well represented in digital images.  Some 
standard color cameras see beyond our capabilities, particularly into the 
near-infrared.  An example of this can be seen by aiming the camera at an 
infrared remote control while videoing the little emitter.  You will see a 
red dot appear in the picture that you cannot see.

Every color we see is determined by how our brain interprets these three 
colors.  Often, when one wants to determine the color of something, we 
convert the RGB color image into a different "color space", known as IHS, 
which stands for Intensity, Hue, and Saturation.  The I-part is basically 
what you might think of as the 'black and white" or grayscale part of the 
image.  It is calculated for each pixel as the average of the R, G, and B 
values.  The S-part is the amount of color present at a given pixel and it 
is often calculated as 1 - min(R,G,B)/I.  The H-part represents the color of 
a given pixel, independent of how bright or how much color is present.  It 
is sometimes calculated as [pi/2-arctan((2R-G-B)/sqrt(3)*(G-B))+pi]/2pi for 
G < B.  There is another equation for when B < G.  The H-part of the IHS 
color space is sometimes used in image processing to work with parts of an 
image independent of illumination and shadow, because the hue tends to 
remain similar whether or not the illumination changes.  (The process I have 
described is similar to, although not exactly the same as, the process used 
for standard Color TV signals that also work on B&W TV equipment.  
Basically, the B&W TV only uses the I-part of the picture signal.)

One must be a little careful when we talk about colors.  The colors we, as 
humans, see is due to the detection of different bands of the spectrum by 
our "cone" cells in the retina.  We have cones that are sensitive in the 
red, blue and green bands.  While we can distinguish between subtle 
combinations of these broader bands, we cannot differentiate between light 
energy within a smaller portion of a band. So for instance, two different 
materials may emit or reflect light within the green band at slightly 
different wavelengths, but because we see only over a wide range of 
wavelengths, they both look similarly green to us.  To solve this, some 
special cameras have been built that isolate much smaller parts of the 
spectrum.  These cameras are known as hyperspectral (hundreds of bands) or 
ultraspectral (thousands of bands) cameras and allow one to distinguish 
between various materials based on subtle difference in their spectra.  

Your choice of camera will depend upon what you want to do.  I hope that i 
have given you enough info to develop your own decision.  I would say that 
for all but the most demanding applications, a standard color camera (still 
or video) will probably do what you want.  You may have to convert the 
standard RGB output to the IHS space to get what you want, tho.  

Good luck, 
Todd Jamison
Chief Scientist, Observera, Inc.

Current Queue | Current Queue for Engineering | Engineering archives

Try the links in the MadSci Library for more information on Engineering.

MadSci Home | Information | Search | Random Knowledge Generator | MadSci Archives | Mad Library | MAD Labs | MAD FAQs | Ask a ? | Join Us! | Help Support MadSci

MadSci Network,
© 1995-2001. All rights reserved.