The Purpose of Lighting
When taking photos with a digital camera, additional lighting is often necessary. For example, traffic cameras at intersections often flash to take photos. Similarly, in machine vision, lighting is necessary to capture high-quality images. The core of a machine vision system is image acquisition and processing, and lighting is an important factor that affects image quality. Proper lighting can greatly reduce the difficulty of image recognition and improve the precision and reliability of the system.
For machine vision inspection systems, a stable and uniform light source is extremely important. The purpose of the light source is to clearly distinguish the object being measured from the background and obtain high-quality images with high contrast. When capturing an image, the most important thing is to obtain a clear grayscale difference between the object being measured and the background. A good lighting design can allow the camera to capture object features more accurately, improve the contrast between the object and the background, and as such, the design of the lighting and optical system is the most important factor that determines the success or failure of a vision system.
The Importance of Lighting
A complete machine vision inspection system mainly consists of image acquisition and image analysis. All information comes from the image, and the quality of the image itself is critical to the entire vision system. The light source is an important factor that affects the quality of machine vision system images. If the lighting design is not appropriate, this can lead to half-hearted efforts in image processing algorithm design and imaging system design. There is currently no universal machine vision lighting system that can meet different inspection requirements. Therefore, for each specific case, a suitable lighting device needs to be designed to achieve the best results.
In machine vision systems, the role of the light source is mainly reflected in:
(1) highlighting the difference between defects and backgrounds, enhancing image contrast, as shown in Figure 2-1(a). (2) forming the most favorable imaging effect for image processing, as shown in Figure 2-1(b). (3) illuminating the target, increasing the target’s brightness, overcoming environmental light interference, and maintaining image stability, as shown in Figure 2-1(c).
Factors Affecting the Light Source
Obtaining a high-quality and processable image is crucial in machine vision systems. The success of the vision system design largely depends on whether the image quality and features are highlighted or not. Choosing the appropriate light source is a key factor in ensuring image quality, and the key considerations for light source selection include the following:
Contrast is crucial for machine vision. In machine vision applications, the most important task of illumination is to produce the maximum contrast between the features of the object to be observed and those that need to be ignored, making it easier to distinguish features. The difference in grayscale values between the features that need to be extracted and the background in the image described here refers to the image taken with a black and white camera. As shown in Figure 2-2(a), when the contrast between the image and the background is low, it is difficult to see the characters. As shown in Figure 2-2(b), when the contrast between the image and the background is high, the characters are clearly visible.
A light source with good uniformity ensures stable operation of the machine vision system, which can guarantee that the grayscale levels of the image in the detected part of the workpiece are basically the same. This is beneficial for software analysis and can reduce the risk of misjudgment. For images with good uniformity, the grayscale values of the entire background of the image should not differ significantly, which is primarily affected by the lighting method. For working environments with strong reflections, there are generally two lighting methods: all reflection or no reflection.
As shown in Figure 2-3(a), if there is strong surface reflection on the object, it may cover the characters on the surface of a cigarette box if the lighting is all reflective. If the lighting is not uniform, it will affect the processing effect, and the grayscale values obtained by image acquisition may also differ, which can cause interference when extracting features. As shown in Figure 2-3(b), the grayscale values of the entire background of the image are relatively close, making it much easier to process.
Uniformity and contrast are basic criteria for judging the quality of an image, while the correct selection of a light source is the key to influencing image quality.
- Color Reproduction
Color reproduction refers to the fact that after being shot and processed, the color of the color film is consistent with that of the original scene. The closer the colors in an image are to the original, the more accurate the color reproduction is. The color reproduction of an image requires moderate brightness and no overexposure, as shown in Figure 2-4.
Figure 2-4 Color reproduction of an image (a) Color distortion: (b) Close to true color.
Brightness is an important factor to consider when choosing a light source, and a light source with high brightness should be chosen whenever possible. When the light source is not bright enough, the following situations may occur: Firstly, the signal-to-noise ratio of the camera is not high enough, so the contrast of the image is not high enough, and the possibility of noise appearing in the image increases accordingly. Secondly, if the light source is not bright enough, the aperture must be increased, which reduces the depth of field. Thirdly, when the light source is not bright enough, the influence of random light such as natural light on the system will increase.
Robustness refers to the sensitivity of the light source to the position of the object, and a light source with good robustness has low sensitivity to the position of the object. When the light source is placed in different areas or positions at different angles within the camera’s field of view, the obtained image does not change accordingly. In many cases, light sources with good robustness achieve the same results in practical work as they do in the laboratory.
- Predictability of the Light Source
When the light source is incident on the surface of an object, the direction of the light source can be predicted, and the light source may be absorbed or reflected by the surface of the object. For example, the light may be completely absorbed (such as in black metal materials, making it difficult to illuminate the surface of the object) or partially absorbed (resulting in color changes and differences in brightness). The light that is not absorbed will be reflected, and the angle of incidence of the light is equal to the angle of reflection.
- Surface Characteristics of Objects
The complexity of machine vision lighting is caused by changes in surface characteristics of objects. If all surface characteristics of objects were the same, different lighting techniques would not be necessary in practical applications. It is precisely because surface characteristics of objects differ that it is necessary to observe whether the surface characteristics of objects in the field of view are metal, glass, plastic, or other materials, and analyze the direction of the light source incident on the surface of the object.
- Position of the Light Source
The light source is reflected onto the surface of the object according to the direction of incidence, so the position of the light source is important for obtaining high-contrast images. Because the goal of the light source is to achieve different reflections of the object features and the surrounding background, predicting how the light source is reflected onto the surface of the object can determine the position of the light source.