Door assembly welding defect detection method and device based on contour perception

Through the door assembly welding defect detection method based on contour perception, the overall length and shape characteristics of the contour line are combined with machine learning model, the complexity and low efficiency in door assembly welding defect detection are solved, and the door assembly welding is achieved Fast and accurate quality inspection of defects.

CN118781101BActive Publication Date: 2024-11-22武汉瑞普汽车部件有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411245131.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-06
Publication Date
2024-11-22
Estimated Expiration
2044-09-06

AI Technical Summary

Technical Problem

The existing welding defect detection technology has problems such as complex operation, high cost, low detection efficiency, poor detection ability for depth defects and not suitable for irregular welds in the door assembly, especially the visual inspection method on complex parts. The application effect is not good.

Method used

The door assembly welding defect detection method based on contour perception is adopted. By obtaining the welding area image, weld edges are detected, the outer and inner contour lines are extracted, the total length and shape characteristics of the contour lines are calculated, and the quality inspection is carried out in combination with the machine learning model is carried out. Length and similarity thresholds are used to determine welding quality, and weld grid characteristic terms are processed in segments to improve detection efficiency.

Benefits of technology

It realizes rapid and accurate quality inspection of door assembly welding defects, improves detection efficiency, and can efficiently identify defects of various weld types, ensures welding integrity and regularity, and avoids false inspections caused by different shapes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118781101B_ABST
    Figure CN118781101B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and device for detecting welding defects of a vehicle door assembly based on contour perception, and relates to the technical field of visual detection of welding defects. The present invention divides visual quality inspection into two parts: a contour feature item to be detected and a welding area feature item to be detected. The difference between the total length of the contour line and the total length of the standard contour line is less than a contour line length difference threshold before subsequent quality inspection can be performed; similarity comparison is used to implement shape feature quality inspection, so as to avoid false detection caused by different shapes but the same total length; quality inspection of the contour feature item to be detected can quickly screen out obviously unqualified welds and improve quality inspection efficiency; if the quality inspection of the contour feature item to be detected is qualified, quality inspection of the welding area feature item to be detected is required, and the welding area feature item to be detected first needs to be segmented according to the area width and divided into a plurality of weld grid feature items to be detected, which is more conducive to rapid quality inspection and can efficiently and accurately perform visual quality inspection on a plurality of different types of welds on the vehicle door assembly.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of welding defect visual detection, and in particular to a method and device for detecting welding defects of a vehicle door assembly based on contour perception. Background Art

[0002] Door assembly welding defect detection is an important part of ensuring the door assembly welding quality. It involves the strength and durability of the door assembly, which in turn affects the performance of the entire product.

[0003] The welding quality of the door assembly is usually tested by ultrasonic testing, X-ray testing, magnetic particle testing and other means to detect welding defects. All of the above testing methods have defects. Ultrasonic testing has high technical requirements for the operator; it is difficult to detect defects parallel to the propagation direction of the ultrasonic wave; it is sensitive to the surface state of the material and requires a coupling agent; X-ray testing equipment is expensive and complicated to operate; there is a radiation risk to the operator and the environment; the detection efficiency is low; magnetic particle testing is only applicable to magnetic materials; it is difficult to detect defects with a large depth; and the surface coating needs to be cleaned.

[0004] There are also methods of quality inspection of weld defects using visual inspection. The Chinese invention patent with publication number CN110751604A discloses an online detection method for steel pipe weld defects based on machine vision. First, the acquired steel pipe image is preprocessed, and then the gradient amplitude matrix and gradient direction matrix are obtained using the gradients in the horizontal and vertical coordinate directions. Then, the image after non-maximum suppression is subjected to regional growth to obtain edge chains. Finally, it is verified whether these edge chains are real weld defects and the defect information is calculated. Online weld quality inspection can be achieved. When this online detection method is applied to welding inspection of complex parts, especially door assemblies, it is not suitable for quality inspection of door assembly welding quality because the welds of door assemblies are irregular, there are many welding positions, and different welding positions need to be realized separately in order to install different parts. Summary of the invention

[0005] In order to solve the technical problem of quality inspection of welding defects of different welds of door assemblies, the present invention provides a method and device for detecting welding defects of door assemblies based on contour perception. The following technical solutions are adopted:

[0006] The door assembly welding defect detection method based on contour perception includes the following steps:

[0007] Step 1, using a door assembly welding image acquisition device to acquire a door assembly welding area image;

[0008] Step 2, preprocessing the image of the door assembly welding area to obtain an image to be processed;

[0009] Step 3, using an edge detection algorithm to detect the edges on both sides of the weld of the image to be processed;

[0010] Step 4, using a contour search algorithm to extract two contour lines of the edges on both sides, the two contour lines are an outer contour line and an inner contour line;

[0011] Step 5, respectively extracting two contour lines as contour feature items to be detected, and extracting the welding area between the two contour lines as the welding area feature item to be detected;

[0012] Step 6, for the contour feature item to be detected, respectively calculate the total length of the outer contour line and the inner contour line, calculate the outer contour line difference value between the total length of the outer contour line and the total length of the standard outer contour line, calculate the inner contour line difference value between the total length of the inner contour line and the total length of the standard inner contour line, set the contour line length difference threshold, if the outer contour line difference value and or the inner contour line difference value is greater than the contour line length difference threshold, then the contour feature item to be detected is judged to be unqualified, otherwise it is judged to be qualified;

[0013] Step 7, if step 6 is judged as qualified, then the shape features of the outer contour and the inner contour are extracted by using the line feature extraction algorithm respectively, the outer contour similarity and the inner contour similarity are calculated based on the standard outer contour shape feature and the standard inner contour shape feature respectively, and the contour similarity threshold is set. If the outer contour similarity and or the inner contour similarity is greater than the similarity threshold, then the contour feature item to be detected is judged to be unqualified, otherwise it is judged to be qualified;

[0014] Step 8. If step 7 is judged to be qualified, the characteristic items of the welding area to be detected are detected, and the welding area to be detected is segmented according to the area width, divided into multiple weld mesh feature items to be detected, and the multiple weld mesh feature items to be detected are amplified respectively. The amplified multiple weld mesh feature items to be detected are respectively input into the trained machine learning model, and the machine learning model outputs the detection results of the characteristic items of the welding area to be detected.

[0015] By adopting the above technical scheme, the welds of different welding parts are photographed. Before photographing, the weld skin should be removed and the welding area should be cleaned. Images of different welding parts are taken and used as images of welding areas of multiple door assemblies for separate quality inspection. The images are preprocessed first to make the images more standard for subsequent quality inspection. The visual quality inspection is divided into two parts: the contour feature item to be detected and the welding area feature item to be detected. The contour feature item to be detected uses the total length and shape features for quality inspection, where the total length represents the length of the weld. For different welding positions, the standard weld length can reflect the welding integrity and regularity. The subsequent quality inspection can only be carried out when the difference between the total length of the contour line and the total length of the standard contour line is less than the contour line length difference threshold, otherwise the quality inspection result of unqualified quality inspection is directly output. The contour line length difference threshold can be determined according to the standard contour line total length. For example, the contour line length difference threshold is one thousandth of the standard contour line total length. If one thousandth of the standard contour line total length is greater than 0.1 mm, and 0.1 mm is taken;

[0016] The quality inspection of shape features is implemented by similarity comparison. Through similarity comparison, the shape of the weld can be determined to avoid false detection due to different shapes but the same total length. The quality inspection of the contour feature items to be detected can quickly screen out obviously unqualified welds and improve the efficiency of quality inspection.

[0017] If the quality inspection of the contour feature items to be detected is qualified, it is necessary to carry out quality inspection of the feature items of the welding area to be detected. The feature items of the welding area to be detected need to be segmented according to the area width first, and divided into multiple weld grid feature items to be detected. In this way, multiple square-like weld grid feature items to be detected can be formed, which is more conducive to rapid quality inspection and provides multiple training materials for the machine learning model. The multiple weld grid feature items to be detected are amplified respectively. The amplification can be performed based on the set magnification factor. The amplified weld grid feature items to be detected can better identify welding defects. Finally, based on the machine learning model, batch visual quality inspection can be carried out, which can efficiently and accurately perform visual quality inspection on multiple different types of welds on the door assembly.

[0018] Optionally, in step 2, preprocessing of the door assembly welding area image includes grayscale, denoising and binarization operations.

[0019] By adopting the above technical solution, the image of the welding area of ​​the door assembly is first preprocessed, including grayscale, denoising, binarization and other operations, so as to better extract contour information.

[0020] Optionally, in step 3, the edges on both sides of the weld of the image to be processed are detected by using a Canny algorithm or a Sobel detection operator to detect edges.

[0021] Optionally, in step 6, the extracted contour is analyzed and the method for calculating the contour length is:

[0022] Iterate over all points of the contour, calculate the distances between adjacent points, and add up these distances to get the total length of the contour.

[0023] Optionally, in step 6, the total length of the contour Calculated by the following formula:

[0024] ;

[0025] in, is the number of points on the contour, and are two adjacent points. yes and The Euclidean distance between .

[0026] By adopting the above technical solution, you can use the cv2.findContours function to extract contours from an image and the cv2.arcLength function to calculate the length of a single contour in Python and OpenCV environments. The calculate_contour_length function accepts a contour as input and returns the length of the contour. cv2.findContours and cv2.arcLength are functions in the OpenCV library for contour detection and length calculation, which can greatly simplify the calculation process.

[0027] Optionally, in step 7, the method for calculating the similarity of two contour lines is: for each contour line, first calculate its geometric moment , and then use the geometric moment To calculate the Hu invariant moments ; The similarity is obtained by calculating the Euclidean distance between the Hu invariant moments of two contour lines.

[0028] By adopting the above technical solution, the geometric moment The calculation formula is as follows:

[0029] ;

[0030] in is the intensity of the contour point, usually 1 in a binary image, and is the order of the moment, and then the Hu invariant moment is calculated using the following formula :

[0031]

[0032] The similarity calculation can be obtained by calculating the Euclidean distance between the Hu invariant moments of two contour lines:

[0033] ;

[0034] The Hu invariant moment of the first contour line is , the Hu invariant moment of the second contour line is ,in It can be 0 to 7, corresponding to 7 different invariant moments. This formula calculates the sum of the squares of the differences between each corresponding component of the two Hu invariant moment vectors, and then takes the square root of these square sums to obtain the Euclidean distance. The smaller the Euclidean distance, the more similar the shapes of the two contours are; the larger the Euclidean distance, the greater the difference in the shapes of the two contours. In practical applications, in order to improve computational efficiency, usually only the Euclidean distances of the first few Hu invariant moments are calculated, because these moments contain most of the information for shape recognition.

[0035] Optionally, in step 8, the labeled data is used to train an SVM machine learning model. The SVM machine learning model is based on a vector machine decision function to determine the quality inspection results. The vector machine decision function is as follows:

[0036]

[0037] in It represents the classification function, which is used to predict the quality inspection category of the characteristic items of the welding area to be inspected. is the Lagrange multiplier, is the category label, and is the kernel function, It is used to calculate the similarity between the characteristic items of the welding area to be detected and the characteristics of the standard welding area to be detected. It is used to calculate the difference between the characteristic item of the welding area to be tested and the characteristic depth of the standard welding area to be tested. is the bias term.

[0038] By adopting the above technical solution, the vector machine decision function of the SVM machine learning model is adopted and Combined kernel function, where It is used to calculate the similarity between the characteristic items of the welding area to be detected and the characteristics of the standard welding area to be detected. It is used to calculate the depth difference between the characteristic items of the welding area to be tested and the characteristic depth of the standard welding area to be tested. The calculation of the depth difference is based on image recognition. The weld depth detection is implemented by image processing and pattern recognition technology. Edge tracking: Track along the edge to find the start and end points of the weld. Weld depth estimation: Image segmentation: Segment the image into weld area and non-weld area. Depth calculation: Use a deep learning model to estimate the depth of the weld. It can greatly improve the quality inspection requirements for weld details, and the output of qualified welds is closer to standard welds.

[0039] A door assembly welding defect detection device based on contour perception includes a door assembly welding image acquisition device and a quality inspection computer. The door assembly welding image acquisition device includes a shooting bracket and a visual camera. The visual camera is installed above the door assembly welding platform through the shooting bracket to shoot the image of the door assembly welding area after welding is completed. The quality inspection computer communicates with the visual camera to exchange the image of the door assembly welding area. The quality inspection computer is pre-installed with a quality inspection program designed using a door assembly welding defect detection method based on contour perception. The door assembly welding area image is input into the quality inspection program, and the quality inspection program outputs the quality inspection result.

[0040] A memory stores a quality inspection program designed using a door assembly welding defect detection method based on contour perception.

[0041] In summary, the present invention includes at least one of the following beneficial technical effects:

[0042] The present invention can provide a method and device for detecting welding defects of a door assembly based on contour perception, take photos of welds at different welding positions, remove the weld skin and clean the welding area before taking photos, take images of different welding positions, and perform quality inspections on multiple door assembly welding area images respectively, divide the visual quality inspection into two parts: a contour feature item to be detected and a welding area feature item to be detected, and the contour feature item to be detected uses total length and shape features for quality inspection, and the difference between the total length of the contour line and the total length of the standard contour line is less than the contour line length difference threshold before subsequent quality inspection can be performed;

[0043] The quality inspection of shape features is implemented by similarity comparison. Through similarity comparison, the shape of the weld can be determined to avoid false detection due to different shapes but the same total length. The quality inspection of the contour feature items to be detected can quickly screen out obviously unqualified welds and improve the efficiency of quality inspection.

[0044] If the quality inspection of the contour feature items to be detected is qualified, it is necessary to carry out quality inspection of the feature items of the welding area to be detected. The feature items of the welding area to be detected need to be segmented according to the area width first, and divided into multiple weld mesh feature items to be detected, which is more conducive to rapid quality inspection and provides multiple training materials for the machine learning model. The multiple weld mesh feature items to be detected are amplified respectively. The amplification processing can be performed based on the set magnification factor. The amplified weld mesh feature items to be detected can better identify welding defects. Finally, based on the machine learning model, batch visual quality inspection can be carried out, which can efficiently and accurately perform visual quality inspection on multiple different types of welds on the door assembly. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] Figure 1 It is a flow chart of a method for detecting welding defects of a door assembly based on contour perception of the present invention;

[0046] Figure 2 is an image of a welding area of ​​a vehicle door assembly according to a specific embodiment of the present invention;

[0047] Figure 3 2 is a schematic diagram of the detection results of the edges on both sides of the weld according to a specific embodiment of the present invention;

[0048] Figure 4 It is a schematic diagram of the result of extracting two contour lines of the two side edges according to a specific embodiment of the present invention. DETAILED DESCRIPTION

[0049] The present invention is further described in detail below in conjunction with the accompanying drawings.

[0050] The embodiments of the present invention disclose a method and a device for detecting welding defects of a vehicle door assembly based on contour perception.

[0051] Reference Figure 1 - Figure 4 Embodiment 1, a method for detecting welding defects of a door assembly based on contour perception, comprises the following steps:

[0052] Step 1, using a door assembly welding image acquisition device to acquire a door assembly welding area image;

[0053] Step 2, preprocessing the image of the door assembly welding area to obtain an image to be processed;

[0054] Step 3, using an edge detection algorithm to detect the edges on both sides of the weld of the image to be processed;

[0055] Step 4, using a contour search algorithm to extract two contour lines of the edges on both sides, the two contour lines are an outer contour line and an inner contour line;

[0056] Step 5, respectively extracting two contour lines as contour feature items to be detected, and extracting the welding area between the two contour lines as the welding area feature item to be detected;

[0057] Step 6, for the contour feature item to be detected, respectively calculate the total length of the outer contour line and the inner contour line, calculate the outer contour line difference value between the total length of the outer contour line and the total length of the standard outer contour line, calculate the inner contour line difference value between the total length of the inner contour line and the total length of the standard inner contour line, set the contour line length difference threshold, if the outer contour line difference value and or the inner contour line difference value is greater than the contour line length difference threshold, then the contour feature item to be detected is judged to be unqualified, otherwise it is judged to be qualified;

[0058] Step 7, if step 6 is judged as qualified, then the shape features of the outer contour and the inner contour are extracted by using the line feature extraction algorithm respectively, the outer contour similarity and the inner contour similarity are calculated based on the standard outer contour shape feature and the standard inner contour shape feature respectively, and the contour similarity threshold is set. If the outer contour similarity and or the inner contour similarity is greater than the similarity threshold, then the contour feature item to be detected is judged to be unqualified, otherwise it is judged to be qualified;

[0059] Step 8. If step 7 is judged to be qualified, the characteristic items of the welding area to be detected are detected, and the welding area to be detected is segmented according to the area width, divided into multiple weld mesh feature items to be detected, and the multiple weld mesh feature items to be detected are amplified respectively. The amplified multiple weld mesh feature items to be detected are respectively input into the trained machine learning model, and the machine learning model outputs the detection results of the characteristic items of the welding area to be detected.

[0060] Take photos of welds at different welding positions. Before taking photos, remove the weld skin and clean the welding area. Take images of different welding positions and use them as images of welding areas of multiple door assemblies for separate quality inspection. Preprocess the images first to make them more standard for subsequent quality inspection. Divide the visual quality inspection into two parts: the contour feature item to be detected and the welding area feature item to be detected. The contour feature item to be detected uses total length and shape features for quality inspection, where the total length represents the length of the weld. For different welding positions, the standard weld length can reflect the welding integrity and regularity. Subsequent quality inspection can only be performed when the difference between the total length of the contour line and the total length of the standard contour line is less than the contour line length difference threshold. Otherwise, the quality inspection result of unqualified quality inspection is directly output. The contour line length difference threshold can be determined based on the total length of the standard contour line. For example, the contour line length difference threshold is one thousandth of the total length of the standard contour line. If one thousandth of the total length of the standard contour line is greater than 0.1 mm, 0.1 mm is taken.

[0061] The quality inspection of shape features is implemented by similarity comparison. Through similarity comparison, the shape of the weld can be determined to avoid false detection due to different shapes but the same total length. The quality inspection of the contour feature items to be detected can quickly screen out obviously unqualified welds and improve the efficiency of quality inspection.

[0062] If the quality inspection of the contour feature items to be detected is qualified, it is necessary to carry out quality inspection of the feature items of the welding area to be detected. The feature items of the welding area to be detected need to be segmented according to the area width first, and divided into multiple weld grid feature items to be detected. In this way, multiple square-like weld grid feature items to be detected can be formed, which is more conducive to rapid quality inspection and provides multiple training materials for the machine learning model. The multiple weld grid feature items to be detected are amplified respectively. The amplification can be performed based on the set magnification factor. The amplified weld grid feature items to be detected can better identify welding defects. Finally, based on the machine learning model, batch visual quality inspection can be carried out, which can efficiently and accurately perform visual quality inspection on multiple different types of welds on the door assembly.

[0063] In Example 2, in step 2, the image preprocessing of the welding area of ​​the door assembly includes graying, denoising and binarization operations.

[0064] Firstly, the image of the welding area of ​​the door assembly is preprocessed, including grayscale, denoising, binarization and other operations, so as to better extract the contour information.

[0065] In Example 3, in step 3, the edges on both sides of the weld of the image to be processed are detected by using the Canny algorithm or the Sobel detection operator.

[0066] In Example 4, in step 6, the extracted contour is analyzed and the method for calculating the contour length is:

[0067] Iterate over all points of the contour, calculate the distances between adjacent points, and add up these distances to get the total length of the contour.

[0068] Example 5, in step 6, the total length of the contour line Calculated by the following formula:

[0069] ;

[0070] in, is the number of points on the contour, and are two adjacent points. yes and The Euclidean distance between .

[0071] In Python and OpenCV environments, you can use the cv2.findContours function to extract contours from an image, and the cv2.arcLength function to calculate the length of a single contour. The calculate_contour_length function accepts a contour as input and returns the length of the contour. cv2.findContours and cv2.arcLength are functions in the OpenCV library for contour detection and length calculation, which can greatly simplify the calculation process.

[0072] The code is as follows:

[0073] import cv2

[0074] import numpy as np

[0075] # Assume that img is a grayscale image and the contour has been extracted by some method

[0076] contours=cv2.findContours(img,cv2.RETR_EXTERNAL,v2.CHAIN_APPROX_SIMPLE)[0]

[0077] # Calculate the length of a single contour

[0078] def calculate_contour_length(contour):

[0079] # Use cv2.arcLength function to calculate the contour length

[0080] length = cv2.arcLength (contour, True) #True means the contour is closed

[0081] return length

[0082] # Calculate the length of all contours

[0083] contour_lengths = [calculate_contour_length(contour) for contour incontours]

[0084] # Output contour length

[0085] for i, length in enumerate(contour_lengths):

[0086] print(f"Contour {i} length: {length}");

[0087] In step 7 of embodiment 6, the method for calculating the similarity of two contour lines is: for each contour line, first calculate its geometric moment , and then use the geometric moment To calculate the Hu invariant moments ; The similarity is obtained by calculating the Euclidean distance between the Hu invariant moments of two contour lines.

[0088] Geometric Moment The calculation formula is as follows:

[0089] ;

[0090] in is the intensity of the contour point, usually 1 in a binary image, and is the order of the moment, and then the Hu invariant moment is calculated using the following formula :

[0091]

[0092] The similarity calculation can be obtained by calculating the Euclidean distance between the Hu invariant moments of two contour lines:

[0093] ;

[0094] The Hu invariant moment of the first contour line is , the Hu invariant moment of the second contour line is ,in It can be 0 to 7, corresponding to 7 different invariant moments. This formula calculates the sum of the squares of the differences between each corresponding component of the two Hu invariant moment vectors, and then takes the square root of these square sums to obtain the Euclidean distance. The smaller the Euclidean distance, the more similar the shapes of the two contours are; the larger the Euclidean distance, the greater the difference in the shapes of the two contours. In practical applications, in order to improve computational efficiency, usually only the Euclidean distances of the first few Hu invariant moments are calculated, because these moments contain most of the information for shape recognition.

[0095] In Example 7, in step 8, the labeled data is used to train the SVM machine learning model. The SVM machine learning model is based on a vector machine decision function to determine the quality inspection results. The vector machine decision function is as follows:

[0096]

[0097] in It represents the classification function, which is used to predict the quality inspection category of the characteristic items of the welding area to be inspected. is the Lagrange multiplier, is the category label, and is the kernel function, It is used to calculate the similarity between the characteristic items of the welding area to be detected and the characteristics of the standard welding area to be detected. It is used to calculate the difference between the characteristic item of the welding area to be tested and the characteristic depth of the standard welding area to be tested. is the bias term.

[0098] Adopted in the vector machine decision function of the SVM machine learning model and Combined kernel function, where It is used to calculate the similarity between the characteristic items of the welding area to be detected and the characteristics of the standard welding area to be detected. It is used to calculate the depth difference between the characteristic items of the welding area to be tested and the characteristic depth of the standard welding area to be tested. The calculation of the depth difference is based on image recognition. The weld depth detection is implemented by image processing and pattern recognition technology. Edge tracking: Track along the edge to find the start and end points of the weld. Weld depth estimation: Image segmentation: Segment the image into weld area and non-weld area. Depth calculation: Use a deep learning model to estimate the depth of the weld. It can greatly improve the quality inspection requirements for weld details, and the output of qualified welds is closer to standard welds.

[0099] Embodiment 8, a door assembly welding defect detection device based on contour perception, includes a door assembly welding image acquisition device and a quality inspection computer, the door assembly welding image acquisition device includes a shooting bracket and a visual camera, the visual camera is installed above the door assembly welding platform through the shooting bracket, and captures the image of the door assembly welding area after welding is completed, the quality inspection computer communicates with the visual camera to exchange the image of the door assembly welding area, the quality inspection computer is pre-installed with a quality inspection program designed using a door assembly welding defect detection method based on contour perception, the door assembly welding area image is input into the quality inspection program, and the quality inspection program outputs the quality inspection result.

[0100] Embodiment 9, a memory storing a quality inspection program designed using a vehicle door assembly welding defect detection method based on contour perception.

[0101] The following is an explanation of the implementation principle of the door assembly welding defect detection method and device based on contour perception based on a specific embodiment:

[0102] Use the door assembly welding image acquisition device to acquire the door assembly welding area image, such as Figure 2 As shown:

[0103] Preprocess the image of the door assembly welding area to obtain the image to be processed;

[0104] The edge detection algorithm is used to detect the edges on both sides of the weld of the image to be processed, such as Figure 3 As shown;

[0105] Use the contour search algorithm to extract two contour lines on both sides of the edge, the two contour lines are the outer contour line and the inner contour line; Figure 4 As shown;

[0106] Extracting two contour lines as contour feature items to be detected respectively, and extracting a welding area between the two contour lines as a welding area feature item to be detected;

[0107] For the contour feature items to be detected, the total length of the outer contour line and the inner contour line is calculated respectively, the outer contour line difference value between the total length of the outer contour line and the standard outer contour line total length is calculated, and the inner contour line difference value between the total length of the inner contour line and the standard inner contour line total length is calculated. The contour line length difference threshold is set to 0.1mm. The outer contour line difference value between the total length of the outer contour line and the standard outer contour line total length is calculated to be 0.3mm. If it is greater than the contour line length difference threshold, it is directly judged that the welding is unqualified.

[0108] The above are all preferred embodiments of the present invention, and are not intended to limit the protection scope of the present invention. Therefore, any equivalent changes made based on the structure, shape, and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A door assembly welding defect detection method based on contour perception, characterized in that: The following steps are involved: Step 1, using a door assembly welding image acquisition device to acquire a door assembly welding area image; Step 2, preprocessing the image of the door assembly welding area to obtain an image to be processed; Step 3, using an edge detection algorithm to detect the edges on both sides of the weld of the image to be processed; Step 4, using a contour search algorithm to extract two contour lines of the edges on both sides, the two contour lines are an outer contour line and an inner contour line; Step 5, respectively extracting two contour lines as contour feature items to be detected, and extracting the welding area between the two contour lines as the welding area feature item to be detected; Step 6, for the contour feature item to be detected, respectively calculate the total length of the outer contour line and the inner contour line, calculate the outer contour line difference value between the total length of the outer contour line and the total length of the standard outer contour line, calculate the inner contour line difference value between the total length of the inner contour line and the total length of the standard inner contour line, set the contour line length difference threshold, if the outer contour line difference value and or the inner contour line difference value is greater than the contour line length difference threshold, then the contour feature item to be detected is judged to be unqualified, otherwise it is judged to be qualified; Step 7, if step 6 is judged as qualified, then the shape features of the outer contour and the inner contour are extracted by using the line feature extraction algorithm respectively, the outer contour similarity and the inner contour similarity are calculated based on the standard outer contour shape feature and the standard inner contour shape feature respectively, and the contour similarity threshold is set. If the outer contour similarity and or the inner contour similarity is greater than the similarity threshold, then the contour feature item to be detected is judged to be unqualified, otherwise it is judged to be qualified; Step 8. If step 7 is judged to be qualified, the characteristic items of the welding area to be detected are detected, and the welding area to be detected is segmented according to the area width, divided into multiple weld mesh feature items to be detected, and the multiple weld mesh feature items to be detected are amplified respectively. The amplified multiple weld mesh feature items to be detected are respectively input into the trained machine learning model, and the machine learning model outputs the detection results of the characteristic items of the welding area to be detected.

2. The method for detecting welding defects of a door assembly based on contour perception according to claim 1, characterized in that: In step 2, the image preprocessing of the door assembly welding area includes grayscale, denoising and binarization operations.

3. The method for detecting welding defects of a door assembly based on contour perception according to claim 2 is characterized in that: In step 3, the edges on both sides of the weld of the image to be processed are detected by using the Canny algorithm or the Sobel detection operator to detect the edge.

4. The method for detecting welding defects of a door assembly based on contour perception according to claim 3 is characterized in that: In step 6, the extracted contour is analyzed and the method for calculating the contour length is: Iterate over all points of the contour, calculate the distances between adjacent points, and add up these distances to get the total length of the contour.

5. The method for detecting welding defects of a door assembly based on contour perception according to claim 4 is characterized in that: In step 6, the total length of the contour Calculated by the following formula: ; in, is the number of points on the contour, and are two adjacent points. yes and The Euclidean distance between .

6. The method for detecting welding defects of a door assembly based on contour perception according to claim 5 is characterized in that: In step 7, the method for calculating the similarity of two contour lines is: for each contour line, first calculate its geometric moment , and then use the geometric moment To calculate the Hu invariant moments ; The similarity is obtained by calculating the Euclidean distance between the Hu invariant moments of two contour lines.

7. The method for detecting welding defects of a door assembly based on contour perception according to claim 6 is characterized in that: In step 8, the labeled data is used to train the SVM machine learning model. The SVM machine learning model judges the quality inspection results based on the vector machine decision function. The vector machine decision function is as follows: in It represents the classification function, which is used to predict the quality inspection category of the characteristic items of the welding area to be inspected. is the Lagrange multiplier, is the category label, and is the kernel function, It is used to calculate the similarity between the characteristic items of the welding area to be detected and the characteristics of the standard welding area to be detected. It is used to calculate the difference between the characteristic item of the welding area to be tested and the characteristic depth of the standard welding area to be tested. is the bias term.

8. A door assembly welding defect detection device based on contour perception, characterized in that: The invention comprises a vehicle door assembly welding image acquisition device and a quality inspection computer. The vehicle door assembly welding image acquisition device comprises a shooting bracket and a visual camera. The visual camera is installed above the vehicle door assembly welding platform through the shooting bracket to shoot the image of the vehicle door assembly welding area after welding is completed. The quality inspection computer communicates with the visual camera to exchange the image of the vehicle door assembly welding area. The quality inspection computer is pre-installed with a quality inspection program designed using the vehicle door assembly welding defect detection method based on contour perception as described in any one of claims 1 to 7. The image of the vehicle door assembly welding area is input into the quality inspection program, and the quality inspection program outputs the quality inspection result.

9. A memory, characterized in that: A quality inspection program designed using the door assembly welding defect detection method based on contour perception as described in any one of claims 1-7 is stored.