Unveiling the Detection of Color Buttons: A Wise Practice of Machine Vision
In the field of product inspection, every detail is related to quality. Today, let's share a wonderful case of color button detection.
Background and Requirements of the Detection
Imagine a ribbon full of color buttons. If the positions between the buttons are inaccurate, they won't be able to fasten properly. This not only affects the user experience of the product but also concerns the product's quality. Therefore, detecting whether the distances between these buttons are qualified becomes crucial. Moreover, the client put forward a more challenging requirement: to detect 4 moving ribbons at a time. This brought quite a difficult problem to the detection work.
The Ingenious Selection of Cameras and Lenses
To meet the client's needs, we needed to select appropriate cameras and lenses. Considering that the moving ribbons needed to be detected, a global camera was the inevitable choice. Also, to cover 4 ribbons simultaneously, the camera's field of view had to be large enough. Meanwhile, high precision was required for size measurement, which meant the camera's pixels had to be high enough. After careful consideration, we chose a camera with 25 million pixels. Then, according to the field - of - view calculation formula, we calculated that a lens with a 16 - millimeter focal length was the most suitable, which could clearly and comprehensively capture the information of the buttons on the ribbons.
Exploration and Optimization of the Lighting Scheme
In the early stage of the project, we tried to use a backlight panel for transmission lighting, but the effect was not satisfactory.
Looking at the long and thin color ribbons, we thought of bar lights. Bar lights are bright and wide. In theory, if we illuminated the product in parallel with them, the whole ribbon could be lit up. However, in actual operation, we found that this would cause the target features to reflect light, seriously affecting the final detection effect. So, we adjusted our strategy and let the strip lights irradiate the ribbons vertically, directly shining the light on the buttons. Since 4 ribbons needed to be detected at the same time, we used a double - strip light source, which made the lighting more uniform and could illuminate four rows of buttons at once, perfectly achieving the detection goal.
Trade - offs and Choices in Algorithm Setting
In terms of algorithm setting, because of the high - precision requirement for this detection, we first tried the high - precision matching algorithm. But after actual operation, we found that the high - precision process matching took a long time and couldn't meet the client's requirement for detection speed. Then, we adopted the fast - matching algorithm, which only took 300 milliseconds. The detection speed was greatly improved, successfully solving the problem of balancing speed and precision.
Signal Transmission and Control Implementation
To achieve automated detection, we connected the No. 2 power line to an external PLC and used the external PLC to trigger photographing.
At the same time, we used the No. 3 and No. 4 lines to transmit the NG/OK signals to the PLC. In this way, the PLC could control the camera to take pictures and finally output the NG and OK signals. When the ribbons were placed at the detection position, we could easily distinguish good products from defective ones through the NG/OK signs.
Prevention of False Judgments and Joint Maintenance
False judgments are a headache in machine vision detection. Considering the non - uniform colors of the ribbons, we adjusted different exposure times and programs to ensure the detection effect. However, it should be noted that visual detection is like a relationship. One - sided effort is not enough; both parties need to maintain it together. So, to prevent false judgments, the client also actively cooperated. They confirmed that the shape differences of the ribbons were not significant, ensured that the sample surfaces were clean, and avoided external strong light interference at the detection site, thus ensuring the stability of the final detection effect.
This is the detection case of the color ribbon buttons. In this process, we continuously explored, experimented, and optimized to find the best detection solution. Do you have anything you want to detect? Welcome to tell me in the comments!