Fusion enhanced automobile surface defect detection method based on multi-angle light source
Through the method of multi-angle light source image acquisition and FPGA processing, the problem in the existing technology of lighting conditions affecting the detection effect in complex environments is solved, efficient and accurate automobile surface defect detection is achieved, and the risk of false detection and missed detection is reduced. It is applicable for automobile production and maintenance.
Patent Information
- Application Number
- CN202410523953.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-29
- Publication Date
- 2024-09-17
AI Technical Summary
Existing automobile surface defect detection methods have poor detection results under lighting conditions in complex environments, are prone to false detections and missed detections, and are slow in processing and cannot achieve instant feedback, affecting detection efficiency.
Using a fusion enhanced detection method based on multi-angle light sources, multiple images are acquired through a multi-angle light source image acquisition system, grayscale pixel value extraction and segmentation threshold comparison are performed, and combined with the FPGA platform for processing and optimization to achieve fast and accurate defect detection.
It improves the accuracy and efficiency of detection, reduces the risk of missed detection and misdetection, ensures that the surface quality of the car meets the standards, and is suitable for automobile production and maintenance.
Smart Images

Figure CN118655137A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of defect detection, and in particular to a method for detecting automobile surface defects based on fusion enhancement of multi-angle light sources. Background Art
[0002] Defect detection technology is a very important part of industrial production. Current defect detection technology mainly uses machine vision and deep learning to detect automotive surface defects. Most of them use high-resolution cameras to capture images of defective surfaces, and then use deep learning algorithms to analyze these images. The deep learning model is trained with a large number of labeled defect images and learns to recognize various types of defects, such as cracks, scratches, or dents. This method can automatically detect and classify surface defects, improve detection speed and accuracy, and reduce the need for manual inspection, thereby improving product quality and production efficiency in the manufacturing industry.
[0003] However, existing defect detection methods usually use fixed imaging methods, which have a great impact on the defect detection effect under lighting conditions in complex environments, are difficult to adapt to the characteristics of different samples or defect types, and may cause problems such as false detection and missed detection. At the same time, existing defect detection methods have a slow processing speed for defect images, require a long processing and analysis time, and cannot achieve instant feedback, which greatly affects the efficiency of defect detection.
[0004] Therefore, we propose a fusion-enhanced automobile surface defect detection method based on multi-angle light sources to solve the above problems. Summary of the invention
[0005] 1. Technical issues to be solved
[0006] In view of the shortcomings of the prior art, the present invention provides a method for fusion-enhanced automobile surface defect detection based on multi-angle light sources, which solves the problems raised in the above background technology. By adjusting the lighting conditions, such as the lighting angle and intensity, the detection and characterization capabilities of defects are improved. By fusing the imaging results under different lighting conditions, defects can be presented more accurately and clearly.
[0007] (II) Technical solution
[0008] In order to achieve the above-mentioned purpose, the present invention specifically adopts the following technical solutions:
[0009] A method for automobile surface defect detection based on fusion enhancement of multi-angle light sources, the following steps:
[0010] S1: The image acquisition system based on multi-angle light source acquires eight images containing automobile surface defects from different lighting angles;
[0011] S2: Extract grayscale pixel values from eight images with different illumination angles and set segmentation thresholds. Compare the grayscale pixel values with the segmentation thresholds to obtain defective pixel points.
[0012] S3: Subtract the grayscale pixel values at the same position of eight images with different illumination angles from each other and compare them with the original pixel values to obtain defective pixel points.
[0013] S4: Fusing the defective pixels of the above two processes to obtain a complete defective pixel image.
[0014] S5: The above method is processed and optimized in the FPGA platform to improve the detection efficiency and obtain the final automobile surface defect detection results.
[0015] Furthermore, in S1, the image acquisition system based on multi-angle light source includes:
[0016] Multi-angle light source: A circular coaxial light source composed of eight groups of LED lights, which can achieve multi-angle lighting by lighting different LED light groups.
[0017] Industrial camera: The industrial camera is located in the center of the ring of multi-angle light source, passing through and perpendicular to the ring light source to realize image capture of defects.
[0018] Furthermore, in S2, for the pixels at the same position in the eight multi-angle illumination images, the current pixel position is set to (i, j), the pixel grayscale values at the same pixel position in the eight multi-light source images are extracted to form the pixel feature vector X = [x1, x2, x3, x4, x5, x6, x7, x8] at the current pixel position, and the segmentation threshold T is set. d =255, for the pixel grayscale g(x,y)≥T in the detection area d The pixel point with grayscale g(x,y)<T in the detection area is considered as a defect point. d The pixel point is regarded as a normal point, and the expression formula is:
[0019]
[0020] Furthermore, in S3, the grayscale pixel values at the same position of the eight images with different illumination angles are subtracted from each other and compared with the original pixel values to obtain defective pixels, the current pixel position is set to (i, j), and the pixel grayscale values at the same pixel position of the eight multi-light source images are extracted to form a pixel feature vector X = [x1, x2, x3, x4, x5, x6, x7, x8] at the current pixel position, where x i is the pixel value (0-255) in the i-th image, where x j is the pixel value (0-255) in the jth image, and the formula is expressed as:
[0021]
[0022] Furthermore, in S4, the defective pixels of the above two processes are fused to obtain a complete defective pixel image, and the representation formula is:
[0023] g(x,y)=f(h(x,y)). (3)
[0024] Where g(x,y) is the target image, h(x,y) is the function, and f(x,y) is the source image.
[0025] Furthermore, in S5, the above method is implemented through FPGA hardware, and a hardware parallel architecture is used inside the FPGA to perform rapid defect detection processing, wherein each secondary path Skm in the hardware parallel architecture runs independently in parallel, and the implementation of the digital filter requires the sum of the product of the coefficients and the input, and each step in the sum can be regarded as a combination of multiplication and accumulation.
[0026] Furthermore, in S5, the FPGA hardware implementation process uses a convolution operation parallelization method to perform structural optimization, and the convolution operation parallelization process is as follows:
[0027] (1) Matrix partitioning: For larger arrays in the convolutional layer, in order to increase the parallelism of data access, they are split into multiple smaller arrays and partitioned using the ARRAY_PARTITION command in HLS. This instruction can divide the matrix into several small registers, thereby improving the parallelism of operations.
[0028] (2) Pipelining: split an operation that requires a relatively large delay into multiple small operations to be executed in parallel, thereby improving the execution speed of the hardware end. In HLS, the PIPELINING and UNROLL optimization instructions are used to implement this. In one clock cycle, the three dot product numbers are first stored in their three registers, and then the multipliers and adders are used for calculation. In each clock cycle, three new dot product operands are extracted from registers A1~A3 and B1~B3, and the multipliers and adders are used for parallel calculation. The calculation process is composed of many register stages. When calculating, there is no need to wait for the current calculation to be completed, but to continue to extract the memory in the next clock cycle and create a data processing pipeline.
[0029] Furthermore, in S5, the FPGA platform mainly includes the following modules:
[0030] The multi-angle light source module is used to provide lighting conditions at different angles.
[0031] The image acquisition module is used to obtain the image of the object to be detected under the illumination conditions of multi-angle light sources.
[0032] The SCCB module is used to configure and initialize the camera.
[0033] The pixel mapping module is used to map the grayscale pixel values at the same position of multiple groups of images collected by the acquisition system to the corresponding position of another image to form a new image.
[0034] (III) Beneficial effects
[0035] Compared with the prior art, the present invention provides a method for fusion-enhanced automobile surface defect detection based on multi-angle light sources, which has the following beneficial effects:
[0036] The present invention improves the limitations of traditional single-angle lighting detection methods, and at the same time greatly improves the accuracy and efficiency of automobile surface defect detection, effectively reduces the risks of missed detection and false detection in the process of automobile surface defect detection, and ensures that the automobile surface quality meets the standards. It has important practical significance and application prospects for automobile production and maintenance. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 A schematic diagram of a defect detection method used in an embodiment of the present invention;
[0038] Figure 2 It is a detection flow chart of a method for detecting automobile surface defects based on fusion enhancement of multi-angle light sources in an embodiment of the present invention;
[0039] Figure 3 The figure is an overall hardware block diagram of the defect detection method in an embodiment of the present invention. DETAILED DESCRIPTION
[0040] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0041] Example
[0042] See also Figure 1-3 An embodiment of the present invention provides a method for detecting automobile surface defects based on fusion enhancement of multi-angle light sources. The method specifically includes steps S1-S5:
[0043] S1: Acquire multiple images containing automobile surface defects from different lighting angles based on multi-angle light sources;
[0044] In S1, the image acquisition system based on multi-angle light source includes:
[0045] Multi-angle light source: A circular coaxial light source composed of eight groups of LED lights, which can achieve multi-angle lighting by lighting different LED light groups.
[0046] Industrial camera: The industrial camera is located in the center of the ring of multi-angle light source, passing through and perpendicular to the ring light source to realize image capture of defects.
[0047] In S1, during the image acquisition process, the multi-angle light source is controlled by combining DC dimming with group control to achieve precise control of the illumination angle and illumination intensity, thereby effectively enhancing the defect characteristics under different illumination conditions.
[0048] A trigger signal is sent through FPGA to a multi-angle light source system consisting of 8 groups of LED lights to switch the lighting of the LED light groups of the controllable multi-angle light source system, thereby providing lighting conditions for the surface of the area to be inspected. After each switching of the LED light group, the camera will perform an image acquisition operation on the area to be inspected.
[0049] S2: Extract grayscale pixel values from eight images with different illumination angles and set segmentation thresholds. Compare the grayscale pixel values with the segmentation thresholds to obtain defective pixel points.
[0050] In S2, after the camera completes the acquisition of images of the area to be inspected 8 times, in order to ensure the effectiveness of automobile surface defect detection, the acquired images containing defects are subjected to preprocessing steps such as image enhancement and filtering and denoising to eliminate the influence of irrelevant information in the images on the subsequent defect detection process.
[0051] For the pixels at the same position in the eight multi-angle illumination images, set the current pixel position to (i, j), extract the pixel grayscale values at the same pixel position in the eight multi-light source images to form the pixel feature vector X = [x1, x2, x3, x4, x5, x6, x7, x8] at the current pixel position, and set the segmentation threshold T d =255, for the pixel grayscale g(x,y)≥T in the detection area d The pixel point with grayscale g(x,y)<T in the detection area is considered as a defect point. d The pixel point is regarded as a normal point, and the expression formula is:
[0052]
[0053] S3: Subtract the grayscale pixel values at the same position of the eight images with different illumination angles from each other and compare them with the original pixel values to obtain defective pixel points, so as to reduce the effect of fixed background on defect detection.
[0054] In S3, in order to reduce the impact of the fixed background on the detection algorithm, the grayscale pixel values at the same position of the eight images with different illumination angles are subtracted and compared with the original pixel values to obtain the defective pixel point, and the current pixel position is set to (i, j). The pixel grayscale values at the same pixel position of the eight multi-light source images are extracted to form the pixel feature vector X = [x1, x2, x3, x4, x5, x6, x7, x8] at the current pixel position, where x i is the pixel value (0-255) in the i-th image, where x j is the pixel value (0-255) in the jth image, and the formula is expressed as:
[0055]
[0056] The defect image is then binarized to highlight the features of the defect.
[0057] S4: Fusing the defective pixels of the above two processes to obtain a complete defective pixel image.
[0058] In S4, the grayscale pixel value is compared with the segmentation threshold to obtain the defective pixel point, the grayscale pixel value of the defective pixel point and the grayscale pixel value of the same position in the image are subtracted from each other and compared with the original pixel value to obtain the defective pixel point for fusion, and a complete defective pixel image is obtained. The expression formula is:
[0059] g(x,y)=f(h(x,y)). (3)
[0060] Where g(x,y) is the target image, h(x,y) is the function, and f(x,y) is the source image.
[0061] S5: Process and optimize the detection method in the FPGA platform to improve the detection efficiency and obtain the final detection results of automobile surface defects.
[0062] See also Figure 3 , which is a hardware block diagram of a defect detection method in an embodiment of the present invention, and the method comprises the following steps:
[0063] In S5, after the entire system is powered on, the FPGA completes the initialization configuration of the camera by configuring the SCCB, the camera is turned on and the original image information of the car surface is collected, and the car surface image data containing defect information is passed through the SDRAM controller so that the collected image information flows into the image preprocessing module in an orderly manner. After the image preprocessing operation is completed, the car surface image data containing defect information enters the pixel mapping module to realize the process of defect recognition and defect difference fusion, and the final detection result image after fusion is generated by the defect image fusion module, and the processed final detection result image is displayed on the display through the display module.
[0064] A fast defect detection process is performed in the form of a hardware parallel architecture inside the FPGA, wherein each secondary path Skm in the hardware parallel architecture operates independently in a parallel manner. The implementation of the digital filter requires the sum of the product of the coefficients and the input, and each step in the sum can be regarded as a combination of multiplication and accumulation.
[0065] During the FPGA hardware implementation, the convolution operation is parallelized to perform structural optimization to achieve high-speed operation of automobile surface defect detection.
[0066] The embodiment of the present invention provides a method for automobile surface defect detection based on fusion enhancement of multi-angle light sources. To achieve this purpose, this technical solution collects automobile surface defect images by designing an image acquisition system based on controllable multi-angle light sources, and proposes a method for defect pixel fusion to process the collected images, and the method is accelerated and optimized by FPGA hardware, ultimately achieving efficient, reliable and accurate detection of automobile surface micro-defects.
[0067] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art can still modify the technical solutions described in the aforementioned embodiments or replace some of the technical features therein by equivalents. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for automobile surface defect detection based on fusion enhancement of multi-angle light sources, characterized in that: The following steps are included: S1: The image acquisition system based on multi-angle light source acquires eight images containing automobile surface defects from different lighting angles; S2: Extract grayscale pixel values from eight images with different illumination angles and set segmentation thresholds, and compare the grayscale pixel values with the segmentation thresholds to obtain defective pixel points; S3: Subtract the grayscale pixel values at the same position of eight images with different illumination angles from each other and compare them with the original pixel values to obtain defective pixel points; S4: Fusing the defective pixels from the above two processes to obtain a complete defective pixel image; S5: The above method is processed and optimized in the FPGA platform to improve the detection efficiency and obtain the final automobile surface defect detection results.
2. The method for automobile surface defect detection based on fusion enhancement of multi-angle light sources according to claim 1 is characterized in that: In S1, the image acquisition system based on multi-angle light source includes: Multi-angle light source: A circular coaxial light source composed of eight groups of LED lights, which can achieve multi-angle lighting by lighting up different LED light groups; Industrial camera: The industrial camera is located in the center of the ring of multi-angle light source, passing through and perpendicular to the ring light source to realize image capture of defects.
3. The method for automobile surface defect detection based on multi-angle light source fusion enhancement according to claim 1 is characterized in that: In S2, for the pixels at the same position in the eight multi-angle illumination images, the current pixel position is set to (i, j), the pixel grayscale values at the same pixel position in the eight multi-light source images are extracted to form the pixel feature vector X = [x1, x2, x3, x4, x5, x6, x7, x8] at the current pixel position, and the segmentation threshold T is set. d =255, for the pixel grayscale g(x,y)≥T in the detection area d The pixel point with grayscale g(x,y)<T in the detection area is considered as a defect point. d The pixel point is regarded as a normal point, and the expression formula is:
4. The method for automobile surface defect detection based on fusion enhancement of multi-angle light sources according to claim 1 is characterized in that: In S3, the grayscale pixel values at the same position of the eight images with different illumination angles are subtracted from each other and compared with the original pixel values to obtain defective pixels, the current pixel position is set to (i, j), and the pixel grayscale values at the same pixel position of the eight multi-light source images are extracted to form a pixel feature vector X = [x1, x2, x3, x4, x5, x6, x7, x8] at the current pixel position, where x i is the pixel value (0-255) in the i-th image, where x j is the pixel value (0-255) in the jth image, and the formula is expressed as:
5. The method for automobile surface defect detection based on fusion enhancement of multi-angle light sources according to claim 1 is characterized in that: In S4, the defective pixels of the above two processes are fused to obtain a complete defective pixel image, and the expression formula is: g(x,y)=f(h(x,y))(3) Where g(x,y) is the target image, h(x,y) is the function, and f(x,y) is the source image.
6. The method for automobile surface defect detection based on fusion enhancement of multi-angle light sources according to claim 1 is characterized in that: In S5, the above method is implemented through FPGA hardware, and a hardware parallel architecture is used inside the FPGA to perform rapid defect detection processing, wherein each secondary path Skm in the hardware parallel architecture runs independently in parallel, and the implementation of the digital filter requires the sum of the product of the coefficients and the input, and each step in the sum can be regarded as a combination of multiplication and accumulation.
7. The method for automobile surface defect detection based on fusion enhancement of multi-angle light sources according to claim 6 is characterized in that: In S5, the FPGA hardware implementation process uses the convolution operation parallelization method to perform structural optimization. The convolution operation parallelization process is as follows: (1) Matrix partitioning: For larger arrays in the convolutional layer, in order to increase the parallelism of data access, they are split into multiple smaller arrays. The partitioning is performed through the ARRAY_PARTITION command in HLS. This instruction can divide the matrix into several small registers, thereby improving the parallelism of operations. (2) Pipelining: split an operation that requires a relatively large delay into multiple small operations to be executed in parallel, thereby improving the execution speed of the hardware end. In HLS, the PIPELINING and UNROLL optimization instructions are used to implement this. In one clock cycle, the three dot product numbers are first stored in their three registers respectively, and then the multipliers and adders are used for calculation. In each clock cycle, three new dot product operands are extracted from registers A1~A3 and B1~B3, and the multipliers and adders are used for parallel calculation. The calculation process is composed of many register stages. During the calculation, there is no need to wait for the current calculation to be completed, but to continue to extract the memory in the next clock cycle and create a data processing pipeline.
8. The method for automobile surface defect detection based on fusion enhancement of multi-angle light sources according to claim 7 is characterized in that: In the S5, the FPGA platform mainly includes the following modules: Multi-angle light source module, used to provide lighting conditions at different angles; An image acquisition module is used to acquire images of the object to be detected under multi-angle light source conditions; SCCB module, used to configure and initialize the camera; The pixel mapping module is used to map the grayscale pixel values at the same position of multiple groups of images collected by the acquisition system to the corresponding position of another image to form a new image.
Citation Information
Cited By
ZYNQ-based large-format object surface defect detection method, device and system
CN119666851A
