Automatic detection device and method for automobile windshield spot defects

Through machine vision technology and improved YOLOv5s algorithm, combined with PLC control and industrial camera movement, efficient and accurate detection of spot defects in the automotive windshield is achieved, solving the problem of difficult detection in the existing technology and meeting the requirements of industrial production lines.

CN115791617BActive Publication Date: 2025-09-02FUJIAN UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211468756.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-22
Publication Date
2025-09-02
Estimated Expiration
2042-11-22

AI Technical Summary

Technical Problem

The prior art is difficult to efficiently and accurately detect the defects of the car windshield flower spots, especially due to the diversity of the flower spot patterns and the small area, the detection difficulty is high, the manual detection efficiency is low, and the accuracy of the machine vision detection algorithm is difficult to improve.

Method used

Using machine vision technology combined with PLC control, image acquisition is collected through industrial cameras along the outline trajectory of flower dots, and defect detection is performed using the improved YOLOv5s algorithm, including the CBAM attention module and the CSi-YOLOv5s model of SiLU activation function, to realize online automatic detection of flower dots.

Benefits of technology

It improves the accuracy and robustness of flower point defect detection, reduces hardware costs, and realizes complete collection of flower point patterns around large-area glass and clear collection of tiny defects, meeting the inspection requirements of industrial production lines.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115791617B_ABST
    Figure CN115791617B_ABST
Patent Text Reader

Abstract

The present invention discloses an automatic detection device and method for automotive windshield grain defects, comprising a host computer, a programmable logic controller (PLC), a support frame, and a single-axis slide drive module. The single-axis slide drive module is disposed on top of the support frame and is arranged perpendicular to the transmission direction of the production line. The single-axis slide drive module is connected to two spaced-apart industrial cameras, which are driven to move synchronously by the single-axis slide drive module. The single-axis slide drive module is controlled by a programmable logic controller (PLC), and the two industrial cameras and the PLC are electrically connected to the host computer. The present invention can achieve clear capture of images of automotive windshield grain defects and online automatic detection of grain defects, thereby replacing manual inspection, solving the problem of real-time online detection of windshield grain pattern printing and drying quality, and achieving the detection accuracy required by industrial production lines.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention is applied to the technical field of automobile glass production, and in particular relates to an automatic detection device and method for automobile windshield flower point defects. Background Art

[0002] During the screen printing and drying process of dot patterns, defects such as sticking, incompleteness, and missing dots are inevitable. These defects are caused by factors such as screen damage, mesh enlargement, mesh clogging, and uneven high-temperature sintering. Not only are dot defects tiny, but the dot patterns on different models of automotive glass vary (as evidenced by the diverse arrangement, number of layers, and density of the dots, as well as the varying shading at the interface between black and white backgrounds), making automatic detection of dot defects challenging. Furthermore, because automotive windshields are large (approximately 1.5m x 0.8m) and dot sizes are relatively small (maximum diameter per dot, 1.0mm, minimum diameter per dot), it is crucial to clearly capture dot defects while minimizing the hardware cost of the image acquisition system.

[0003] At present, the automotive windshield spot defect detection technology mainly includes the following three types:

[0004] 1. Manual inspection: The presence of a dot pattern on a car's windshield is determined by the naked eye. Problems with manual inspection include high labor costs and low efficiency. To highlight the dot pattern, inspectors must work under strong lighting for extended periods, causing eye fatigue and prone to false and missed detections. This results in individual data variability and makes collection and analysis difficult.

[0005] ② Characteristic parameter detection technology: This technology uses the glass's transmittance, refractive index, and surface stress to detect whether the glass is coated, the glass's material, and the degree of tempering. This technology is currently primarily used to detect the type and quality of glass and cannot be used to detect spots on finished automotive glass.

[0006] ③ Machine vision inspection technology: Detecting defects on the glass surface is accomplished through image preprocessing, segmentation, and comparison algorithms. This requires preparing a set of dot pattern comparison templates for each model of automotive glass, and complex image preprocessing is also required. Furthermore, because each black dot in the dot pattern is very small, the defects it presents are also relatively small, further increasing the difficulty of detecting dot defects and making it difficult to improve the accuracy of traditional detection algorithms. Summary of the Invention

[0007] In order to overcome the shortcomings of the existing technology, the purpose of the present invention is to provide an automatic detection device and method for automobile windshield spot defects, so as to realize clear acquisition of automobile windshield spot defect images and online automatic detection of spot defects, so as to replace manual detection, solve the real-time online detection problem of windshield spot pattern printing and drying quality, and achieve the detection accuracy required by industrial production lines.

[0008] To achieve the above object, the present invention adopts the following technical solutions:

[0009] An automatic detection device for flower point defects on automobile windshields includes a host computer, a PLC, a support frame and a single-axis slide rail drive module. The support frame is erected directly above the production line, the single-axis slide rail drive module is arranged on the top of the support frame, and the single-axis slide rail drive module is arranged perpendicular to the transmission direction of the production line. The single-axis slide rail drive module is connected to two industrial cameras set at intervals, and the two industrial cameras are driven to move synchronously by the single-axis slide rail drive module. The single-axis slide rail drive module is controlled by a PLC. The two industrial cameras and the PLC are electrically connected to the host computer respectively. The automobile windshield moves with the production line to below the shooting area of ​​the two industrial cameras, and the two industrial cameras transmit the captured images to the host computer.

[0010] Furthermore, the power source of the single-axis slide rail drive module is a stepper motor, and the stepper driver connected to the stepper motor is electrically connected to the PLC.

[0011] Furthermore, the distance between the two industrial cameras is 50 cm.

[0012] Furthermore, a plurality of strip-shaped light sources are arranged on the production line and within the shooting areas of the two industrial cameras, and each strip-shaped light source is placed between two adjacent rollers on the production line.

[0013] Furthermore, a light shield is fixed on the support frame and located above the shooting areas of the two industrial cameras.

[0014] The present invention adopts the detection method of the above-mentioned automatic detection device, which is characterized in that it includes the following steps:

[0015] 1) Generation of dot pattern shooting trajectory:

[0016] 1.1) Preprocessing of the image to be tested

[0017] In the host computer, remove irrelevant information;

[0018] 1.2) Extracting the outline of a single layer of dots

[0019] First, use cv.RETR_EXTERNAL and cv.findContours in the function

[0020] The cv2.CHAIN_APPROX_SIMPLE two parameters are used to set the range of the redundant flower dot outlines to be removed, and then the cv2.drawContours function is used to draw the outline of the black and white boundary shading that is finally retained to obtain the single-layer flower dot outline;

[0021] 1.3) Generate camera motion control trajectory

[0022] After obtaining the outline of a single layer of flower dots, the Canny operator is used to extract the edge of the outline of the single layer of flower dots, and then the HoughLinesP function is used to generate the camera movement trajectory curve;

[0023] 1.4) Determination of camera motion control parameters

[0024] By moving two industrial cameras at a constant speed, the moving direction and distance of the two industrial cameras can be determined by calculating the X-coordinate deviation of the pixels at the start and end points of the trajectory, as shown in formula (1):

[0025]

[0026] Where, X s is the X coordinate value of the starting point of the trajectory; e is the X coordinate value of the end point of the trajectory; D ir D is a variable that controls the direction of camera movement. When it is 1, it controls the motor to rotate forward and drive the camera to the right. When it is -1, it controls the motor to rotate backward and drive the camera to the left. is B is the camera movement distance variable; lo Segmentation variables for camera movement;

[0027] When the X-coordinate deviation of the trajectory start and end points is within 65 pixels, there is no need to adjust the positions of the two industrial cameras. When the X-coordinate deviation of the trajectory start and end points is greater than 195 pixels, the movement of the two industrial cameras is controlled in two steps, with each movement amount being half of the deviation value.

[0028] 1.5) Implementation of camera motion control

[0029] The PLC controls the movement of the two industrial cameras according to the camera movement trajectory curve. The two industrial cameras capture images in real time during the movement and transmit the images to the host computer;

[0030] 2) Detection of windshield spot defects

[0031] 2.1) Classification of dot patterns

[0032] The dot pattern on automotive glass has three characteristics: density of arrangement, number of layers, and shape of black dots. The density of arrangement is mainly divided according to three indicators: the distance between dots, the distance between the troughs of the ripples at the junction, and the distance between the dots and the trough. If any of these indicators is greater than 5 pixels, it is defined as sparse. The number of layers refers to the number of layers of black dots in the pattern. The shape of the black dots refers to whether the black dots that make up the dot pattern are square or circular. The three dot characteristics are used to name and classify the dot patterns to be detected. Three representative dot styles are selected to create a dot defect image dataset. After the dot defect image dataset is fed into the YOLOv5s model training, a detection model of the YOLOv5s algorithm is generated.

[0033] 2.2) Integration of CBAM, SiLU function and YOLOv5s

[0034] The CBAM attention module is embedded into the detection model of the YOLOv5s algorithm. At the same time, the Leaky ReLU function in the detection model of the YOLOv5s algorithm is replaced with the SiLU function, finally forming the CSi-YOLOv5s model.

[0035] 2.3) Flower point defect detection process

[0036] The CSi-YOLOv5s model uses Mosaic data augmentation in the input of the flower defect image and adaptively scales it to 608×608. The backbone model then upsamples the image twice to produce a 19×19 feature map, and then upsamples it once to produce 38×38 and 76×76 feature maps. These three feature maps of different sizes are fused in the neck to infer the presence of defects in the flower defect image, as well as the defect type and location.

[0037] 2.3) Detection results of flower point defects

[0038] The trained CSi-YOLOv5s model can accurately identify the type and location of defects in the flower dot images to be tested and mark them. Flower dot defects are divided into three categories: adhesion, missing, and incomplete. They are marked as "adhesions," "hiatus," and "incomplete" in the label data of the test results, respectively.

[0039] Furthermore, in step 1.3), the relevant parameters for generating the camera movement trajectory curve using the HoughLinesP function are set as follows: the line segment pixel distance accuracy value rho is 1.0, the line segment arc angle accuracy theta = numpy.pi / 180, numpy.pi represents pi, the threshold parameter value threshod of the accumulation plane is 25, the straight line length threshold minLineLength is 20, and the maximum line segment allowed interval value MaxLineGap is 11.

[0040] The present invention adopts the above technical solution and has the following beneficial technical effects:

[0041] The detection device of the present invention uses machine vision technology to extract the outline of the dot pattern, and then uses a PLC to control two industrial cameras to move along the outline trajectory, thereby realizing block-by-block acquisition of the dot pattern on the four black edges of the windshield, so as to obtain a clear image of the tiny dot; finally, the CSi-YOLOv5s algorithm is used in the host computer to realize online detection of the type and location of the dot defect, and effectively improve the detection accuracy.

[0042] The detection method of the present invention adds the attention mechanism CBAM to the YOLOv5s model and improves the activation function SiLU. The constructed CSi-YOLOv5s model improves the accuracy and robustness of windshield spot defect detection; uses image masks, Canny operators, HoughLinesP functions, etc. to generate camera movement trajectories, and combines PLC control technology to achieve accurate control of the industrial camera movement trajectory; designs a new image acquisition system, adopts a dual-camera shooting mode, and adjusts the positions of the two industrial cameras in real time, solving the problems of complete acquisition of black-edged spot patterns around large-area windshields and clear acquisition of tiny defect information. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments;

[0044] Figure 1 It is a structural diagram of the automatic detection device of the present invention;

[0045] Figure 2 A simplified block diagram of the automatic detection device of the present invention;

[0046] Figure 3 This is the flow chart of the image preprocessing algorithm;

[0047] Figure 4 It is a single-layer flower dot outline map;

[0048] Figure 5 It is the camera movement trajectory curve graph;

[0049] Figure 6 is the camera motion control graph;

[0050] Figure 7 These are three groups of representative dot pattern images;

[0051] Figure 8 This is a comparison diagram of the module structure before and after CBL improvement;

[0052] Figure 9 This is the detection result diagram of flower point defect. DETAILED DESCRIPTION

[0053] like Figure 1-2 As shown, the present invention provides an automatic detection device for flower point defects of automobile windshields, including a host computer 5, a PLC6, a support frame 2 and a single-axis slide rail drive module 3. The support frame 2 is erected directly above the production line 1, the single-axis slide rail drive module 3 is arranged on the top of the support frame 2, and the single-axis slide rail drive module 3 is arranged perpendicular to the transmission direction of the production line 1. Two industrial cameras 4 are connected to the single-axis slide rail drive module 3 and are driven to move synchronously by the single-axis slide rail drive module 3. The single-axis slide rail drive module 3 is controlled by PLC6. The two industrial cameras 4 and PLC6 are electrically connected to the host computer 5 respectively. The automobile windshield moves with the production line 1 to below the shooting area of ​​the two industrial cameras 4, and the two industrial cameras 4 transmit the captured images to the host computer 5.

[0054] The power source of the single-axis slide rail driving module 3 is a stepper motor 31 , and the stepper driver 8 connected to the stepper motor 31 is electrically connected to the PLC 6 .

[0055] A plurality of strip-shaped light sources 7 are arranged on the production line 1 and within the shooting areas of the two industrial cameras 4 . Each strip-shaped light source 7 is placed between two adjacent rollers of the production line 1 .

[0056] A light shield (not shown in the figure) is fixed on the support frame 2 and located above the shooting areas of the two industrial cameras 4.

[0057] The present invention adopts machine vision technology to extract the outline of the dot pattern; then uses PLC6 to control two industrial cameras 4 to move along the outline trajectory, thereby realizing block acquisition of the dot pattern on the four black edges of the windshield, so as to obtain a clear image of the tiny dot; finally, the CSi-YOLOv5s algorithm is used in the host computer 5 to realize online detection of the type and location of the dot defect.

[0058] To keep pace with the movement of production line 1, ensure clarity of the dot image, and reduce the hardware cost of the image acquisition system, the present invention employs two industrial cameras 4 with a resolution of 2592*2048 to capture the dot pattern in sections. To ensure that the two industrial cameras 4 capture the complete dot pattern on all four sides of the glass during movement, the PLC 6, stepper driver 8, and single-axis slide drive module 3 adjust the shooting position of the two industrial cameras 4.

[0059] During the screen printing and sintering stages, the windshield is still a flat glass, so the industrial camera 4 in the present invention does not need to move up and down; the production line 1 will move forward with the car windshield, so the industrial camera 4 does not need to move forward and backward, but only needs to move left and right (such as Figure 1 Indicated by the double arrows in the middle. The detection device uses a single-axis slide drive module 3 to simultaneously drive two industrial cameras 4. The two cameras 4 are separated by 50 cm to ensure that their fields of view cover the width of the car windshield (sides A and C), with an overlap of 2 to 3 cm. A strip light source and bottom backlighting are used, and a light shield is placed above the capture area to avoid reflections and flare, effectively preventing extraneous light from affecting the quality of the dot pattern acquisition.

[0060] Since the curvatures of the two black edge patterns B and D on the car windshield are similar, the movement directions of the two industrial cameras 4 are always consistent during the shooting process (either moving to the left or moving to the right together). Therefore, the present invention extracts the dot outline of the B edge as the movement trajectory of the two cameras.

[0061] The detection method of the present invention comprises the following steps:

[0062] 1) Generation of dot pattern shooting trajectory;

[0063] 1.1) Preprocessing of the image to be tested

[0064] In the host computer, irrelevant information is removed to improve image quality and simplify calculation. The pre-processing algorithm flow of the image to be tested adopted by the present invention is as follows: Figure 3 As shown. Since the preprocessing algorithm is not the subject of the present invention, it will not be described in detail.

[0065] 1.2) Extracting the outline of a single layer of dots

[0066] The dot patterns on the windshield are all multi-layer contours. In order to remove the influence of multi-layer contours on trajectory generation, the present invention adopts the image mask method to remove redundant dot contours and only retains the shading at the junction of black and white to improve the accuracy of trajectory extraction. First, the two parameters cv.RETR_EXTERNAL (detect the outermost contour) and cv.CHAIN_APPROX_SIMPLE (compress elements in multiple directions and retain their end point coordinates) in the cv.findContours function are used to set the range of redundant dot contours to be removed. Then, the cv.drawContours function is used to draw the contour of the shading at the junction of black and white that is finally retained, thereby obtaining a single-layer dot contour. The result is shown as follows: Figure 4 shown.

[0067] 1.3) Generate camera motion control trajectory

[0068] After obtaining the outline of a single layer of flower dots, the Canny operator is used to extract the edge of the outline of the single layer of flower dots, and then the HoughLinesP function is used to generate the camera movement trajectory curve, such as Figure 5 To obtain a smooth and continuous fitting curve, the following parameters are set: the line segment pixel distance accuracy value rho is 1.0, the line segment arc angle accuracy theta = numpy.pi / 180, where numpy.pi represents pi, the cumulative plane threshold parameter threshod is 25, the line length threshold minLineLength is 20, and the maximum line segment gap value MaxLineGap is 11.

[0069] 1.4) Determination of camera motion control parameters

[0070] To capture the complete dot pattern, a PLC-controlled stepper motor is used to continuously adjust the camera's movement speed, direction, and distance. This method uses two industrial cameras to move at a constant speed of 50 mm / s. The movement direction and distance of the two industrial cameras can be determined by calculating the X-coordinate deviation of the pixels at the start and end points of the trajectory, as shown in Equation (1).

[0071]

[0072] Where, X s is the X coordinate value of the starting point of the trajectory; e is the X coordinate value of the end point of the trajectory; D ir D is a variable that controls the direction of camera movement. When it is 1, it controls the motor to rotate forward and drive the camera to the right. When it is -1, it controls the motor to rotate backward and drive the camera to the left. is B is the camera movement distance variable; lo Segmentation variable for camera movement.

[0073] Among them, when the X coordinate deviation of the trajectory start and end points is within 65 pixels (actual size is 10mm), there is no need to adjust the positions of the two industrial cameras. When the X coordinate deviation of the trajectory start and end points is greater than 195 pixels, in order to prevent the positions of the two industrial cameras from being adjusted too much at one time, causing the dot pattern to exceed the shooting range, the movement of the two industrial cameras will be controlled twice, with each movement amount being half of the deviation value. The regulations of the system X, Y coordinate axes and the trajectory start and end points are as follows Figure 6 As shown;

[0074] 1.5) Implementation of camera motion control

[0075] The PLC controls the movement of the two industrial cameras according to the camera movement trajectory curve. The two industrial cameras take real-time images during the movement and transmit the images to the host computer. In the present invention, the stepper motor rotates one circle to drive the synchronous belt to move 80mm, that is, the distance advanced by one pulse is 0.025mm. The stepper motor pulse frequency is 2000Hz. The actual size corresponding to each pixel is 0.154mm. The distance D that the camera needs to move each time can be calculated by formula (2). is The distance m is the number of pulses the PLC needs to send to the stepper motor.

[0076]

[0077] 2) Detection of windshield spot defects

[0078] The spots on car windshields are small in area and have a variety of patterns, making them difficult to detect. The traditional YOLOv5s detection algorithm has problems with insufficient accuracy and robustness when detecting spot pattern defects. In order to improve these two problems, the present invention adds an attention mechanism CBAM (Convolutional Block Attention Module) to the YOLOv5s network model, reconstructs the feature map of the spot defect image, highlights important information related to the defect in the spot feature map, and suppresses general information unrelated to the defect; at the same time, the activation function SiLU is used to further optimize the deep network training, and a new CSi-YOLOv5s windshield spot defect detection algorithm is designed.

[0079] 2.1) Classification of dot patterns

[0080] The dot pattern of automobile glass mainly includes three characteristics: the density of arrangement, the number of arrangement layers and the shape of black dots. The density of arrangement is mainly divided according to three indicators: the distance between dots, the distance between the troughs of the ripples at the junction and the distance between dots and the troughs. If any one of the indicators is greater than 5 pixels, it can be defined as a sparse arrangement. The number of arrangement layers refers to the number of layers of black dots in the pattern, such as 2 layers, 3 layers, etc. The shape of black dots refers to whether the black dots that make up the dot pattern are square or round. The present invention uses the above three dot features to name and classify the dot patterns that need to be detected, such as Figure 7 Shown are three of the more representative dot styles.

[0081] Selection Figure 7 The training and validation datasets were created using three representative dot patterns: sparse 2-layer circles, dense 6-layer circles, and sparse 2-layer squares. Data augmentation techniques (image flipping, angle rotation, and saturation change) were used to expand the sample size. A total of 1,933 dot defect image datasets were created and divided into training and validation sets in an 8:2 ratio, i.e., 1,546 images in the training set and 387 images in the validation set. The above dot defect image dataset was fed into the YOLOv5s model for training to generate the detection model of the YOLOv5s algorithm. To verify that the model trained with the above dataset is also applicable to defect detection of other types of dot patterns, a test set totaling 508 images was created using five other dot patterns: dense 2-layer circles, dense 3-layer circles, sparse 3-layer circles, sparse 4-layer circles, and sparse 4-layer squares.

[0082] 2.2) Integration of CBAM, SiLU function and YOLOv5s

[0083] The CBAM attention module is embedded into the detection model of the YOLOv5s algorithm. At the same time, the Leaky ReLU function in the detection model of the YOLOv5s algorithm is replaced with the SiLU function, finally forming the CSi-YOLOv5s model.

[0084] As a general lightweight attention module, CBAM can be seamlessly integrated into any CNN network architecture. The present invention embeds CBAM into the Conv layer of the CBL module after the Focus module of the CSi-YOLOv5s model to form a new Conv_CBAM layer. The CBAM attention module is integrated into the Backbone network, which is more conducive to the dimensionality reduction extraction and feature fusion of the flower point defect features. The CBL module before and after the improvement is as follows: Figure 8 shown.

[0085] The YOLOv5s model uses the Leaky ReLU activation function. However, the Leaky ReLU function suffers from issues such as non-differentiability at zero and non-smooth gradient descent. Furthermore, using different functions in different intervals prevents consistent predictions for positive and negative input values. This paper addresses this issue by using the SiLU function instead of the Leaky ReLU as the activation function.

[0086] The SiLU function (Sigmoid Weighted Liner Unit) is an upgraded version of the Sigmoid function. It solves the problem of gradient vanishing that the Sigmoid function is prone to, and also improves the situation of neuron necrosis under negative input. That is, when x<0, the activation function value is reduced by a certain proportion, thereby achieving the effect of optimizing deep network training.

[0087]

[0088] 2.3) Flower point defect detection process

[0089] The CSi-YOLOv5s model uses Mosaic data augmentation in the input of the flower spot defect image and adaptively scales it to 608×608. The backbone model then upsamples the image twice to produce a 19×19 feature map, and upsamples it once to produce 38×38 and 76×76 feature maps. These three feature maps of different sizes are fused in the neck region to infer the presence of defects, the type of defects, and their locations.

[0090] 2.4) Detection results of flower point defects

[0091] The trained CSi-YOLOv5s model can accurately identify the type and location of defects in the tested spot image and mark them out, such as Figure 9 Speck defects are mainly divided into three categories: adhesion, missing, and incomplete, which are marked as "adhesions", "hiatus", and "incomplete" in the label data of the detection results.

[0092] Table 1 shows the performance of YOLOv5s algorithm and current mainstream deep learning algorithms in flower point defect detection. Table 1 uses AP, mAP, t ave To evaluate the performance of the detection algorithm. Among them, AP refers to the detection accuracy, which can indirectly reflect the accuracy and recall of each type of defect; mAP (mean average precision) refers to the average detection accuracy; t ave Refers to the average detection time.

[0093] From the detection data in Table 1, we can see that the average detection accuracy mAP of the YOLOv5s algorithm can reach 93.60%, which is 7.3% higher than that of the Faster RCNN algorithm. ave In terms of detection speed, the detection time of YOLOv5s algorithm is only 21.9% of that of FasterRCNN algorithm. Compared with SSD algorithm, the average detection accuracy mAP of YOLOv5s algorithm is still 6.7% higher, and the average detection time is t ave It is 0.066s less and has better overall performance.

[0094] Table 1 Performance comparison of different deep learning detection algorithms

[0095]

[0096]

[0097] Note: The Faster RCNN detection algorithm is abbreviated as F-RCNN, and subsequent charts use this abbreviation.

[0098] Table 2 lists the performance of four YOLOv5s algorithms in different combinations in flower point defect detection. From the detection data in Table 2, we can see that the CSi-YOLOv5s model after adding the CBAM attention mechanism and the activation function SiLU has improved the adhesion AP value of flower point defect detection by 5.1%, the hiatus AP value by 4.9%, the incomplete AP value by 6.5%, and the mAP value by 5.5%. ave The time is shortened to 0.142 seconds. This shows that the improved YOLOv5s flower point defect detection algorithm has better performance and improves the accuracy of flower point defect detection.

[0099] Table 2 Comparison of detection performance of different combinations of YOLOv5s algorithms

[0100]

[0101] Table 3 lists the defect detection results for four additional untrained dot patterns using the YOLOv5s and improved CSi-YOLOv5s models. These test results show that the improved YOLOv5s algorithm improved detection accuracy for all groups of dot defects, with an average increase of 3.05% per group. It also showed improvements in missed and false detections of dot defects, but there were still significant areas of missed detection in some groups that needed improvement.

[0102] Table 3 Detection effect of CSi-YOLOv5s model

[0103]

[0104] The implementation of the present invention is described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are illustrative rather than limiting the present invention. Those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention, and they should all be covered by the scope of the claims and description of the present invention.

Claims

1. A detection method for an automatic detection device for automobile windshield spot defects, characterized by: The automatic detection device includes a host computer, a PLC, a support frame and a single-axis slide rail drive module. The support frame is installed directly above the production line. The single-axis slide rail drive module is located on the top of the support frame and is arranged perpendicular to the transmission direction of the production line. The single-axis slide rail drive module is connected to two industrial cameras set at intervals. The two industrial cameras are driven to move synchronously by the single-axis slide rail drive module. The single-axis slide rail drive module is controlled by a PLC. The two industrial cameras and the PLC are respectively electrically connected to the host computer. The car windshield moves with the production line to the bottom of the shooting area of ​​the two industrial cameras. The two industrial cameras transmit the captured images to the host computer. The detection method includes the following steps: 1) Generation of dot pattern shooting trajectory: 1.1) Preprocessing of the image to be tested In the host computer, remove irrelevant information; 1.2) Extracting the outline of a single layer of dots First, use the cv2.findContours function in the two parameters cv2.RETR_EXTERNAL and cv2.CHAIN_APPROX_SIMPLE to set the range of the redundant flower dot contours to be removed, and then use the cv2.drawContours function to draw the contour of the black and white junction that is finally retained, so as to obtain the single-layer flower dot contour; 1.3) Generate camera motion control trajectory After obtaining the outline of a single layer of flower dots, the Canny operator is used to extract the edge of the outline of the single layer of flower dots, and then the HoughLinesP function is used to generate the camera movement trajectory curve; 1.4) Determination of camera motion control parameters By moving two industrial cameras at a constant speed, the moving direction and distance of the two industrial cameras can be determined by calculating the X-coordinate deviation of the pixels at the start and end points of the trajectory, as shown in formula (1): Where, X s is the X coordinate value of the starting point of the trajectory; e is the X coordinate value of the end point of the trajectory; D ir D is a variable that controls the direction of camera movement. When it is 1, it controls the motor to rotate forward and drive the camera to the right. When it is -1, it controls the motor to rotate backward and drive the camera to the left. is B is the camera movement distance variable; lo Segmentation variables for camera movement; When the X-coordinate deviation of the trajectory start and end points is within 65 pixels, there is no need to adjust the positions of the two industrial cameras. When the X-coordinate deviation of the trajectory start and end points is greater than 195 pixels, the movement of the two industrial cameras is controlled in two steps, with each movement amount being half of the deviation value. 1.5) Implementation of camera motion control The PLC controls the movement of the two industrial cameras according to the camera movement trajectory curve. The two industrial cameras capture images in real time during the movement and transmit the images to the host computer; 2) Detection of windshield spot defects 2.1) Classification of dot patterns The dot pattern on automotive glass has three characteristics: density of arrangement, number of layers, and shape of black dots. The density of arrangement is mainly divided according to three indicators: the distance between dots, the distance between the troughs of the ripples at the junction, and the distance between the dots and the trough. If any of these indicators is greater than 5 pixels, it is defined as sparse. The number of layers refers to the number of layers of black dots in the pattern. The shape of the black dots refers to whether the black dots that make up the dot pattern are square or circular. Using these three characteristics, the dot patterns to be detected are named and classified. Three representative dot styles are selected to create a dot defect image dataset. After the dot defect image dataset is fed into the YOLOv5s model training, a detection model of the YOLOv5s algorithm is generated. 2.2) Integration of CBAM, SiLU function and YOLOv5s The CBAM attention module is embedded into the detection model of the YOLOv5s algorithm. At the same time, the Leaky ReLU function in the detection model of the YOLOv5s algorithm is replaced with the SiLU function, finally forming the CSi-YOLOv5s model. 2.3) Flower point defect detection process The CSi-YOLOv5s model uses Mosaic data augmentation in the input of the flower defect image and adaptively scales it to 608×608. The backbone model then upsamples the image twice to produce a 19×19 feature map, and then upsamples it once to produce 38×38 and 76×76 feature maps. These three feature maps of different sizes are fused in the neck to infer the presence of defects in the flower defect image, as well as the defect type and location. 2.4) Detection results of flower point defects The trained CSi-YOLOv5s model can accurately identify and label the types and locations of defects in the tested flower dot images. Flower dot defects are divided into three categories: adhesion, missing, and incomplete. These are marked as "adhesions," "hiatus," and "incomplete" in the test result labels, respectively.

2. The detection method of the automatic detection device for automobile windshield spot defects according to claim 1, characterized in that: The power source of the single-axis slide rail drive module is a stepper motor, and the stepper driver connected to the stepper motor is electrically connected to the PLC.

3. The detection method of the automatic detection device for automobile windshield spot defects according to claim 1 is characterized in that: The distance between the two industrial cameras is 50 cm.

4. The detection method of the automatic detection device for automobile windshield spot defects according to claim 1 is characterized in that: A plurality of strip-shaped light sources are arranged on the production line and within the shooting areas of the two industrial cameras, and each strip-shaped light source is placed between two adjacent rollers on the production line.

5. The detection method of the automatic detection device for automobile windshield spot defects according to claim 1 is characterized in that: A light shield is fixed on the support frame and located above the shooting areas of the two industrial cameras.

6. The detection method of the automatic detection device for automobile windshield spot defects according to claim 1, characterized in that: In step 1.3), the relevant parameters for generating the camera movement trajectory curve using the HoughLinesP function are set as follows: the line segment pixel distance accuracy value rho is 1.0, the line segment arc angle accuracy theta = numpy.pi / 180, where numpy.pi represents pi, the threshold parameter value threshod of the accumulation plane is 25, the straight line length threshold minLineLength is 20, and the maximum line segment gap value MaxLineGap is 11.

Citation Information

Patent Citations

  • Quick detection device and method for defect of glass surface line

    CN110376475A

  • Automatic detection device for flower spot defects of automobile windshield

    CN218938110U