Defect detection method, device and equipment based on three-dimensional profile of welding bead and storage medium
By acquiring the three-dimensional contour data of the weld bead and extracting multi-dimensional features for comprehensive analysis, the problem of insufficient ability of existing weld bead detection methods to identify complex and minute defects is solved, and high-precision weld bead defect detection is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GUANGDONG LYRIC ROBOT INTELLIGENT AUTOMATION CO LTD
- Filing Date
- 2026-04-30
- Publication Date
- 2026-06-19
AI Technical Summary
Existing weld inspection methods are difficult to adapt to changes in different products and processes, and have limited ability to identify complex weld defects and minute defects, making them prone to missed or false detections.
By acquiring the three-dimensional contour data of the weld bead, multi-dimensional features including geometric features such as peak and valley features, curvature dispersion, local flatness, and contour symmetry are extracted. These features are then combined with preset thresholds and weights for comprehensive analysis to determine the welding quality.
It improves the accuracy and adaptability of weld defect detection, reduces the probability of missed and false detections, and can effectively identify complex and minute defects.
Smart Images

Figure CN122244129A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of industrial automation inspection technology, and in particular to a defect detection method, apparatus, equipment and storage medium based on the three-dimensional contour of weld beads. Background Technology
[0002] In industrial production, the quality of welds directly affects the safety and reliability of products. Traditional weld inspection mainly relies on manual visual inspection or 2D vision-based inspection methods, which can only obtain information about the weld surface and cannot detect internal height variations and three-dimensional defects.
[0003] Existing 3D inspection methods mostly use simple threshold judgments, which have limited ability to identify complex weld defects, making it difficult to adapt to changes in different products and processes. Furthermore, they lack the accuracy to detect tiny defects such as pinholes, making them prone to missed or false detections. Summary of the Invention
[0004] The purpose of this application is to at least solve one of the above-mentioned technical defects, in particular the technical defects of existing weld defect detection methods, which have limited ability to identify complex weld defects, are difficult to adapt to changes in different products and processes, and have insufficient detection accuracy for small defects such as pinholes, making them prone to missed or false detections.
[0005] This application provides a defect detection method based on the three-dimensional contour of weld beads, the method comprising:
[0006] Obtain the three-dimensional contour data of the current contour in the target weld bead;
[0007] Extract the curve features corresponding to the three-dimensional contour data, wherein the curve features include at least geometric morphological features;
[0008] The curve features are analyzed to determine the welding quality of the current contour.
[0009] Optionally, the geometric features include peak and valley features and curvature dispersion, and the extraction of curve features corresponding to the three-dimensional contour data includes:
[0010] The slope variation method is used to detect abnormal peaks and valleys in the three-dimensional contour data to obtain peak and valley features.
[0011] Calculate the curvature change of the three-dimensional contour data, and calculate the curvature dispersion based on the curvature change.
[0012] Optionally, the step of using the slope change method to detect abnormal peaks and valleys in the three-dimensional contour data to obtain peak-valley features includes:
[0013] Calculate the left and right slopes of each contour point in the three-dimensional contour data;
[0014] For each contour point, the left slope and right slope of the contour point are compared with the preset height change thresholds to obtain the comparison results;
[0015] Based on the comparison results, abnormal peaks and valleys in the three-dimensional contour data are determined to obtain peak-valley features.
[0016] Optionally, calculating the curvature change of the three-dimensional contour data and calculating the curvature dispersion based on the curvature change includes:
[0017] Calculate the first-order difference between each contour point in the three-dimensional contour data and the first preset number of contour points in front of it to obtain the slope of each contour point.
[0018] Calculate the second-order difference between the slope of each contour point and its adjacent contour points in the three-dimensional contour data to obtain the curvature of each contour point.
[0019] The standard deviation of curvature is calculated based on the curvature of all contour points, and this standard deviation is used as the curvature dispersion.
[0020] Optionally, the curve features may also include local flatness features, contour symmetry features, and the number of violent oscillations;
[0021] The extraction of curve features corresponding to the three-dimensional contour data includes:
[0022] Local flatness analysis is performed on the three-dimensional contour data to obtain local flatness characteristics;
[0023] The height difference between the left and right contours in the three-dimensional contour data is detected to obtain the contour symmetry feature;
[0024] The number of times the product of the slopes of two adjacent contour points in the three-dimensional contour data is less than zero is counted to obtain the number of violent oscillations.
[0025] Optionally, the step of performing local flatness analysis on the three-dimensional contour data to obtain local flatness features includes:
[0026] Multiple windows are obtained by sliding a window of a first preset window size on the three-dimensional contour data, wherein each window contains multiple consecutive contour points of the same size as the first preset window.
[0027] For each window, calculate the average height of all contour points within that window, and calculate the average of the squared deviations of the heights of each contour point within that window from the average height, to obtain the height variance of that window.
[0028] Calculate the average of the height variances of all windows to obtain the average local flatness, and use the average local flatness as a local flatness feature.
[0029] Optionally, detecting the height difference between the left and right contours in the three-dimensional contour data to obtain contour symmetry features includes:
[0030] Determine the central axis of symmetry of the three-dimensional contour data;
[0031] For each contour point to the left of the central axis of symmetry, obtain the symmetrical contour point at the symmetrical position on the right side of that contour point;
[0032] Calculate the absolute value of the height difference between each contour point and its symmetrical contour point, and calculate the average value of all the absolute values of height differences to obtain the symmetry index, which is then used as the contour symmetry feature.
[0033] Optionally, the curve features further include contour smoothness features, local slope change rate features, and contour convexity / concavity features;
[0034] The extraction of curve features corresponding to the three-dimensional contour data includes:
[0035] The smoothness index of the three-dimensional contour data is measured to obtain the contour smoothness feature;
[0036] Detect abrupt slope changes in the three-dimensional contour data over a short distance to obtain local slope change rate characteristics;
[0037] Abnormal convex and concave regions in the three-dimensional contour data are identified to obtain contour convexity and concavity features.
[0038] Optionally, the curve feature includes features in multiple dimensions, and the analysis of the curve feature to determine the welding quality of the current contour includes:
[0039] Each feature in the curve features is assigned a corresponding weight, and each feature is compared with its corresponding preset threshold to obtain a binary judgment result for each feature. The preset threshold for each feature in the curve features is automatically calculated by statistically analyzing the feature mean and standard deviation of each feature in the qualified weld sample.
[0040] The weighted score is calculated based on the weight of each feature and the corresponding binary judgment result;
[0041] When the weighted score is determined to be greater than the first preset score threshold, the current contour is determined to be abnormal.
[0042] Alternatively, when it is determined that the height value of the current contour is greater than the sum of the median height of all contours and a preset height change threshold, and the weighted score is greater than a second preset score threshold, the current contour is determined to be abnormal, wherein the second preset score threshold is less than the first preset score threshold.
[0043] Optionally, the method further includes:
[0044] During the detection of multiple contours of the target weld bead, the number of contours that are consecutively judged as abnormal is counted.
[0045] When the number of normal contours between two adjacent contours that are judged as abnormal does not exceed the second preset number threshold, the two adjacent contours that are judged as abnormal are regarded as continuous abnormal contours.
[0046] When the number of continuous abnormal contours exceeds a third preset threshold, the target weld bead is determined to have a defect.
[0047] This application also provides a defect detection device based on the three-dimensional contour of weld beads, used to perform the defect detection method based on the three-dimensional contour of weld beads as described in any of the above embodiments, including:
[0048] The data acquisition module is used to acquire the three-dimensional contour data of the current contour in the target weld bead;
[0049] The feature extraction module is used to extract curve features corresponding to the three-dimensional contour data, wherein the curve features include at least geometric morphological features;
[0050] The defect detection module is used to analyze the curve features to determine the welding quality of the current contour.
[0051] This application also provides a computer device, including: one or more processors, and memory;
[0052] The memory stores computer-readable instructions, which, when executed by the one or more processors, perform the steps of the defect detection method based on the three-dimensional contour of the weld bead as described in any of the above embodiments.
[0053] This application also provides a computer-readable storage medium storing computer-readable instructions, which, when executed by one or more processors, cause the one or more processors to perform the steps of the defect detection method based on the three-dimensional contour of the weld bead as described in any of the above embodiments.
[0054] As can be seen from the above technical solutions, the embodiments of this application have the following advantages:
[0055] This application provides a defect detection method, apparatus, equipment, and storage medium based on the three-dimensional contour of weld beads. It acquires the three-dimensional contour data of the current contour in the target weld bead, extracts the corresponding curve features (including at least geometric morphological features), and then analyzes these features to determine the welding quality of the current contour. By extracting curve features that include at least geometric morphological features, this application fully utilizes the three-dimensional morphological information of the weld bead. Compared to traditional manual inspection and 2D visual inspection, this application can fully utilize the three-dimensional morphological information of the weld bead to capture different types of defects. Compared to 3D inspection methods that rely on simple threshold judgment, through the combined analysis of multi-dimensional features, it can effectively identify minute defects such as pinholes, and can adapt to the inspection needs of different products and processes, reducing the probability of missed and false detections, and improving the accuracy and adaptability of weld bead defect detection. Attached Figure Description
[0056] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0057] Figure 1 A schematic flowchart of a defect detection method based on the three-dimensional contour of a weld bead provided in an embodiment of this application;
[0058] Figure 2 A schematic diagram illustrating the process of extracting core features from three-dimensional contour data, provided in an embodiment of this application.
[0059] Figure 3 A schematic diagram illustrating the process of extracting auxiliary features from three-dimensional contour data provided in an embodiment of this application;
[0060] Figure 4 A schematic diagram illustrating the process of extracting new features from three-dimensional contour data as provided in an embodiment of this application;
[0061] Figure 5 This is a flowchart illustrating the overall detection algorithm provided in the embodiments of this application.
[0062] Figure 6 A schematic diagram of the structure of the defect detection device based on the three-dimensional contour of the weld bead provided in the embodiments of this application;
[0063] Figure 7 This is a schematic diagram of the internal structure of a computer device provided in an embodiment of this application. Detailed Implementation
[0064] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0065] In one embodiment, such as Figure 1 As shown, Figure 1 This is a flowchart illustrating a defect detection method based on the three-dimensional contour of a weld bead, as provided in an embodiment of this application. This application provides a defect detection method based on the three-dimensional contour of a weld bead, which may include:
[0066] S110: Obtain the three-dimensional contour data of the current contour in the target weld bead.
[0067] In this step, when performing defect detection on the target weld bead, a line laser profile sensor or other instruments can be used to scan line by line along the length of the weld bead, sequentially acquiring the three-dimensional height information of each line of the profile, thereby obtaining the three-dimensional profile data corresponding to the current profile. Alternatively, point cloud data of the target weld bead can be acquired from a 3D vision system, and the three-dimensional profile data of the current profile can be extracted from it.
[0068] For example, this application can divide the target weld bead into multiple parallel contour lines along its length, and extract the lateral coordinates and height values of each contour line sequentially to achieve contour-by-contour detection and analysis. This avoids computational redundancy caused by directly processing the entire point cloud, thus improving detection efficiency. Furthermore, this application supports parallel detection of multiple contours, further enhancing detection speed.
[0069] The three-dimensional contour data of this application includes the lateral position coordinates (along the weld length direction) and the corresponding height values (perpendicular to the weld surface direction) of each point on the current contour. Its mathematical representation is: Let the set of contour points of the current contour be... ={ , ,..., },in = ( , ), where n is the total number of contour points. For the i-th contour point, Its horizontal position coordinates, Its height value.
[0070] In addition, the target welds of this application can cover various welds to be inspected in industrial production scenarios, such as shell cover welds, bellows welds, and sealing welds, without limiting the specific weld type.
[0071] S120: Extract curve features corresponding to the 3D contour data.
[0072] In this step, after obtaining the three-dimensional contour data of the current contour through S110, curve features that can reflect the state of weld defects can be extracted from multiple different dimensions based on the three-dimensional contour data. The curve features here can include at least geometric morphological features of multiple dimensions such as peak and valley anomalies and shape changes. Furthermore, the curve features of this application can also include features of dimensions such as flatness and symmetry, thereby comprehensively characterizing the shape anomalies of the current contour and providing sufficient judgment basis for subsequent defect judgment.
[0073] It is understandable that features of different dimensions can reflect the defect state of the weld bead profile from different levels. For example, tiny pinholes can form abnormal peaks and valleys in local areas, causing sudden changes in local slope and a decrease in flatness. Weld misalignment can lead to abnormal profile symmetry indicators. This application prioritizes capturing the abnormal shape changes caused by defects through the geometric features of the current profile, and at the same time combines other dimensional features for joint judgment, which can cover multiple types of weld bead defects and avoid the limitations of single feature recognition.
[0074] S130: Analyze the curve features to determine the welding quality of the current profile.
[0075] In this step, after obtaining the multi-dimensional curve features through S120, these features can be comprehensively analyzed in conjunction with preset judgment rules to ultimately determine whether there are any anomalies in the current contour, thus completing the judgment of the welding quality of the current contour. By comprehensively judging multiple features, misjudgments caused by judging a single feature can be effectively avoided, improving the accuracy of the detection results.
[0076] In the above embodiments, by acquiring the three-dimensional contour data of the current contour in the target weld bead, the curve features corresponding to the three-dimensional contour are extracted. These curve features include at least geometric morphological features, and then the welding quality of the current contour is determined by analyzing the curve features. This application fully utilizes the three-dimensional morphological information of the weld bead by extracting curve features that include at least geometric morphological features. Compared with traditional manual inspection and 2D visual inspection, this application can fully utilize the three-dimensional morphological information of the weld bead to capture different types of defects. Compared with 3D inspection methods that rely on simple threshold judgment, the combination analysis of multi-dimensional features can effectively identify tiny defects such as pinholes, and can also adapt to the inspection needs of different products and processes, reducing the probability of missed and false detections, and improving the accuracy and adaptability of weld bead defect detection.
[0077] In one embodiment, such as Figure 2 As shown, Figure 2This is a schematic diagram illustrating the process of extracting core features from three-dimensional contour data according to an embodiment of this application; the geometric features may include peak and valley features and curvature dispersion, and the extraction of curve features corresponding to the three-dimensional contour data in S120 may include:
[0078] S121: Use the slope change method to detect abnormal peaks and valleys in three-dimensional contour data to obtain peak and valley features.
[0079] S122: Calculate the curvature change of the three-dimensional contour data, and calculate the curvature dispersion based on the curvature change.
[0080] In this embodiment, tiny pinholes and pits will form local abnormal peaks or valleys on the weld bead contour. This application can quickly locate these abnormal peaks and valleys by using the slope change method. By statistically analyzing the number and amplitude of abnormal peaks and valleys, peak and valley features for defect judgment can be obtained. The curvature change of a normal weld bead is relatively stable, while the curvature at the location of a defect will change drastically. This application can reflect the degree of shape abnormality of the overall contour by calculating the curvature dispersion of all points in the entire contour. Through the two geometric morphological features of peak and valley features and curvature dispersion, the shape abnormality of the contour caused by defects can be quickly captured, providing a core basis for subsequent defect judgment.
[0081] In one embodiment, S121 uses the slope change method to detect abnormal peaks and valleys in the three-dimensional contour data to obtain peak-valley features, which may include:
[0082] S1211: Calculate the left slope and right slope of each contour point in the three-dimensional contour data.
[0083] S1212: For each contour point, compare the left slope and right slope of the contour point with the preset height change threshold respectively to obtain the comparison result.
[0084] S1213: Based on the comparison results, determine the abnormal peaks and valleys in the three-dimensional contour data to obtain peak-valley features.
[0085] In this embodiment, when using the slope change method to detect abnormal peaks and valleys in three-dimensional contour data, by calculating the slope change on the left and right sides of each contour point, the location where the slope sign changes abruptly can be quickly located. Such locations often correspond to local peaks or valleys on the contour. Then, this application combines a preset height change threshold to filter out abnormal peaks and valleys that exceed the normal range. The number or proportion of abnormal peaks and valleys can be used as peak and valley features to effectively capture local height abnormalities such as pinholes and weld beads.
[0086] In one specific implementation, this application can represent the left slope of the i-th contour point (the height difference between the i-th contour point and the 3 contour points before the i-th contour point) as S_L(i), and the right slope of the i-th contour point (the height difference between the i-th contour point and the 3 contour points after the i-th contour point) as S_R(i). The peak value is determined as: S_L(i) > T_h and S_R(i) < -T_h, and the valley value is determined as: S_L(i) < -T_h and S_R(i) > T_h, where T_h is a preset height change threshold used to determine whether the slope change is abnormal.
[0087] Furthermore, after obtaining the total number of abnormal peaks and valleys, this application can directly use the total number of abnormal peaks and valleys as peak and valley features, or it can use the proportion of abnormal peaks and valleys to the total number of points in the current contour as peak and valley features. The specific method can be adjusted according to the actual detection needs, and there are no restrictions here.
[0088] In one embodiment, S122, calculating the slope and curvature changes of the three-dimensional contour data and counting the number of violent oscillations to obtain curvature change characteristics, may include:
[0089] S1221: Calculate the first-order difference between each contour point in the three-dimensional contour data and the first preset number of contour points in front of it to obtain the slope of each contour point.
[0090] S1222: Calculate the second-order difference between the slopes of each contour point and its adjacent contour points in the three-dimensional contour data to obtain the curvature of each contour point.
[0091] S1223: Calculate the standard deviation of curvature based on the curvature of all contour points, and use the standard deviation of curvature as the curvature dispersion.
[0092] In this embodiment, when extracting the curvature change features of the three-dimensional contour data, this application obtains the slope of the contour points by calculating the first difference, then calculates the second difference of adjacent slopes to obtain the curvature of each point, and finally calculates the standard deviation of the curvature of all contour points to obtain the curvature dispersion, which reflects the degree of curvature change of the overall contour. The curvature change of the normal weld contour is gentle and the curvature dispersion is smaller. The curvature fluctuation of the contour with defects is greater and the corresponding curvature dispersion is also higher. This application can effectively characterize the degree of shape abnormality of the overall contour by using this feature.
[0093] In one specific implementation, this application can express the slope of the i-th contour point (the rate of change of height compared to the previous 5 contour points) as: The slope of the (i-1)th contour point is expressed as Let the rate of change of curvature (slope) of the i-th contour point be expressed as... The slope of the i-th contour point is obtained by calculating the first-order difference, as shown in the following formula:
[0094]
[0095] in, Let be the height of the i-th contour point. The height is the height of the 5 contour points preceding the i-th contour point. It is understood that 5 here is just an example of the first preset number, and can be adjusted to other values according to the sampling density of contour points, and is not limited to the value given in this embodiment.
[0096] The curvature at each point is obtained by calculating the second difference between adjacent slopes, as shown in the following formula:
[0097]
[0098] Furthermore, after obtaining the curvature of all contour points, this application can calculate the standard deviation of curvature of the entire contour, using the following formula:
[0099]
[0100] in, The average value of the curvature. The number of curvature data points, The standard deviation of curvature reflects the global dispersion.
[0101] In one embodiment, such as Figure 3 As shown, Figure 3 This is a schematic diagram illustrating the process of extracting auxiliary features from three-dimensional contour data according to an embodiment of this application; the curve features may further include local flatness features, contour symmetry features, and the number of violent oscillations;
[0102] Extracting the curve features corresponding to the three-dimensional contour data in S120 may include:
[0103] S123: Perform local flatness analysis on the three-dimensional contour data to obtain local flatness characteristics.
[0104] S124: Detect the height difference between the left and right contours in the 3D contour data to obtain contour symmetry features.
[0105] S125: Count the number of times the product of the slopes of two adjacent contour points in the three-dimensional contour data is less than zero, and obtain the number of violent oscillations.
[0106] In this embodiment, in addition to the two geometric features of peak and valley characteristics and curvature dispersion, this application also extracts three additional features: local flatness features, contour symmetry features, and the number of violent oscillations, to further enrich the feature dimensions and improve the accuracy of defect judgment.
[0107] Among them, the local flatness feature can reflect the degree of height fluctuation in the local area of the current contour. When there are dense micro-defects, the local flatness will be significantly lower than that of the normal weld contour. Weld misalignment and weld offset will cause the height distribution of the contour to be asymmetrical on the left and right sides relative to the reference center. The contour symmetry feature can effectively capture this kind of anomaly. When the product of the slopes of adjacent contour points is less than zero, it indicates that the slope sign has changed abruptly, and the corresponding contour direction has been drastically reversed. The number of such drastic oscillations can also reflect the degree of contour anomaly. The combination of multi-dimensional features can cover more defect types and provide a more comprehensive basis for defect judgment.
[0108] In one embodiment, performing local smoothness analysis on the three-dimensional contour data in step S123 to obtain local smoothness features may include:
[0109] S1231: A window of a first preset window size slides on the three-dimensional contour data to obtain multiple windows, wherein each window contains multiple consecutive contour points of the same size as the first preset window.
[0110] S1232: For each window, calculate the average height of all contour points within the window, and calculate the average of the squared deviations of the heights of each contour point within the window from the average height, to obtain the height variance of the window.
[0111] S1233: Calculate the average value of the height variance of all windows to obtain the average local flatness, and use the average local flatness as the local flatness feature.
[0112] In this embodiment, a sliding window traverses the local areas of the entire contour, statistically analyzing the dispersion of local height in each area. Finally, the average height variance of all windows is calculated to obtain the local flatness characteristics. This allows for precise quantification of the unevenness of local areas on the weld surface, effectively identifying surface defects caused by spatter, residual weld slag, or incomplete penetration during welding, further improving the accuracy of defect identification. The size of the first preset window can be adjusted based on the sampling density of contour points and common defect sizes; for example, it can be set to contain 10 consecutive contour points, but this is not a unique limitation.
[0113] In one specific implementation, the formula for calculating the average height of all contour points within the i-th window is as follows:
[0114]
[0115] in, The average height of all contour points within the i-th window. For the first preset window size, this application can set k=5. Let be the height from the i-th contour point to the (i+k-1)-th contour point.
[0116] After calculating the average height of all contour points within the i-th window, this application can calculate the height variance of the i-th window using the following formula. :
[0117]
[0118] Next, this application can calculate the average height variance of all windows to obtain the average local flatness. The larger this value, the more uneven the local area. The specific formula is as follows:
[0119]
[0120] The above formula provides a quantitative representation of local flatness characteristics, accurately reflecting the height uniformity of local areas of the weld bead, and providing a clear quantitative indicator for judging surface unevenness defects.
[0121] In one embodiment, detecting the height difference between the left and right contours in the three-dimensional contour data in S124 to obtain contour symmetry features may include:
[0122] S1241: Determine the central symmetry axis of the three-dimensional contour data.
[0123] S1242: For each contour point on the left side of the central axis of symmetry, obtain the symmetrical contour point on the right side of the contour point.
[0124] S1243: Calculate the absolute value of the height difference between each contour point and its symmetrical contour point, and calculate the average value of all the absolute values of height differences to obtain the symmetry index, and use the symmetry index as the contour symmetry feature.
[0125] In this embodiment, by determining the central axis of symmetry of the contour and calculating the average absolute value of the height difference between the contour points at corresponding positions on both sides of the axis of symmetry, the degree of symmetry of the entire weld contour can be accurately quantified. The worse the degree of symmetry, the higher the possibility of defects such as weld misalignment and weld offset. This feature can effectively capture defects that affect the overall structural symmetry of the weld, make up for the shortcomings of local features in being unable to identify defects in the overall structure, and further improve the coverage of the feature system.
[0126] In one specific implementation, the formula for calculating the symmetry index of this application is as follows:
[0127]
[0128] in, Let be the height of the i-th contour point. The height of the contour point symmetrical to the i-th contour point is half the total number of contour points, i.e. , As a symmetry indicator, the larger the value, the more asymmetrical the outline.
[0129] The above formula yields quantified contour symmetry features, which, when incorporated into a multi-dimensional feature system, provide a reliable quantitative basis for determining overall structural defects, further enhancing the comprehensiveness of defect identification.
[0130] In one embodiment, such as Figure 4 As shown, Figure 4 This is a schematic diagram illustrating the process of extracting new features from three-dimensional contour data according to an embodiment of this application; the curve features may also include contour smoothness features, local slope change rate features, and contour convexity / concavity features.
[0131] Extracting the curve features corresponding to the three-dimensional contour data in S120 may include:
[0132] S126: Measures the smoothness index of three-dimensional contour data to obtain contour smoothness features.
[0133] S127: Detect abrupt changes in slope of 3D contour data over short distances to obtain local slope change rate characteristics.
[0134] S128: Identify abnormal convex and concave regions in 3D contour data to obtain contour convexity and concavity features.
[0135] In this embodiment, by adding curve features in three dimensions—contour smoothness, local slope change rate, and contour convexity / concavity—the feature system is further enriched, enabling it to cover more different types of weld defects and providing more comprehensive feature support for subsequent defect detection.
[0136] Among them, the contour smoothness feature can measure the smoothness of the three-dimensional contour of the weld bead as a whole. The overall smoothness of the contour of a normal weld bead is higher, while the smoothness of the contour with welding defects will decrease significantly. The local slope change rate feature can capture the rapid change of contour height over a short distance, which can accurately locate small-sized local defects and prevent small defects from being masked by the overall features and thus unidentifiable. The contour convexity and concavity feature can directly quantify the degree of abnormal protrusions and depressions on the contour, and is more targeted at obvious contour morphological abnormalities such as weld beads and pits. The multiple features complement each other and can effectively improve the accuracy of subsequent defect detection.
[0137] In one embodiment, measuring the smoothness index of the three-dimensional contour data in S126 to obtain the contour smoothness feature may include:
[0138] S1261: Determine the lines connecting adjacent contour points in the three-dimensional contour data as multiple adjacent vectors.
[0139] S1262: Calculate the angle between any two adjacent vectors.
[0140] S1263: Calculate the average of the angles between all adjacent vectors to obtain the smoothness index, and use the smoothness index as the contour smoothness feature.
[0141] In this embodiment, the smoothness of the contour is quantified by calculating the average angle between adjacent vectors between adjacent contour points. The less smooth the contour, the greater the turning angle between adjacent vectors, and the greater the corresponding smoothness index. This feature can accurately reflect the continuity of the weld bead forming process, effectively identify the continuous unevenness defects of the weld bead contour caused by unstable welding parameters, and further enrich the feature information at the overall contour level.
[0142] In one specific implementation, if the current contour consists of n contour points, n-1 adjacent vectors can be obtained, corresponding to n-2 angles between adjacent vectors. The final smoothness index is obtained by averaging all the angles, as shown in the following formula:
[0143]
[0144]
[0145]
[0146]
[0147] in, Let be the vector from the (i-1)th contour point to the ith contour point. Let be the vector from the i-th contour point to the (i+1)-th contour point. Let be the angle between two adjacent vectors, p be the number of effective angles (i.e., p = n - 2), and F_smooth be the smoothness index. A larger value indicates a larger average angle between adjacent vectors, resulting in a poorer overall smoothness of the corresponding contour. This formula can accurately quantify the continuous smoothness of the weld bead contour, providing clear quantitative characteristics for forming defects caused by instability in the welding process.
[0148] In one embodiment, detecting abrupt slope changes in the three-dimensional contour data over a short distance in step S127 to obtain local slope change rate features may include:
[0149] S1271: Calculate the slope between two adjacent contour points in the three-dimensional contour data.
[0150] S1272: Calculate the rate of change between two adjacent slopes.
[0151] S1273: Calculate the average of all rates of change to obtain the local slope rate of change, and use the local slope rate of change as the local slope rate of change feature.
[0152] In this embodiment, by calculating the slope change rate between adjacent contour points, the local height fluctuations caused by tiny defects can be amplified. Even tiny defects such as pinholes and pits can be highlighted by the large change rate generated by the abrupt change in slope, thus avoiding tiny defects being masked by the overall features due to small height changes, and effectively improving the detection capability of small-sized defects.
[0153] In the specific implementation process, this application can denote the slope of adjacent contour points as... The calculation formula is: The formula for calculating the rate of change between adjacent slopes is:
[0154]
[0155] in, F_slope represents the slope. The larger the slope, the more drastic the slope change within a short distance, and the higher the probability of the presence of minor defects. This formula can be used to obtain the quantified local slope change rate characteristics, providing a reliable basis for the determination of minor defects.
[0156] In one embodiment, identifying abnormal convex and concave regions in the three-dimensional contour data in step S128 to obtain contour convexity / concavity features may include:
[0157] S1281: Select a fourth preset number of continuous contour points from the three-dimensional contour data to form multiple point groups.
[0158] S1282: For each point group, calculate the curvature of the curve formed by the contour points in the point group based on the coordinates of each contour point in the point group.
[0159] S1283: Calculate the average of the absolute values of the curvature of all point groups to obtain the convexity-concavity index, and use the convexity-concavity index as the contour convexity-concavity feature.
[0160] In this embodiment, the degree of local convexity and concavity curvature of the weld bead is quantified by averaging the absolute values of curvature of local continuous contour points. The more obvious the local convexity or concavity, the larger the absolute value of curvature, and the higher the corresponding convexity / concavity index. This feature can accurately capture defects such as local convex weld beads and local concave incomplete fusion on the weld bead surface, further supplementing the feature dimensions of local defects and improving the ability to identify different types of local defects. In specific implementation, the fourth preset number can be flexibly adjusted according to the conventional size of the convexity / concavity defect to be detected, and there is no fixed limit here. This application can obtain a clearly quantified convexity / concavity index by calculating the average of the absolute values of curvature of all point groups, providing a clear quantitative basis for the judgment of local convexity / concavity defects in the weld bead.
[0161] Schematic illustration: This application can select three consecutive contour points to form a point group, and calculate the three-point curvature of each point group, using the following formula:
[0162]
[0163] in, Let be the curvature of the three points in the i-th point group. Let x be the x-coordinate of the first contour point in the i-th point group. Let be the height of the first contour point in the i-th point group. Let x be the x-coordinate of the second contour point in the i-th point group. Let the height be the height of the second contour point in the i-th point group. Let x be the x-coordinate of the third contour point in the i-th point group. Let be the height of the third contour point in the i-th point group.
[0164] Next, this application can calculate the average of the absolute values of the curvature of all point groups to obtain the convexity / concavity index, as shown in the following formula:
[0165]
[0166] Wherein, r represents the effective curvature number, i.e., r = n-2, where n is the total number of contour points, and F_conv is the convexity index. The larger the value, the more obvious the overall convexity and concavity of the weld bead, and the higher the probability of local convex or concave welding defects. This formula provides a quantified contour convexity and concavity characteristic, accurately reflecting the abnormal deformation of the weld bead surface and providing a clear quantitative basis for judging convexity and concavity defects such as weld beads and local lack of fusion.
[0167] In one embodiment, before extracting the curve features corresponding to the three-dimensional contour data in S120, the process may further include:
[0168] The three-dimensional contour data is smoothed using a window of the second preset window size to remove height anomalies in the three-dimensional contour data that exceed the preset normal range.
[0169] In this embodiment, due to potential external interference or point cloud acquisition errors during weld bead acquisition, a small number of isolated height anomalies may appear. These anomalies can interfere with the calculation of subsequent features, leading to deviations in feature quantization results. This application performs smoothing preprocessing on the original 3D contour data through a preset window, which can effectively filter out these isolated anomalies, making the contour data more closely resemble the actual weld bead formation and improving the accuracy of subsequent feature calculations. The size of the second preset window can be adjusted according to the acquired point cloud density; no single limitation is specified here.
[0170] In one specific implementation, this application can smooth the three-dimensional contour data using the following mathematical formula, as follows:
[0171]
[0172] in, Let w be the height of the i-th contour point after smoothing, and let w be the window radius. Let w = 1 (window size is 3). Let be the original height of the j-th contour point, where j ranges from iw to i+w.
[0173] In one embodiment, such as Figure 5 As shown, Figure 5 This is an overall flowchart of the detection algorithm provided in this application embodiment; the curve feature includes features of multiple dimensions, and the analysis of the curve feature in S130 to determine the welding quality of the current contour may include:
[0174] S131: Set corresponding weights for each feature in the curve features, and compare each feature with its corresponding preset threshold to obtain the binary judgment result corresponding to each feature. The preset thresholds for each feature in the curve features are automatically calculated by statistically analyzing the feature mean and standard deviation of each feature in the qualified weld sample.
[0175] S132: Calculate the weighted score based on the weight of each feature and the corresponding binary judgment result.
[0176] S133: When it is determined that the weighted score is greater than the first preset score threshold, the current contour is determined to be abnormal.
[0177] S134: Alternatively, when it is determined that the height value of the current contour is greater than the sum of the median height of all contours and a preset height change threshold, and the weighted score is greater than a second preset score threshold, the current contour is determined to be abnormal, wherein the second preset score threshold is less than the first preset score threshold.
[0178] In this embodiment, by combining the weighting of different features and threshold determination, accurate judgment can be achieved based on the varying degrees of impact of different types of defects on welding quality. Simultaneously, appropriately lowering the scoring threshold for welds with significantly excessive height can prevent the missed detection of large-sized defects, thus balancing accuracy and robustness. The weights and thresholds of each feature can be flexibly adjusted according to the qualified weld standards in actual production, adapting to the inspection needs of different welding scenarios.
[0179] For example, this application can divide each feature into core features, auxiliary features, and new features. The core features (peak and valley detection, curvature dispersion) are each assigned a value of 0.2, the auxiliary features (local smoothness, symmetry, number of violent oscillations) are each assigned a value of 0.1, and the new features (smoothness index, local slope change rate, contour convexity / concavity) are each assigned a value of 0.1. Prior to this, this application can also collect feature statistics of normal samples through a learning mode and automatically calculate the optimal threshold.
[0180] Specifically, this application calculates the anomaly threshold for each feature by adding the mean to the corresponding multiple of the standard deviation, i.e., anomaly threshold = mean of normal sample features + ×Standard deviation of normal sample characteristics, where The confidence level is set to 3.0 by default, but it can also be flexibly set according to the actual testing requirements.
[0181] When the calculated result of a corresponding feature is greater than a preset threshold, the binary judgment result of that feature is recorded as 1, indicating that the feature is abnormal; otherwise, it is recorded as 0, indicating that the feature is normal. After completing the judgment of all features, this application can multiply the binary judgment result of each feature by the weight of the corresponding feature and sum them to obtain the weighted score of the current weld contour. Then, the final anomaly judgment can be completed based on the weighted score combined with the height condition.
[0182] For example, this application can set two judgment conditions. When one of the judgment conditions is met, the current contour can be identified as abnormal. Condition 1: S > 0.45, Condition 2: (y_current > y_median + T_h) and S > 0.25, where S is the weighted score. Let i be the weight of the i-th feature. y_current is the height value of the current contour, y_median is the median height of all contours, and T_h is the preset height change threshold.
[0183] When any one of the weighted scores meets a condition, it can be determined that there is a welding defect in the current weld contour, thus completing the welding quality anomaly assessment for the current contour. This assessment method has clear logic, low computational load, and can quickly output detection results while ensuring detection accuracy, making it suitable for the high-efficiency needs of online inspection in industrial settings.
[0184] In one embodiment, the method may further include:
[0185] S135: During the detection of multiple contours of the target weld bead, the number of contours that are consecutively judged as abnormal is counted.
[0186] S136: When the number of normal contours between two adjacent contours that are determined to be abnormal does not exceed the second preset number threshold, the two adjacent contours that are determined to be abnormal are regarded as continuous abnormal contours.
[0187] S137: When the number of continuous abnormal contours is greater than a third preset number threshold, it is determined that the target weld has a defect.
[0188] In this embodiment, as Figure 3 As shown, since a single abnormal contour during the welding process may be a random error caused by accidental factors, it does not mean that there is a substantial defect in the entire weld bead. Therefore, by counting the number of consecutive abnormal contours, the misjudgment caused by a single accidental abnormality can be effectively eliminated. Only when the consecutive abnormalities reach a certain length can the entire weld bead be judged to have a defect, which can significantly reduce the false detection rate and improve the reliability of defect detection.
[0189] The second and third preset quantity thresholds can be flexibly set according to the overall length of the weld and the minimum detection requirements of defects to meet the adjustment needs of false detection rate and missed detection rate in different scenarios.
[0190] Ultimately, when this application determines that there are defects in the target weld, it can output the location, type, and characteristic value of the defects, which makes it convenient for on-site operators to quickly locate the defect location, clarify the severity of the defects, provide clear guidance for subsequent weld rework, and facilitate the statistical analysis of the occurrence pattern of welding defects during the production process, reverse optimization of welding process parameters, and reduce the probability of welding defects from the source.
[0191] The following describes the defect detection device based on the three-dimensional contour of weld beads provided in the embodiments of this application. The defect detection device based on the three-dimensional contour of weld beads described below can be referred to in correspondence with the defect detection method based on the three-dimensional contour of weld beads described above.
[0192] In one embodiment, such as Figure 6 As shown, Figure 6 This is a schematic diagram of the structure of a defect detection device based on the three-dimensional contour of a weld bead provided in an embodiment of this application. This application also provides a defect detection device based on the three-dimensional contour of a weld bead, used to execute the defect detection method based on the three-dimensional contour of a weld bead as described in any of the above embodiments. It may include a data acquisition module 210, a feature extraction module 220, and a defect detection module 230, specifically including the following:
[0193] The data acquisition module 210 is used to acquire the three-dimensional contour data of the current contour in the target weld bead.
[0194] The feature extraction module 220 is used to extract the curve features corresponding to the three-dimensional contour data.
[0195] The defect detection module 230 is used to analyze the curve features to determine the welding quality of the current contour.
[0196] In the above embodiments, by acquiring the three-dimensional contour data of the current contour in the target weld bead, the curve features corresponding to the three-dimensional contour are extracted. These curve features include at least geometric morphological features, and then the welding quality of the current contour is determined by analyzing the curve features. This application fully utilizes the three-dimensional morphological information of the weld bead by extracting curve features that include at least geometric morphological features. Compared with traditional manual inspection and 2D visual inspection, this application can fully utilize the three-dimensional morphological information of the weld bead to capture different types of defects. Compared with 3D inspection methods that rely on simple threshold judgment, the combination analysis of multi-dimensional features can effectively identify tiny defects such as pinholes, and can also adapt to the inspection needs of different products and processes, reducing the probability of missed and false detections, and improving the accuracy and adaptability of weld bead defect detection.
[0197] In one embodiment, this application also provides a computer-readable storage medium storing computer-readable instructions that, when executed by one or more processors, cause the one or more processors to perform the steps of the defect detection method based on the three-dimensional profile of the weld bead as described in any of the above embodiments.
[0198] In one embodiment, this application also provides a computer device, including: one or more processors, and memory.
[0199] The memory stores computer-readable instructions, which, when executed by the one or more processors, perform the steps of the defect detection method based on the three-dimensional contour of the weld bead as described in any of the above embodiments.
[0200] Indicatively, such as Figure 7As shown, Figure 7 This is a schematic diagram of the internal structure of a computer device 300 provided in an embodiment of this application. The computer device 300 can be provided as a server. (Refer to...) Figure 7 The computer device 300 includes a processing component 302, which further includes one or more processors, and memory resources represented by memory 301 for storing instructions executable by the processing component 302, such as application programs. The application programs stored in memory 301 may include one or more modules, each corresponding to a set of instructions. Furthermore, the processing component 302 is configured to execute instructions to perform the defect detection method based on the three-dimensional weld bead profile of any of the above embodiments.
[0201] The computer device 300 may also include a power supply component 303 configured to perform power management of the computer device 300, a wired or wireless network interface 304 configured to connect the computer device 300 to a network, and an input / output (I / O) interface 305. The computer device 300 may operate on an operating system stored in memory 301, such as Windows Server™, Mac OS X™, Unix™, Linux™, Free BSD™, or similar.
[0202] Those skilled in the art will understand that Figure 7 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0203] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0204] The various embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can be referred to each other.
[0205] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A defect detection method based on the three-dimensional contour of a weld bead, characterized in that, The method includes: Obtain the three-dimensional contour data of the current contour in the target weld bead; Extract the curve features corresponding to the three-dimensional contour data, wherein the curve features include at least geometric morphological features; The curve features are analyzed to determine the welding quality of the current contour.
2. The method according to claim 1, characterized in that, The geometric morphological features include peak and valley features and curvature dispersion. Extracting the curve features corresponding to the three-dimensional contour data includes: The slope variation method is used to detect abnormal peaks and valleys in the three-dimensional contour data to obtain peak and valley features. Calculate the curvature change of the three-dimensional contour data, and calculate the curvature dispersion based on the curvature change.
3. The method according to claim 2, characterized in that, The method of using slope variation to detect abnormal peaks and valleys in the three-dimensional contour data, and obtaining peak and valley features, includes: Calculate the left and right slopes of each contour point in the three-dimensional contour data; For each contour point, the left slope and right slope of the contour point are compared with the preset height change thresholds to obtain the comparison results; Based on the comparison results, abnormal peaks and valleys in the three-dimensional contour data are determined to obtain peak-valley features.
4. The method according to claim 2, characterized in that, The calculation of the curvature change of the three-dimensional contour data, and the calculation of the curvature dispersion based on the curvature change, includes: Calculate the first-order difference between each contour point in the three-dimensional contour data and the first preset number of contour points in front of it to obtain the slope of each contour point. Calculate the second-order difference between the slope of each contour point and its adjacent contour points in the three-dimensional contour data to obtain the curvature of each contour point. The standard deviation of curvature is calculated based on the curvature of all contour points, and this standard deviation is used as the curvature dispersion.
5. The method according to claim 1, characterized in that, The curve features also include local smoothness features, contour symmetry features, and the number of violent oscillations; The extraction of curve features corresponding to the three-dimensional contour data includes: Local flatness analysis is performed on the three-dimensional contour data to obtain local flatness characteristics; The height difference between the left and right contours in the three-dimensional contour data is detected to obtain the contour symmetry feature; The number of times the product of the slopes of two adjacent contour points in the three-dimensional contour data is less than zero is counted to obtain the number of violent oscillations.
6. The method according to claim 5, characterized in that, The step of performing local flatness analysis on the three-dimensional contour data to obtain local flatness features includes: Multiple windows are obtained by sliding a window of a first preset window size on the three-dimensional contour data, wherein each window contains multiple consecutive contour points of the same size as the first preset window. For each window, calculate the average height of all contour points within that window, and calculate the average of the squared deviations of the heights of each contour point within that window from the average height, to obtain the height variance of that window. Calculate the average of the height variances of all windows to obtain the average local flatness, and use the average local flatness as a local flatness feature.
7. The method according to claim 5, characterized in that, The step of detecting the height difference between the left and right contours in the three-dimensional contour data to obtain contour symmetry features includes: Determine the central axis of symmetry of the three-dimensional contour data; For each contour point to the left of the central axis of symmetry, obtain the symmetrical contour point at the symmetrical position on the right side of that contour point; Calculate the absolute value of the height difference between each contour point and its symmetrical contour point, and calculate the average value of all the absolute values of height differences to obtain the symmetry index, which is then used as the contour symmetry feature.
8. The method according to claim 1, characterized in that, The curve features also include contour smoothness features, local slope change rate features, and contour convexity / concavity features; The extraction of curve features corresponding to the three-dimensional contour data includes: The smoothness index of the three-dimensional contour data is measured to obtain the contour smoothness feature; Detect abrupt slope changes in the three-dimensional contour data over a short distance to obtain local slope change rate characteristics; Abnormal convex and concave regions in the three-dimensional contour data are identified to obtain contour convexity and concavity features.
9. The method according to any one of claims 1-8, characterized in that, The curve features include features in multiple dimensions. Analyzing the curve features to determine the welding quality of the current contour includes: Each feature in the curve features is assigned a corresponding weight, and each feature is compared with its corresponding preset threshold to obtain a binary judgment result for each feature. The preset threshold for each feature in the curve features is automatically calculated by statistically analyzing the feature mean and standard deviation of each feature in the qualified weld sample. The weighted score is calculated based on the weight of each feature and the corresponding binary judgment result; When the weighted score is determined to be greater than the first preset score threshold, the current contour is determined to be abnormal. Alternatively, when it is determined that the height value of the current contour is greater than the sum of the median height of all contours and a preset height change threshold, and the weighted score is greater than a second preset score threshold, the current contour is determined to be abnormal, wherein the second preset score threshold is less than the first preset score threshold.
10. The method according to claim 1, characterized in that, The method further includes: During the detection of multiple contours of the target weld bead, the number of contours that are consecutively judged as abnormal is counted. When the number of normal contours between two adjacent contours that are judged as abnormal does not exceed the second preset number threshold, the two adjacent contours that are judged as abnormal are regarded as continuous abnormal contours. When the number of continuous abnormal contours exceeds a third preset threshold, the target weld bead is determined to have a defect.
11. A defect detection device based on the three-dimensional contour of a weld bead, characterized in that, A method for performing defect detection based on the three-dimensional contour of a weld bead as described in any one of claims 1-10, comprising: The data acquisition module is used to acquire the three-dimensional contour data of the current contour in the target weld bead; The feature extraction module is used to extract curve features corresponding to the three-dimensional contour data, wherein the curve features include at least geometric morphological features; The defect detection module is used to analyze the curve features to determine the welding quality of the current contour.
12. A computer device, characterized in that, include: One or more processors, and memory; The memory stores computer-readable instructions, which, when executed by the one or more processors, perform the steps of the defect detection method based on the three-dimensional profile of the weld bead as described in any one of claims 1 to 10.
13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-readable instructions that, when executed by one or more processors, cause the one or more processors to perform the steps of the defect detection method based on the three-dimensional profile of the weld bead as described in any one of claims 1 to 10.