Global TMW:
Login  |  Register          Free Newsletter Subscription
Subscribe
Email
Print
Reprint
Learn RSS

Color enhances inspection results

You need to do more than swap out the camera to turn a monochrome vision system into one that uses color.

Jon Titus, Contributing Technical Editor -- Test & Measurement World, 11/1/2006

SIDEBARS:
-A “pixel” has two meanings
-Monochrome cameras sense colors

READ OTHER NOVEMBER ARTICLES:  Contents, November 2006

For most machine-vision applications, monochrome—or gray-scale—images provide sufficient information about component placement, orientation, and shape. In some cases, though, color images add an extra “dimension” that improves inspection results.

In the electronics industry, the use of color-vision systems lets test engineers monitor the placement of colored components, differentiate between components and assemblies, and perform other inspections that rely on colors. One application might require a vision system to merely distinguish between a blue connector and a red one, without determining the exact shade of blue or red plastic the connector manufacturer used. In another case, an inspection of keyboard backlights or miniature LCDs may require careful matching of measured colors against standard reference colors.

Adapting a machine-vision system to take advantage of color imaging involves more than simply replacing a monochrome camera with a color camera. You must carefully assess camera characteristics and lighting requirements before jumping on the color-vision bandwagon.

Two types of CCD cameras

Most color cameras used for inspection tasks fall into two categories: those that use one charge-coupled device (CCD) and those that use three to convert light into electrical signals. In a 1-CCD camera, a transparent color-filter matrix overlays an array of light detectors. Each detector, which corresponds to a pixel in the resulting image, has a minute red, green, or blue “window” above it (Figure 1). A 3-CCD camera includes an individual CCD for each color (red, green, and blue). Because 1-CCD cameras predominate in machine-vision systems, I will cover them exclusively in this article.

Figure 1. This pattern of colors, found in a Bayer-type filter, overlays a CCD in a color camera. Each colored element covers one photosensitive detector, which corresponds to a pixel in a final image.

Dr. Bryce E. Bayer of Eastman Kodak developed the arrangement of colors shown in Figure 1 so cameras could use one CCD to detect colors across a broad spectrum of visible light. Bayer's standard pattern uses twice as many green filters as red or blue filters to mimic the light sensitivity of the human eye. Color cameras found in machine-vision applications use CCDs with the same Bayer color-pattern arrangement, even though computers and software have no inherent “spectral response” to light. (Camera vendors also offer other filter arrangements.)

You may wonder how a camera can create an image of colored pixels if individual detectors respond to only one color of light. Vision equipment relies on math to fill in the “missing” colors for each pixel that will appear in a final image.

“Color-sensor vendors place a color-filter array over the sensor's individual detectors, or pixels. If you have a pixel with a green filter, the incoming light may contain red and blue wavelengths that pixel cannot detect,” explained Steve Kinney, product manager at JAI Pulnix. “So, the camera looks to neighboring pixels to provide the needed information so it can approximate the other two color values for a given pixel.” (See “A 'pixel' has two meanings,” below.)

Figure 2. Software combines red, green, and blue color information from a central detector and the detectors that surround it to interpolate the color value for the resulting image pixel. Although each detector produces an n-bit value for its measured color, the interpolated color information for each pixel comprises 3n bits.
That approximation, or interpolation, can involve color information from several nearby detectors, or it can use color information from a 3x3 or 5x5 matrix of detectors around a central detector. Suppose orange light falls on several nearby detectors, as shown in Figure 2. That light generates a large signal from a central red detector, a medium signal from surrounding green detectors, and a tiny (if any) signal from surrounding blue detectors. By interpolating the light values from the central detector and its eight surrounding detectors, the camera would create a new color value for the red detector to indicate it had received orange light. As a result, the pixel on the final image would appear orange.

Keep in mind the analog-to-digital converters (ADCs) internal to a 1-CCD color camera produce an 8-bit or 10-bit value that corresponds to the amount of light that reaches each detector. Mathematical interpolation creates a new 24-bit or 30-bit value for each pixel in the resulting image.

A monochrome camera with a 600x400 array of detectors, for example, produces 240,000 bytes per image. A color camera with equivalent resolution produces 720,000 bytes per image. (Both examples assume an 8-bit ADC.) So, when interpolation takes place within a color camera, your host computer must handle an image data rate that is about three times the rate for an equivalent monochrome camera. (CCD configurations of detectors are not always equivalent, so the 3X factor can vary slightly.)

Instead of putting out interpolated color values, some progressive-scan color cameras used for machine-vision applications provide “raw” color data from the individual red, green, and blue detectors. “Do not store that raw information in a JPEG or other compressed format,” warned Kinney of JAI Pulnix. “Compression will ruin the unprocessed color information for an image.”

Software in a host PC will interpolate the pixel values to produce a final color image for processing. Keep in mind the computer time needed to convert raw data into final images. Often, a basic PC cannot keep up with a 60-Mbytes/s flow of raw 8-bit color data, because it also must interpolate that information to create a new 24-bit value for each pixel in a color image. The interpolation creates pixels at a rate of 180 Mbytes/s.

In some applications, you might use only the raw monochrome output from a color camera to inspect the majority of a PCB to, for example, detect the position or orientation of ICs or determine whether components are missing. You could then perform a color-interpolation on only the small areas of an image for which you need color information. Thus, software will look for a red or green connector only in the spot where the connector should exist. (See “Monochrome cameras sense colors.”)

Images lose resolution

Be aware that you will lose resolution when moving from a monochrome camera to a color camera with an equivalent-sized CCD. Developers often ask camera suppliers to specify how much resolution an image will lose, but the vendors cannot quantify it. If you have a black-and-white edge, you have no color on the black side and all colors on the white side, so regardless of color, detectors are on or off. In that case, you don't see much effect from interpolation in the final image, and the edge appears sharp. (Adjacent high-contrast colors such as blue and red also produce sharp edges.)

The right side of this screen display shows all colors available in a red-green-blue color "space." A point on the orange block and another on the red block translate to the two points shown on the color-space diagram. This type of information assists during system setup and color matching. Courtesy of National Instruments.

But, explained Kinney, if your color camera views similar colors, such as an orange object on a brown background, the interpolation will “mix” colors from nearby detectors. “So, the edge blurs and you lose resolution,” he said, “but you can't tell in advance how much you lose.” Some color-interpolation algorithms include edge-detection algorithms that aim to preserve the fidelity of edge information.

Unfortunately, the algorithms may cause a problem: They can remove the defects you want an inspection to reveal. Suppose you have a defect that appears in two or three pixels along a sharp edge. The algorithm “sees” the defect and removes it to “clean up” the edge. You need to pay attention to how software processes images and how that processing can affect results. Often, less-complex algorithms can quickly find defects in an image, even though they do not produce eye-pleasing images.

Lights should match color needs

Unlike monochrome vision systems that simply detect brightness levels across shades of gray, color systems depend on carefully controlled light sources. These sources should maintain a constant intensity and color output, or color temperature.

If you have little or no experience with lighting for a color-inspection system, seek professional advice from lighting vendors or system integrators. Vendors offer a wide range of light sources for a reason: Conditions and requirements vary so much that a small selection of light sources cannot meet all color-inspection needs.

Your choice of light sources will depend on what you want to inspect. “If you need to find a red object and do not need to match an exact shade of red, you may accept some light variations,” said Kyle Voosen, vision product manager at National Instruments. “But if you must measure the color to ensure it matches a production specification, you need lights that produce a known spectrum and maintain it for a long time.”

Halogen lights, for example, produce illumination across a continuous span of wavelengths. Some light sources, though, offer less than meets the eye. Although some LEDs create what looks like white light, their output may lack energy at several wavelengths. And as the phosphors in white LEDs age, the wavelengths of the “white” light shift. Those changes affect the colors a camera captures.

The Panasonic GP-US522HB camera head connects to a stand-alone camera controller that developers can integrate into a color-vision system.
Courtesy of Panasonic Medical Vision.

“The intensity of some light sources decreases as they age,” noted Brent Runnels, systems engineer at National Instruments. “Many illumination products now include a feedback system that maintains a stable light output, even as a bulb changes its characteristics over time. Metal-halide lights also can change color over their life.”

How you plan to use a camera will also affect your choice of lights. Monochrome cameras may take advantage of strobe lights that produce high-intensity bursts of light.

“You should approach gas-discharge lights such as fluorescent lamps or strobe lamps with care when you plan to use them with color cameras,” said Richard Erickson, senior product manager at Hitachi Kokusai Electric America. “These lights have characteristics that affect their brightness and color temperature as they turn on or off. If you capture images as a lamp turns on, turns off, and in the middle of a flash, the images will show different colors for the same target.” You could try to synchronize lamp and camera triggering, but some color cameras do not allow for an external trigger. They only operate in a free-run mode.

Generally, a white “target” illuminated in a camera's field of view provides a known reference for color settings. “For a color camera that produces an 8-bit value, you illuminate the white target and adjust the camera so the ADC for each color puts out a full-scale value of 255 for every detector,” explained NI's Runnels. To avoid saturating the detectors, you could “back off” the balance adjustment so each ADC produces a value of less than 255, say 250, for white light. Then, you can set the image-analysis software so it knows the value of 250 for each color represents the contribution from white light.

“If your lights or inspection setup change, you can put a white target in front of your camera and acquire a new image to calibrate the color-balance settings,” noted Runnels. “If you find specular reflections or glare from a product routinely saturate detectors, you could change to diffuse illumination, add a polarizing filter, or take other measures to avoid saturating detectors. Or, you may not care about saturation if it occurs in areas you don't need to inspect.”


Acknowledgment
Thanks go to Jim Roselius, national sales manager at Panasonic Medical Vision, who also provided information for this article.

 

A “pixel” has two meanings

People who work with image sensors, color cameras, and color imaging often use the word pixel, short for picture element, to describe two different things: an individual light detector on a CCD and the smallest picture element in an image. For clarity in this article, I have used “detector” to indicate an individual detector on a CCD sensor, and I have used “pixel” or “image pixel” to identify the smallest color-picture element.

For more information

“Device Performance Specifications,” Revision 2.0, MTD/PS-0719, Eastman Kodak. January 2006. www.kodak.com/go/imagers.

Graf, Rudolf F., Modern Dictionary of Electronics, 6th ed., Newnes, Boston, MA. 1997.

Monochrome cameras sense colors

In some applications, a monochrome camera can acquire an image that reveals color information. The use of colored lights and filters lets software determine color differences.

Brent Runnels, systems engineer at National Instruments, explained that using a red light source and a red filter with a monochrome camera makes a red label appear bright and a blue label appear dark. Even though the imaging system cannot determine the color of the labels, it can tell the difference between a red and a blue label.

Of course, this example assumes the PCB production facility would not have green labels available, because they would confuse the vision system. Green and blue labels would each appear dark, so a green label might pass inspection.

This monochromatic approach keeps the cost of a vision system low, and a monochrome camera can provide better spatial resolution than a 1-CCD color camera with a similar number of detectors. And on the software side, monochrome images require less processing than do color images.

Email
Print
Reprint
Learn RSS

Talkback

We would love your feedback!

Post a comment

» VIEW ALL TALKBACK THREADS

Related Content

Related Content

 

By This Author

Sponsored Links



 
Advertisement
SPONSORED LINKS

More Content

  • Blogs
  • Podcasts

Blogs

  • Martin Rowe
    Rowe's and Columns

    May 28, 2008
    More on Bill and Dave
    In my January 11 posting, "Tell your Bill and Dave Stories," I asked if the HP Way still e...
    More
  • Rick Nelson
    Taking the Measure

    May 6, 2008
    LED bulbs not quite ready for consumer lighting
    Now that people are finally adopting compact fluorescent bulbs, is it time to throw them out and rep...
    More
  • » VIEW ALL BLOGS RSS

Podcasts

Advertisements





NEWSLETTERS

Click on a title below to learn more.

Test Industry News (3 Times Per Month)
Machine-Vision & Inspection (Monthly)
Communications Test (Monthly)
Design, Test & Yield (Monthly)
Automotive, Aerospace & Defense (Monthly)
Instrumentation (Monthly)
Resource Center E-Alert (Monthly)
©2008 Reed Business Information, a division of Reed Elsevier Inc. All rights reserved.
Use of this Web site is subject to its Terms of Use | Privacy Policy
Please visit these other Reed Business sites