Effects of Color Cameras and Image Enhancement

Effects of Color Cameras and Image Enhancement

Effects of a color camera

Inspection of a gold label attached to a cap

  1. Actual image
  2. Image processed with a monochrome camera
    A monochrome camera cannot extract the shape of the entire label.
  3. Image processed with a color camera
    A color camera can extract the shape of the entire label.

As shown above, when the target is glossy and has a curved surface, a monochrome camera cannot process the image in the same way as the human eye. This is because the brightness of the label is not uniform, as you can see in the actual image.

With a color camera, however, it is possible to extract only the gold color of the label as shown in the rightmost image.

This is because a color camera processes an image using hue (color) data, instead of intensity (brightness) data used by a monochrome camera.

Color cameras often allow stable inspection even for inspections that are difficult with monochrome cameras, which were the most common type used in the past. To this point, we have mainly covered image capture (picture reproduction). This section explains the use of color cameras for capturing images closer to those seen with the human eye, and image enhancement to modify images to ensure stable image processing with the controller.

What is a color camera?

A color camera used in machine vision is generally a single-chip camera which contains a single CCD. Since capturing a color image requires information involving three primary colors, Red, Green, and Blue (R,G, and B), a color filter of R, G, or B is attached to each pixel of the CCD. Each pixel sends the intensity information in 256 levels of R, G, or B to the controller.

CCD
(Charge Coupled Device)

Color system

A color system describes colors numerically. It is generally represented in 3D space with three axes. The HSB color system using three elements of Hue, Saturation, and Brightness, is the closest to the human eye and is best suited to handle image processing.

Image optimization by camera gain adjustment

Camera gain adjustment is an effective method of color differentiation. By adjusting the gain of the individual components of R,G, and B, a better contrast is obtained between close shades of the same color.

Example of camera gain adjustment

Differentiation of cap colors

Actual image

Actual image

Image after gain adjustment of R(red)data

Image after gain adjustment of R(red)data

The red color is shown more vividly to ensure stable differentiation.

Color binary processing

A color camera offers 16,777,216 levels of shade information (256 levels of R, G, and B individually). That is 80,000 times more information than a monochrome camera (only 256 levels of gray). 'Color binary processing' is a function to extract only a specified range from these 16.7 million levels.

Example 1 of color binary processing

Detecting broken green wire in a coil winding

Only green in the winding image is specified for extraction and the image is converted into a color binary image.

Only green in the winding image is specified for extraction and the image is converted into a color binary image.

Only green is extracted.Any broken wire can be detected reliably.

Only green is extracted.Any broken wire can be detected reliably.

Summary

Color machine vision uses data that has 16.77 million possible values based on 256-level shade data for R, G and B respectively. This allows detection of color differences that cannot be recognized with the 256-level gray scale of monochrome cameras.

Color cameras greatly expand the applications of machine vision.

Color shade processing

Current demand for machine vision used in high-speed production lines requires a processing time of one-hundredth of a second. "Color shade-scale processing" is a pre-processing method developed to solve problems associated with the tremendously long processing times of color cameras as well as noise interference from excessive information and inconsistent illumination.

Color shade processing

Color shade-scale processing is a method to convert a color image with an enormous amount of data into a 256-level gray image by setting a specified color to be the brightest level(white). Since images are processed with not only brightness but also color information, difficult applications, such as differentiation between gold and silver, are no longer a problem.

Example of color shade processing

Pale color patterns are not easily recognizable with conventional gray processing (as shown on the left). Color shade-scale processing creates a gray image based on color information, resulting in a clearly visible, strong gray image on a black background. This method offers stable results for inspection of different patterns or position deviation.

Actual image > Image processed with a monochrome camera / Image processed with a color camera

Summary

The advantage of color cameras is the large amount of information, which is directly related to the disadvantage of slow processing time due to the increased amount of information. The image enhancement option Color to Gray Processing was developed to overcome the disadvantage, and color cameras can now achieve high-speed processing on the order of 1/100 second.

Other pre-processing methods

Machine vision is equipped with a variety of pre-processing functions to optimize images according to their various applications. These functions can be used for both monochrome and color images after color binary processing and color shade scale processing have been applied.

Contrast conversion: Surface image adjusted to better detect flaws.

Example
Inspection of the flaws on an iron plate surface
The influence of hairlines on the target surface is eliminated to project flaws only.

Expansion & shrink processing: Unnecessary projections are cleared and then the original outline of the target is recovered.

Example

Inspection of defects on the surface of rubber products while ignoring burrs

Real-time differential processing: A captured image is compared with a registered image to extract only the differences.

* Only the flaw is extracted while the complicated shape of the target is ignored.

Example
Inspection of foreign matter in connector housing
Multi-filtering combines several pre-processing methods in multiple stages to create an optimal image.

Summary

The basics of image processing involve capturing a clear image.
A color camera enables extraction of color differences in much the same way as the human eye.
A variety of pre-processing filters are available to optimize image contrast according to the specific requirements of the application.
Inspection stability will improve greatly when either color processing or pre-processing filters are properly applied to the image.

The next topic is related to software: basics of appearance inspection.

There are a number of inspection modes, and the Stain mode is the most commonly used.

Let's look at the Stain mode algorithm that supports appearance inspections of various targets.