Welding bead pseudo soldering detection method and device

Through depth map and image processing technology, the center line and contour of the weld bead are extracted, the curvature of the contour vertex is calculated, and the dummy welding area is identified, which solves the accuracy and efficiency of the dummy welding detection of the bead in the existing technology, and realizes efficient and accurate dummy welding detection, which is suitable for high-speed production lines.

CN120013867APending Publication Date: 2025-05-16GUANGDONG AOPUTE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411974663.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-30
Publication Date
2025-05-16

AI Technical Summary

Technical Problem

In the prior art, in the detection of bead dummy welding, there is a detection process that is sensitive to light conditions and is susceptible to shadow interference, and the detection accuracy is affected by solder reflection and background components, making it difficult to meet the needs of high-speed production lines, especially the detection of dummy welding of bends cannot be effectively detected.

Method used

By obtaining the depth map of the sample to be tested, the center line and contour of the bead are extracted, the curvature of the contour vertex is calculated, and the dummy welding area is identified. This method uses depth map and image processing technology to avoid dependence on lighting conditions and improve detection accuracy and efficiency.

Benefits of technology

It improves the accuracy and efficiency of bead dummy welding inspection, simplifies the inspection process, reduces the inspection cost, and can effectively identify the dummy welding of bends, which is suitable for high-speed production lines.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120013867A_ABST
    Figure CN120013867A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of visual inspection, and discloses a weld bead pseudo soldering detection method and device. The method comprises the following steps: acquiring a depth map of a to-be-detected sample; extracting a center line of a weld bead in the depth map; according to the center line and the depth map, a welding bead contour of the depth map is obtained; according to the weld bead contour of the depth map, the contour vertex curvature of the weld bead contour is obtained; according to the contour vertex curvature, identifying a pseudo soldering area of the to-be-detected sample; according to the method, the depth map and the image processing technology are used for carrying out pseudo soldering detection on the weld bead of the sample to be detected, the pseudo soldering detection analysis process based on the depth map does not need to depend on a complex imaging system, powerful computing power and a large amount of data, the detection process is effectively simplified, the detection efficiency and reliability are improved, and the detection cost is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of visual inspection, and in particular to a method and a device for detecting weld defects. Background Art

[0002] In the modern electronic manufacturing industry, welding is the main method for connecting electronic components to printed circuit boards (PCBs), and its quality directly affects product performance and life. Cold solder joints are a common and serious welding defect that may cause circuit disconnection, unstable signal transmission, and even safety accidents. At present, the cold solder joint detection technology based on visual direction mainly relies on 2D images and their image processing technology.

[0003] However, the existing 2D images and image processing technologies have multiple limitations. For example, the detection process is sensitive to lighting conditions and is easily disturbed by shadows. In addition, solder reflections and background components may affect the detection accuracy. These factors jointly restrict the detection performance and accuracy of cold solder joints based on 2D images.

[0004] In addition, the existing technology also provides a method based on deep learning to detect weld defects. However, the existing general methods based on deep learning often require high computing power support, and the detection speed cannot meet the needs of high-speed production lines. The research on traditional algorithms for weld defect detection is relatively scarce, and it is difficult to cope with complex actual production environments, especially unable to meet the needs of weld defect detection for curved welds. Summary of the invention

[0005] The object of the present invention is to provide a method and device for detecting weld defects, so as to solve or at least partially solve the technical problems existing in the prior art.

[0006] To achieve this object, the present invention adopts the following technical solutions:

[0007] In a first aspect, the present invention provides a method for detecting a weld defect, which comprises the following steps:

[0008] S1, obtaining a depth map of the sample to be tested;

[0009] S2, extracting the center line of the weld in the depth map;

[0010] S3, obtaining a weld bead profile of the depth map according to the center line and the depth map;

[0011] S4, obtaining the contour vertex curvature of the weld contour according to the weld contour of the depth map;

[0012] S5. Identify the cold solder joint area of ​​the sample to be tested according to the vertex curvature of the contour.

[0013] Preferably, the step S2 specifically includes:

[0014] The weld skeleton of the weld in the depth map is extracted by an image thinning method, and the weld skeleton is used as the center line of the weld, wherein the depth map has m center lines, m≥1, and all center lines together constitute a center line point set CenLine=[(x0,y0),(x1,y1),......(x m ,y m )].

[0015] Preferably, the step S3 specifically includes:

[0016] S31, making vertical search lines at equal intervals along the center line;

[0017] S32. On each of the search lines, extract the weld bead contour of each weld bead according to the pixel position and depth value of the depth map, and the weld bead contours of all weld beads together constitute a weld bead two-dimensional contour point set ConPs.

[0018] Specifically, the step S31 includes:

[0019] S311, setting the search line interval Gap and the search line length Length to preset values ​​respectively;

[0020] S312, starting from the starting point of the center line, setting a search line Li along the center line:

[0021] L i =(Xa i ) / A i =(Yb i ) / B i ,

[0022] Among them, the search line Li is a straight line, (a i ,b i ) is a point on the search line Li, and (a i ,b i ) are points on the center line with the spacing Gap as the spacing, (A i ,B i ) is the unit direction vector of the search line Li, and (A i ,B i ) can be calculated by principal component analysis (a i ,b i )The eigenvector of the covariance matrix composed of the domain points is obtained.

[0023] Specifically, the step S32 specifically includes:

[0024] S321, according to the search line equation, obtain the coordinate point set Ps and the corresponding depth value set Zs of the weld two-dimensional contour point set ConPs on the depth map:

[0025] Ps=[(x0,y0),(x1,y1),......(x n ,y n )],

[0026] Zs=[z0,z1,......z n ],

[0027] Wherein, n is an even number;

[0028] S322, calculating the coordinate point set Ps and the corresponding depth value set Zs of the weld bead two-dimensional contour point set ConPs on the depth map;

[0029] S323, projecting the coordinate point set Ps of the weld bead two-dimensional contour point set ConPos on the depth map onto the unit direction vector of the search line Li to obtain the abscissa of the weld bead two-dimensional contour point set ConPs, and using the depth value set Zs corresponding to the coordinate point set Ps of the weld bead two-dimensional contour point set ConPs on the depth map as the ordinate of the weld bead two-dimensional contour point set ConPs, to obtain the weld bead two-dimensional contour point set ConPs:

[0030] ConPs=[(x0 / A0,z0),(x1 / A1,z1),...(x n / A n ,z n )].

[0031] Preferably, the step S4 specifically includes:

[0032] S41, traversing the ordinate values ​​of the weld bead two-dimensional contour point set ConPs, and determining the maximum ordinate value of the weld bead two-dimensional contour point set ConPs;

[0033] S42, taking the point corresponding to the maximum ordinate value of the weld bead two-dimensional contour point set ConPs as the contour vertex of the weld bead contour;

[0034] S43, calculating the curvature of the contour vertices of the weld bead contour according to the neighborhood point set of the contour vertices of the weld bead contour.

[0035] Specifically, the contour vertex curvature of the weld bead contour is calculated by a principal component analysis method or a quadratic function fitting method.

[0036] Preferably, the step S5 specifically includes:

[0037] S51, setting a curvature threshold, a virtual weld contour quantity threshold, a virtual weld curvature relative threshold, and a virtual weld curvature absolute threshold, and setting a basic curvature according to the contour vertex curvature of the non-virtual weld area;

[0038] S52, traversing all weld bead contours, when the curvature of any contour vertex is greater than the curvature threshold multiplied by the contour base curvature, identifying the weld bead contour corresponding to the current contour vertex curvature as a potential false weld contour;

[0039] S53, classifying continuous potential cold weld contours into cold weld contour groups, respectively calculating the number of contours in the cold weld contour groups, and when the number of contours in any cold weld contour group is greater than a cold weld contour number threshold, identifying the current cold weld contour group as a potential cold weld contour group;

[0040] S54, calculating the mean curvature of the potential cold weld contour group, if the mean curvature of any potential cold weld contour group is greater than the relative threshold of cold weld curvature multiplied by the contour base curvature or the absolute threshold of cold weld curvature, identifying the current cold weld contour group as a cold weld contour group.

[0041] Preferably, the step S5 further comprises:

[0042] The contour position of the cold solder joint area of ​​the sample to be tested is marked.

[0043] Preferably, the step S1 specifically includes:

[0044] The sample to be tested is laser scanned by a 3D line scan camera to obtain a depth map of the sample to be tested.

[0045] In a second aspect, the present invention provides a device for detecting a weld bead defect, characterized in that it comprises:

[0046] A first execution module is configured to obtain a depth map of a sample to be tested;

[0047] A second execution module is configured to extract a center line of the weld in the depth map;

[0048] A third execution module is configured to obtain a weld bead profile of the depth map according to the center line and the depth map;

[0049] A fourth execution module is configured to obtain a contour vertex curvature of the weld bead contour according to the weld bead contour of the depth map;

[0050] The fifth execution module is configured to identify the cold solder joint area of ​​the sample to be tested according to the curvature of the contour vertices.

[0051] Compared with the prior art, the present invention has the following beneficial effects:

[0052] The present invention utilizes depth maps and image processing technology to perform cold weld detection on the welds of the sample to be tested. On the one hand, since cold welds appear dry and rough in the depth map, while normal welds appear full and round, the detection accuracy can be improved by analyzing the cold weld detection based on the depth map. On the other hand, the present invention uses an image processing algorithm to detect the depth map of the sample to be tested, without relying on complex imaging systems, powerful computing power and a large amount of data, and avoiding the introduction of artificial intelligence models and excessive reliance on high computing power. It can effectively simplify the detection process, improve detection efficiency and reliability, and reduce detection costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0054] Figure 1 It is a flowchart of a method for detecting weld defects provided by an embodiment of the present invention.

[0055] Figure 2 It is a schematic diagram of a weld depth map having a cold weld defect provided by the weld cold weld detection method provided in an embodiment of the present invention.

[0056] Figure 3 yes Figure 1 The effect diagram after step S2 in the weld false weld detection method provided by the embodiment of the present invention is processed.

[0057] Figure 4 yes Figure 1 The effect diagram after step S3 is processed in the weld false weld detection method provided by the embodiment of the present invention.

[0058] Figure 5-1 yes Figure 1 The effect diagram after step S4 is processed in the weld false weld detection method provided by the embodiment of the present invention.

[0059] Figure 5-2 yes Figure 1 The effect diagram after step S4 is processed in the weld false weld detection method provided by the embodiment of the present invention.

[0060] Figure 6 yes Figure 1 The effect diagram after step S5 is processed in the weld false weld detection method provided by the embodiment of the present invention. DETAILED DESCRIPTION

[0061] In order to explain in detail the possible application scenarios, technical principles, specific schemes that can be implemented, and the purposes and effects that can be achieved, the following is a detailed description of the specific embodiments listed in conjunction with the accompanying drawings. The embodiments described herein are only used to more clearly illustrate the technical solutions of the present application, and are therefore only used as examples, and cannot be used to limit the scope of protection of the present application.

[0062] Embodiment 1:

[0063] See also Figure 1 , Figure 1 The method for detecting cold welds in a weld provided in an embodiment of the present invention is suitable for detecting cold welds in curved welds to make up for the deficiencies in the prior art in detecting cold welds in curved welds. Of course, the present invention can also be applied to other types of welds such as straight welds, which is not limited here.

[0064] See also Figure 1 - Figure 6 The weld bead cold welding detection method of this embodiment comprises the following steps:

[0065] S1. Obtain a depth map of the sample to be tested.

[0066] This embodiment uses Figure 2 The figure shows a weld depth map with a cold weld defect. The weld bead with successful welding in the upper part of the depth map is fuller and smoother, while the weld bead with curved cold weld in the lower part is dryer and rougher.

[0067] This embodiment will Figure 2 This is described as an example. Of course, for other forms of depth maps, reference can be made to the method steps of this embodiment, which will not be described in detail here. Figure 2 The image width and height of the depth map shown are (563*2423), and its matrix depth value is as follows:

[0068]

[0069] Preferably, the step S1 specifically includes:

[0070] The sample to be tested is laser scanned by a 3D line scan camera to obtain a depth map of the sample to be tested.

[0071] The imaging principle and method of the 3D line scan camera to obtain the depth map are not the core protection content of this patent and will not be described in detail here.

[0072] S2. Extracting the center line of the weld in the depth map.

[0073] Preferably, the step S2 specifically includes:

[0074] The weld skeleton of the weld in the depth map is extracted by an image thinning method, and the weld skeleton is used as the center line of the weld, wherein the depth map has m center lines, m≥1, and all center lines together constitute a center line point set CenLine=[(x0,y0),(x1,y1),......(x m ,y m )].

[0075] The image thinning method belongs to the prior art and will not be described in detail here. Figure 2 The center line of the depth map shown is obtained as a two-dimensional point set CenLine. Figure 3 As shown, where:

[0076] CenLine=[(396,107),(395,106),...(349,2272)].

[0077] S3. Acquire a weld bead profile of the depth map based on the center line and the depth map.

[0078] Preferably, the step S3 specifically includes:

[0079] S31, making vertical search lines at equal intervals along the center line;

[0080] S32. On each of the search lines, extract the weld bead contour of each weld bead according to the pixel position and depth value of the depth map, and the weld bead contours of all weld beads together constitute a weld bead two-dimensional contour point set ConPs.

[0081] Specifically, the step S31 includes:

[0082] S311 . Set the search line interval Gap and the search line length Length to preset values ​​respectively.

[0083] It is understandable that the preset value mentioned here may be an empirical value obtained through analysis of a large amount of historical data.

[0084] S312, starting from the starting point of the center line, setting a search line Li along the center line:

[0085] L i =(Xa i ) / A i =(Yb i ) / B i ,

[0086] Among them, the search line Li is a straight line, (a i ,b i ) is a point on the search line Li, and (ai ,b i ) are points on the center line with the spacing Gap as the spacing, (A i ,B i ) is the unit direction vector of the search line Li, and (A i ,B i ) can be calculated by principal component analysis (a i ,b i )The eigenvector of the covariance matrix composed of the domain points is obtained.

[0087] Specifically, the step S32 specifically includes:

[0088] S321, according to the search line equation, obtain the coordinate point set Ps and the corresponding depth value set Zs of the weld two-dimensional contour point set ConPs on the depth map:

[0089] Ps=[(x0,y0),(x1,y1),......(x n ,y n )],

[0090] Zs=[z0,z1,......z n ],

[0091] Wherein, n is an even number;

[0092] S322, calculating the coordinate point set Ps and the corresponding depth value set Zs of the weld bead two-dimensional contour point set ConPs on the depth map;

[0093] S323, projecting the coordinate point set Ps of the weld bead two-dimensional contour point set ConPs on the depth map onto the unit direction vector of the search line Li to obtain the abscissa of the weld bead two-dimensional contour point set ConPs, and using the depth value set Zs corresponding to the coordinate point set Ps of the weld bead two-dimensional contour point set ConPs on the depth map as the ordinate of the weld bead two-dimensional contour point set ConPs, to obtain the weld bead two-dimensional contour point set ConPs:

[0094] ConPs=[(x0 / A0,z0),(x1 / A1,z1),...(x n / A n ,z n )].

[0095] It can be understood that, since the search line Li is a straight line, the search line Li can be set as a linear equation for solution.

[0096] Since n is an even number, (x n / 2 ,y n / 2 ) is equal to the point on the linear equation of the corresponding search line Li From this we can calculate all x i , x i Substitute into the corresponding search line equation and round to get y i .z i Equal to the depth map (x i ,y i )’s position depth value.

[0097] Then, the coordinate point set Ps of the weld bead two-dimensional contour point set ConPs on the depth map is projected onto the search line direction vector to obtain the abscissa of the weld bead two-dimensional contour point set ConPs, and the ordinate of the weld bead two-dimensional contour point set ConPs is equal to the depth value set Zs on the depth map. Therefore, ConPs = [(x0 / A0, z0), (x1 / A1, z1), ... (x n / A n ,z n )], through the above operation, the effect is as follows Figure 4 shown.

[0098] S4. Acquire the contour vertex curvature of the weld bead contour according to the weld bead contour in the depth map.

[0099] Preferably, the step S4 specifically includes:

[0100] S41, traversing the ordinate values ​​of the weld bead two-dimensional contour point set ConPs, and determining the maximum ordinate value of the weld bead two-dimensional contour point set ConPs.

[0101] S42, taking the point corresponding to the maximum ordinate value of the weld bead two-dimensional contour point set ConPs as the contour vertex of the weld bead contour;

[0102] S43, calculating the curvature of the contour vertices of the weld bead contour according to the neighborhood point set of the contour vertices of the weld bead contour.

[0103] Specifically, the contour vertex curvature of the weld bead contour is calculated by a principal component analysis method or a quadratic function fitting method.

[0104] Get the curvature array Curvatures of the contour vertex curvature of the weld contour:

[0105] Curvatures=[0.579,0.576,...0.376,0.377,...0.539], the effect is shown in Figure 5.

[0106] S5. Identify the cold solder joint area of ​​the sample to be tested according to the vertex curvature of the contour.

[0107] Preferably, the step S5 specifically includes:

[0108] S51, setting a curvature threshold, a virtual weld contour quantity threshold, a virtual weld curvature relative threshold and a virtual weld curvature absolute threshold, and setting a basic curvature according to the contour vertex curvature of the non-virtual weld area.

[0109] It can be understood that in this embodiment, the curvature threshold CurT=1.4, the cold weld contour number threshold FalNumT=3, the cold weld curvature relative threshold FalCurReT=1.55, the cold weld curvature absolute threshold FalCurAbT=0.8 are set, and the curvature mean corresponding to the middle non-cold weld bead area is selected as the reference curvature BaceCurve.

[0110] S52, traversing all weld bead contours, when the curvature of any contour vertex is greater than the curvature threshold multiplied by the contour base curvature, identifying the weld bead contour corresponding to the current contour vertex curvature as a potential cold weld contour.

[0111] It can be understood that the array variables for initializing and recording the starting position, ending position and number of contours of the potential cold weld contour group correspond to Starts, Ends and Nums respectively, and the isDefCon and isDefConS state variables are used to track and analyze the curvature change.

[0112] The curvature array Curvatures of the contour vertex curvature of the weld contour is traversed from beginning to end, and the curvature value of each point is compared with the reference curvature BaceCurve×curvature threshold CurT. When it is greater than this value, isDefCon starts to accumulate until isDefCon reaches the predetermined minimum defect number FalNumT.

[0113] At this time, the value of isDefConS is set to 1, marking this contour group as a potential cold weld contour group, and continuing to expand the contour group until a normal contour is encountered.

[0114] During the traversal process, the Starts and Ends arrays are used to record the starting and ending positions of each potential virtual solder joint contour group, and Nums is used to record the number of contours.

[0115] S53, classifying continuous potential cold weld contours into cold weld contour groups, respectively calculating the number of contours in the cold weld contour groups, and when the number of contours in any cold weld contour group is greater than a cold weld contour number threshold, identifying the current cold weld contour group as a potential cold weld contour group.

[0116] It can be understood that the average curvature is calculated for each potential defect area, and if the average curvature is greater than BaceCurve×FalCurReT or greater than FalNumT, the potential cold weld contour group is confirmed as a cold weld contour group.

[0117] S54, calculating the mean curvature of the potential cold weld contour group, if the mean curvature of any potential cold weld contour group is greater than the relative threshold of cold weld curvature multiplied by the contour base curvature or the absolute threshold of cold weld curvature, identifying the current cold weld contour group as a cold weld contour group.

[0118] It is understandable that if a cold solder joint contour group is found, it is considered that a cold solder joint exists in the sample to be tested, and the contour index of the cold solder joint contour group is confirmed as the cold solder joint area.

[0119] Preferably, the step S5 further comprises:

[0120] The contour position of the cold solder joint area of ​​the sample to be tested is marked.

[0121] This embodiment Figure 1 A cold solder joint was found in the example. Figure 6 As shown below in the dark black outline.

[0122] Embodiment 2:

[0123] See also Figure 1 - Figure 6 The weld bead cold welding detection device provided by the embodiment of the present invention comprises:

[0124] A first execution module is configured to obtain a depth map of a sample to be tested;

[0125] A second execution module is configured to extract a center line of the weld in the depth map;

[0126] A third execution module is configured to obtain a weld bead profile of the depth map according to the center line and the depth map;

[0127] A fourth execution module is configured to obtain a contour vertex curvature of the weld bead contour according to the weld bead contour of the depth map;

[0128] The fifth execution module is configured to identify the cold solder joint area of ​​the sample to be tested according to the curvature of the contour vertices.

[0129] Preferably, the second execution module is specifically configured as follows:

[0130] The weld skeleton of the weld in the depth map is extracted by an image thinning method, and the weld skeleton is used as the center line of the weld, wherein the depth map has m center lines, m≥1, and all center lines together constitute a center line point set CenLine=[(x0,y0),(x1,y1),......(x m ,y m )].

[0131] Preferably, the third execution module is specifically configured as follows:

[0132] making vertical search lines at equal intervals along the center line;

[0133] On each of the search lines, the weld bead contour of each weld bead is extracted according to the pixel position and depth value of the depth map, and the weld bead contours of all weld bead together constitute a weld bead two-dimensional contour point set ConPs.

[0134] Preferably, the fourth execution module is specifically configured as follows:

[0135] Traversing the ordinate values ​​of the weld bead two-dimensional contour point set ConPs, and determining the maximum ordinate value of the weld bead two-dimensional contour point set ConPs;

[0136] The point corresponding to the maximum ordinate value of the weld bead two-dimensional contour point set ConPs is used as the contour vertex of the weld bead contour;

[0137] The curvature of the contour vertices of the weld bead contour is calculated according to the neighborhood point set of the contour vertices of the weld bead contour.

[0138] Specifically, the contour vertex curvature of the weld bead contour is calculated by a principal component analysis method or a quadratic function fitting method.

[0139] Preferably, the fifth execution module is specifically configured as follows:

[0140] Set the curvature threshold, the number threshold of virtual weld contours, the relative threshold of virtual weld curvature and the absolute threshold of virtual weld curvature, and set the basic curvature according to the contour vertex curvature of the non-virtual weld area;

[0141] Traversing all weld bead contours, when the curvature of any contour vertex is greater than the curvature threshold multiplied by the contour base curvature, the weld bead contour corresponding to the current contour vertex curvature is identified as a potential virtual weld contour;

[0142] Classifying continuous potential cold weld contours into cold weld contour groups, respectively calculating the number of contours in the cold weld contour groups, and identifying the current cold weld contour group as a potential cold weld contour group when the number of contours in any cold weld contour group is greater than a cold weld contour number threshold;

[0143] The curvature mean of the potential cold weld contour group is calculated. If the curvature mean of any potential cold weld contour group is greater than the cold weld curvature relative threshold multiplied by the contour base curvature or the cold weld curvature absolute threshold, the current cold weld contour group is identified as a cold weld contour group.

[0144] Preferably, the fifth execution module is further configured to:

[0145] The contour position of the cold solder joint area of ​​the sample to be tested is marked.

[0146] Compared with the prior art, the present invention has the following beneficial effects:

[0147] The present invention utilizes depth maps and image processing technology to perform cold weld detection on the welds of the sample to be tested. On the one hand, the cold weld appears dry and rough in the depth map, while the normal weld is full and round. Based on this characteristic difference, the detection accuracy can be improved by depth map-based cold weld detection analysis. On the other hand, the present invention uses an image processing algorithm to detect the depth map of the sample to be tested, without relying on complex imaging systems, powerful computing power and a large amount of data, and avoiding the introduction of artificial intelligence models and excessive reliance on high computing power. It can effectively simplify the detection process, improve detection efficiency and reliability, and reduce detection costs.

[0148] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for detecting weld defects, characterized in that: The steps include: Obtaining a depth map of the sample to be tested; Extracting the center line of the weld in the depth map; Acquire a weld bead profile of the depth map according to the center line and the depth map; According to the weld bead contour of the depth map, obtaining the contour vertex curvature of the weld bead contour; According to the curvature of the contour vertices, the cold solder joint area of ​​the sample to be tested is identified.

2. The method for detecting a weld bead defect as claimed in claim 1, wherein: The extracting the center line of the weld in the depth map specifically includes: The weld skeleton of the weld in the depth map is extracted by an image thinning method, and the weld skeleton is used as the center line of the weld, wherein the depth map has m center lines, m≥1, and all center lines together constitute a center line point set CenLine=[(x0, y0), (x1, y1), ... (x m ,y m )].

3. The method for detecting a weld defect as claimed in claim 2, wherein: The step of obtaining the weld bead profile of the depth map according to the center line and the depth map specifically includes: making vertical search lines at equal intervals along the center line; On each of the search lines, the weld bead contour of each weld bead is extracted according to the pixel position and depth value of the depth map, and the weld bead contours of all weld bead together constitute a weld bead two-dimensional contour point set ConPs.

4. The method for detecting a weld bead defect as claimed in claim 3, characterized in that: The step of making vertical search lines at equal intervals along the center line specifically includes: The search line spacing Gap and the search line length Length are respectively set to preset values; Starting from the starting point of the center line, a search line Li is set along the center line: L i =(X-a i ) / A i =(Y-b i ) / B i , Among them, the search line Li is a straight line, (a i , b i ) is a point on the search line Li, and (a i , b i ) are points on the center line with the spacing Gap as the spacing, (A i , B i ) is the unit direction vector of the search line Li, and (A i , B i ) can be calculated by principal component analysis (a i , b i )The eigenvector of the covariance matrix composed of the domain points is obtained.

5. The method for detecting a weld defect as claimed in claim 4, characterized in that: On each of the search lines, the weld bead contour of each weld bead is extracted according to the pixel position and depth value of the depth map, and the weld bead contours of all weld bead together constitute a weld bead two-dimensional contour point set ConPs, specifically including: According to the search line equation, the coordinate point set Ps and the corresponding depth value set Zs of the weld bead two-dimensional contour point set ConPs on the depth map are obtained: Ps=[(x0,y o ),(x1,y1),......(x n y n )], Zs=[z0,z1,......z n ], Wherein, n is an even number; Calculate the coordinate point set Ps and the corresponding depth value set Zs of the weld bead two-dimensional contour point set ConPs on the depth map; The coordinate point set Ps of the weld bead two-dimensional contour point set ConPs on the depth map is projected onto the unit direction vector of the search line Li to obtain the abscissa of the weld bead two-dimensional contour point set ConPs, and the depth value set Zs corresponding to the coordinate point set Ps of the weld bead two-dimensional contour point set ConPs on the depth map is used as the ordinate of the weld bead two-dimensional contour point set ConPs to obtain the weld bead two-dimensional contour point set ConPs: ConPs=[(x0 / A0,Z0),(x1 / A1,z1),...(x n / A n ,z n )]。 6. The method for detecting a weld defect as claimed in claim 5, characterized in that: The step of obtaining the contour vertex curvature of the weld bead contour according to the weld bead contour in the depth map specifically includes: Traversing the ordinate values ​​of the weld bead two-dimensional contour point set ConPs, and determining the maximum ordinate value of the weld bead two-dimensional contour point set ConPs; The point corresponding to the maximum ordinate value of the weld bead two-dimensional contour point set ConPs is used as the contour vertex of the weld bead contour; The curvature of the contour vertices of the weld bead contour is calculated according to the neighborhood point set of the contour vertices of the weld bead contour.

7. The method for detecting a weld defect as claimed in claim 6, wherein: The contour vertex curvature of the weld bead contour is calculated by principal component analysis or quadratic function fitting.

8. The method for detecting weld defects as claimed in claim 7, wherein: The step of identifying the cold solder joint area of ​​the sample to be tested according to the vertex curvature of the contour specifically includes: Set the curvature threshold, the number threshold of virtual weld contours, the relative threshold of virtual weld curvature and the absolute threshold of virtual weld curvature, and set the basic curvature according to the contour vertex curvature of the non-virtual weld area; Traversing all weld bead contours, when the curvature of any contour vertex is greater than the curvature threshold multiplied by the contour base curvature, the weld bead contour corresponding to the current contour vertex curvature is identified as a potential virtual weld contour; Classifying continuous potential cold weld contours into cold weld contour groups, respectively calculating the number of contours in the cold weld contour groups, and identifying the current cold weld contour group as a potential cold weld contour group when the number of contours in any cold weld contour group is greater than a cold weld contour number threshold; The curvature mean of the potential cold weld contour group is calculated. If the curvature mean of any potential cold weld contour group is greater than the cold weld curvature relative threshold multiplied by the contour base curvature or the cold weld curvature absolute threshold, the current cold weld contour group is identified as a cold weld contour group.

9. The method for detecting weld defects according to claim 1, wherein: The step of identifying the cold solder joint area of ​​the sample to be tested according to the curvature of the contour vertex further includes: The contour position of the cold solder joint area of ​​the sample to be tested is marked.

10. The method for detecting weld defects according to claim 1, wherein: The step of obtaining a depth map of the sample to be tested specifically includes: The sample to be tested is laser scanned by a 3D line scan camera to obtain a depth map of the sample to be tested.

11. A device for detecting weld defects, characterized in that: include: A first execution module is configured to obtain a depth map of a sample to be tested; A second execution module is configured to extract a center line of the weld in the depth map; A third execution module is configured to obtain a weld bead profile of the depth map according to the center line and the depth map; A fourth execution module is configured to obtain a contour vertex curvature of the weld bead contour according to the weld bead contour of the depth map; The fifth execution module is configured to identify the cold solder joint area of ​​the sample to be tested according to the curvature of the contour vertices.