introduction
General machine vision system: camera, lens, light source, motion system, this article first summarizes the relevant knowledge of light source.
For the defect detection series in machine vision, visual industrial inspection is roughly divided into workpiece size measurement and positioning, surface defect detection, and various Logo detection and identification.
- Size measurement is mainly to detect the length, width and height of the object, and the more common is the two-dimensional size (width and height) detection of the object.
- Surface defect detection is mainly the surface of the surface of the local physical or chemical properties of the uneven area, more common are metal or plastic products surface scratches (such as: mobile phone case/screen surface scratches), spots and holes (such as: PCB board leakage solder joints or surface more solder joints), paper surface color difference, dirty stains, damage, paper products surface indentation, protrusions, glass and other non-metallic products surface impurities, damage, stains, flatness, etc.
- The detection and identification of the logo is mainly whether the logo printing is correct and complete.
The basic components of the visual inspection system mainly include image acquisition, image processing and analysis, data management and human-computer interaction (some are also divided into camera, light source, lens, image acquisition card, vision processing system and other five parts).
- The image acquisition module, the hardware part mainly includes lighting sources, cameras, lenses, frame grabbers, etc.
- Image processing and analysis, the software algorithm part mainly includes image preprocessing and detection processing, preprocessing to process image data, so that the image features we need are more obvious; The inspection process detects damage and size based on image features.
- Data management and human-computer interaction, whether the detected objects are qualified and the whereabouts are processed accordingly according to actual needs.
1. Selection of light source
Light source is the foundation, lighting is art. A good lighting effect basically determines most of the success of visual inspection.
The rationality of the light source selection directly affects the quality and application effect of the input image data. For each different application case and environment, it is necessary to select the corresponding light source and reasonable lighting method to achieve the best application effect.
1️⃣ Light sources can be divided into visible light and invisible light.
Several commonly used visible light sources are LED lamps, fluorescent lamps, halogen lamps (fiber optic light sources), and special light sources.
LED Lights:
• Service life is about 10000-30000 hours.
• Multiple LEDs can be used to achieve high brightness and different shapes can be combined;
• Fast response, wavelength can be selected according to the use, made into different colors.
Fluorescent lamps:
• Service life approx. 1500-3000 hours;
• Advantages: good diffusion, suitable for uniform irradiation over a large area;
• Cons: Slow response, dark brightness.
Fiber optic halogen lamps:
• Service life approx. 1000 hours;
• Advantages: high brightness;
• Disadvantages: Slow response, almost no change in brightness and color temperature.
2️⃣According to different emission methods, it can be divided into back lighting, forward lighting, structured light and strobe lighting.
- Back-facing illumination is the measured object placed between the light source and the camera, its advantage is to obtain a high-contrast image, the image effect is black and white clear profile of the measured object, often used for size measurement;
- Forward illumination is where the light source and camera are located on the same side of the measured object, which is easy to install and is mainly used to detect important details, defects and scratches on the surface of the object.
- Structured light illumination is to project a grating or line light source onto the measured object, and demodulate the three-dimensional information of the measured object according to the distortion they produce.
- Strobe lighting is the illumination of high-frequency light pulses on an object, and camera shooting requires synchronization with the light source.
3️⃣According to the lighting mode, it can be divided into dome light source, ring light source, parallel light source, coaxial light source, point light source, low angle light source, line light source, grating, etc.
Select the angle of the light source: Depending on the desired image effect, select a light source with different incidence angles.
- Dome light source, mainly used for defect detection of spherical or curved objects, detection of characters on uneven smooth surfaces, and surface inspection of metal or mirror surfaces. Such as glass bottles, balls, small workpiece surfaces, plastic or aluminum containers, etc.
- Ring light irradiation, mostly used for integrated circuit material tape and pin characters, metal workpiece engraving characters, smooth surface scratches, bottle mouth size or cracks, flat workpiece surface quality inspection.
- Bar light source (controllable lighting, red, blue, green monochrome light source) is also called strip light is a lighting source that is lit from the side, the commonly used angle is 45 degrees, there are also smaller angles. Side lights avoid strong reflections from frontal illumination and also enable bright illumination of edge parts. It is a lighting method that is widely used in dimensional measurement and appearance inspection. Commonly used in: LCD defect detection, packaging text detection, packaging film damage detection, paper quality inspection, conventional printing quality inspection, manufacturing crack detection, electronic components shape recognition and size measurement, various linear array testing, etc.
- Coaxial light irradiation, the image effect is black features on a bright background, used for the detection of reflective flat objects, can enhance the surface features with different angles, enhance the surface texture (scratches, depressions, embossing), reduce shadows. Such as scratches and defects detection on smooth surfaces such as metal and glass, damage detection of chips and silicon wafers, stamping character detection on metal parts, solder joints and symbols of circuit boards, pin character detection of integrated circuits, etc.
- High angle irradiation, the overall image is bright, suitable for non-reflective objects on the surface;
- Low angle irradiation, the image background is black, the feature is white, which can highlight the contour of the measured object and the surface concave and convex changes;
- Multi-angle irradiation, the overall effect of the image is soft, suitable for curved object detection;
(a) Consider the light source color and background color:
Using light in the same color as the object will brighten the image (e.g., red light makes red objects brighter);
Using light that is the opposite color to the subject will darken the image (e.g., red light darkens blue objects, blue light illuminates yellow objects, and black).
The longer the wavelength, the stronger the penetrating ability; The shorter the wavelength, the stronger the diffusion capacity.
The infrared has strong penetration ability, which is suitable for detecting objects with poor light transmission, such as brown oral liquid impurity detection. UV is sensitive to subtle features on the surface, and is suitable for detecting places where contrast is not obvious, such as text detection on cooking oil bottles.
(b) Select the shape and size of the light source:
It is mainly divided into circles, squares and bars. Usually, a light source with the same shape as the measured object is selected, and the final light source shape is subject to the test effect. The size selection of the light source requires to ensure that the light in the entire field of view is uniform, which is slightly larger than the field of view.
(c) Choose whether to use a diffuse light source:
If the surface of the measured object is reflective, it is best to use a diffuse reflection light source. The multi-angle diffuse illumination makes the overall brightness of the surface of the measured object uniform, the image background is soft, and the detection feature is not disturbed by the background.
2. How to evaluate the quality of a light source?
1) Contrast
Contrast is very important for machine vision. The most important task of lighting for machine vision applications is to create maximum contrast between the features that need to be observed and the image features that need to be ignored, so that it is easy to distinguish between features.
Contrast is defined as a sufficient gray measure difference between a feature and the area around it. Good lighting should ensure that the features to be detected stand out from other backgrounds.
2) Robustness
Robustness is a good adaptation to the environment. A good light source needs to have the same effect as it does in the laboratory.
3) Brightness
When choosing between two light sources, the best choice is to choose the brighter one. If the brightness of the light source is not enough, it is necessary to increase the aperture, thereby reducing the depth of field.
4) Uniformity
Uniformity is a very important technical parameter of light source. The light source with good uniformity makes the system work stably.
5) Maintainability
Maintainability mainly means that the light source is easy to install and easy to replace.
6) Life and calorific value
The brightness of the light source is not easy to decay too quickly, which will affect the stability of the system and increase the cost of maintenance. The brightness of lamps with large heat generation decays quickly, and the life of the light source will also be greatly affected.
3. How to rely on light sources to enhance contrast
Using light of the same color or a light source of similar color to illuminate the illuminated part;
Using light of opposite colors, irradiating a light source of similar color can darken the illuminated part.
Different wavelengths, the penetration of the substance (penetration rate) is different, the longer the wavelength, the stronger the penetration of the object, the shorter the wavelength, the greater the diffusion to the surface of the material.
Summary: Some tips for choosing a light source
If you need more contrast between the foreground and background, consider using a monochrome camera with a color light source
For ambient light problems, try using a monochrome light source, with a filter
Flash surfaces, consider scattering dome light
Flash, flat, but rough surface, try to scatter light with coaxial
Look at the shape of the surface, consider using a dark field of view (low angle)
When inspecting plastics, try using ultraviolet or infrared light
You need to see features through reflective surfaces, try using a low-angle line light source (dark field)
Consider using a combination light source when a single light source cannot effectively solve the problem
Strobe produces light 20 times stronger than always-on illumination
Reprinted in: https://www.cnblogs.com/xyf327/p/14862675.html