A U-shaped weld detection method
Through the laser sensor and U-net network in the robot welding system, the problem of manual detection of weld quality is solved, the weld detection is automated and high-precision, and it is suitable for data format conversion of multiple devices, improving detection efficiency and accuracy.
Patent Information
- Application Number
- CN202010560213.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2020-06-17
- Filing Date
- 2020-06-18
- Publication Date
- 2025-07-08
- Estimated Expiration
- 2040-06-18
AI Technical Summary
In the prior art, weld quality inspection relies on manual inspection, which has problems such as large workload, poor environment, and poor accuracy and reliability of test results, making it difficult to ensure the standardization and scientificity of the results.
The laser sensor in the robot welding system is used to detect welds in real time, and weld defect recognition is achieved through data denoising, baseline determination, corner point detection, approximate area calculation, weld height calculation, inclination recognition and contour detection, combined with the U-net network, and image processing and deep learning technology are used to improve detection accuracy.
It realizes automation and high precision of weld detection, can effectively identify complex fault types, improves detection efficiency and accuracy, is suitable for data format conversion of various devices, and has good scalability.
Smart Images

Figure CN111724369B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the recognition of butt welds of metal sheet structures by robots in the field of automotive welding technology, and particularly to a method for detecting the surface of welds. Background Art
[0002] Welding has developed into an important processing method in the manufacturing industry and is widely used in fields such as aviation, aerospace, metallurgy, petroleum, automotive manufacturing, and national defense. In welded products, the quality of welds directly affects the service life of the products. Therefore, during the production process, it is necessary to strictly control the weld dimensions according to the design requirements and strictly control the generation of various defects.
[0003] When measuring the surface dimensions of welds and evaluating surface weld defects, the visual inspection method by manual inspection is usually used. When measuring the weld dimensions by the visual inspection method, tools such as magnifying glasses, straight rulers, and undercut measuring devices are usually used for measurement; when evaluating defects, the rating personnel need to have strong professional knowledge and rich work experience. At the same time, during the visual inspection process, the staff is easily affected by factors such as heavy workload, poor working environment, and differences in knowledge and cognition, resulting in a decrease in the accuracy of the results. In addition, during manual inspection, the inspectors are prone to fatigue after long-term inspection, leading to a decrease in the reliability of the inspection results. Therefore, it is very difficult to ensure the standardization, objectivity, and scientificity of the measurement results by the visual inspection method. Summary of the Invention
[0004] In order to solve the above problems, according to the characteristics of the robot welding industry, the present invention proposes a method for detecting U-shaped welds. During the movement of the robot, the laser sensor transmits data in real time. Using the cross-section formed by all the distance data at a certain moment on the welding trajectory as the prior information, the weld is detected. The technical solution of the present invention is as follows:
[0005] Step 1, data denoising:
[0006] Perform median filtering on the distance data of the laser sensor. Select a data point to be processed, take this data point as the middle position, and arrange all the data points within its neighborhood window with an odd length in ascending order; use the median after sorting as the value of the data point to be processed.
[0007] Step 2, determine the reference line:
[0008] In the cross-section of the weld, the reference line is the groove plane of the welded part. Determining the reference line is convenient for subsequent feature extraction and weld analysis.
[0009] Visualize all the data points of the laser sensor at a certain moment to obtain the form of a curve in the weld cross-section, set up the equation of the straight line and the undetermined coefficients;
[0010] In order for the fitted approximate curve to reflect the change trend of the given data points as much as possible, the sum of the squares of the errors between the actual values and the fitted straight line is selected as the measurement standard, that is, the minimum value of the sum of the squares of the errors under the least squares method is required.
[0011] Establish a system of equations according to the least squares method and solve it to obtain the undetermined coefficients of the fitted straight line.
[0012] Obtain the equation of the fitted straight line, and further calculate the angle between the reference line and the horizontal line. If the angle does not meet the standard, the weld is considered unqualified.
[0013] Step 3: Corner detection:
[0014] Corners, as the two boundary contact points between the weld and the plane and the inflection points of the weld, are important feature points. In order to make the corner detection more stable, the algorithm needs to meet conditions such as scale invariance, rotation invariance, and anti-noise influence. Based on the above requirements, the concept of the gray difference of adjacent pixels is proposed, and the gray change value is calculated in the image using a moving window.
[0015] Perform binarization on the weld cross-section to obtain the cross-section image.
[0016] Construct a mathematical model, calculate the gray difference of the moving window, and simplify and solve the gray change generated by the translation of the image window.
[0017] Use horizontal and vertical difference operators to filter each pixel of the cross-section image to obtain the partial derivatives in the x and y directions, and obtain the partial derivative matrix.
[0018] Perform Gaussian smoothing filtering on the partial derivative matrix to eliminate some isolated points and protrusions, and obtain a new partial derivative matrix.
[0019] Define a corner response function according to the partial derivative matrix, and calculate the corner response function corresponding to each pixel using the new partial derivative matrix. Determine whether a pixel is a corner through the corner response function value.
[0020] Suppress the local maximum of the corner response function and select its maximum value at the same time. In the corner response function, points that simultaneously meet the two conditions of being greater than a certain threshold and being the local maximum within a certain neighborhood are considered corners.
[0021] According to the obtained corners, calculate the distance between two corners, and this distance is the width of the weld. If this width value does not meet the standard, the weld is considered unqualified.
[0022] Step 4: Approximate area calculation:
[0023] The area of the weld in the weld cross-section is the area of the figure enclosed by the curve between the two corner points and the reference line. This area can be approximately calculated by the infinitesimal method. The curvilinear trapezoid is approximated by a corresponding narrow trapezoid to replace the narrow curvilinear trapezoid, and the sum of the areas of the narrow trapezoids is taken as the approximate value of the curvilinear trapezoid.
[0024] According to the calculation results of the reference line and the corner points, determine the integration interval, and divide the integration interval into several small intervals. The area of each small interval is approximately obtained by a small trapezoid;
[0025] Calculate the distance between two adjacent data points as the height of each small trapezoid, and calculate the distances from two adjacent data points to the reference line respectively as the upper base and the lower base of each small trapezoid;
[0026] According to the trapezoid area calculation formula, obtain the area of each small trapezoid, and sum up the areas of all small trapezoids. This value is the approximate value of the cross-sectional area of the weld;
[0027] If this area value does not meet the standard, the weld is considered unqualified.
[0028] Step 5: Weld height calculation:
[0029] According to the calculation results of the corner points and the reference line, select the curve segment between the corner points; calculate the distance between each data point and the reference line; select the maximum distance as the weld height; if this height value does not meet the standard, the weld is considered unqualified.
[0030] Step 6: Inclination recognition:
[0031] Select the data segment between two corner points, and convert each data point into voxel grid data;
[0032] For any two adjacent data points, judge whether the converted voxel grids satisfy eight-connectivity. If the two do not satisfy eight-connectivity, calculate the slope between the two points, and perform grid filling operations according to the slope;
[0033] Join the connected curve and the reference line to form a closed figure, and select a point inside the closed figure for four-connectivity flood filling;
[0034] Perform the following operations multiple times until the entire voxel map no longer changes: For each row of voxels, scan from left to right. If the current voxel is filled, judge whether the current voxel is an isolated point, an intermediate point, a straight-line segment point, or a boundary point that causes an increase in the connected component by removing it through a 3×3 matrix centered on this voxel. If the current node does not belong to any of the above classifications, the voxel is considered to be removed.
[0035] Construct an error formula for each point in the skeleton obtained in the previous step, and combine all error terms to obtain a least squares problem. For this least squares problem, select a corresponding learning rate and perform multiple calculation operations until the change in the solution parameter is less than the threshold or the number of iterations exceeds the set upper limit;
[0036] For the obtained central axis fitting straight line, calculate its angle with the reference line. If the angle does not meet the requirements, it is considered that tilt has occurred and the weld is unqualified.
[0037] Step 7: Contour detection:
[0038] Select multiple frames of data from multiple weld samples, filter out image data with defects such as pores, slag inclusions, and curling, and segment and annotate them to obtain a training set;
[0039] Establish a U-net network, use the obtained training set for training, and obtain the U-net network model. The U-net network structure is as follows: The contraction path of U-net is a conventional convolutional network. In the first step, perform two 3×3 convolutions, followed by a maximum pooling operation to downsample the entire image. Repeat the operation more than four times; in the second step, perform two 3×3 convolutions, use the up-convolution operation for upsampling, and trim the previous underlying feature map. Repeat the operation more than four times; in the third step, perform two 3×3 convolutions, and then perform a 1×1 convolution; in the fourth step, use the softmax function to calculate and obtain the final output;
[0040] Input the data to be tested into the trained network model for prediction, and output the prediction results;
[0041] If there is a defective area in the predicted result, the area is divided and the weld is judged to be unqualified.
[0042] The present invention proposes a complete set of U-shaped weld detection methods, which focuses on the analysis of data features based on the distance data detected by the sensor as prior information. Noise processing can remove noise information interference, further extract features such as corner points, central axis, height, width, and finally perform weld contour detection through a convolutional neural network to complete weld surface analysis. In the process, through image processing, machine learning and deep learning, the detection system can more easily identify complex fault types, with better accuracy and efficiency than traditional manual methods. At the same time, the cross-sectional data processing method in the invention can be applied to various devices, and after converting data in different formats into point cloud data, better results can be obtained, and it has good scalability. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 It is a schematic flow chart of the method of the present invention.
[0044] Figure 2 It is the cross-sectional view of the weld at a certain moment.
[0045] Figure 3 It is a sample of porosity defect.
[0046] Figure 4 It is a sample of slag inclusion defect. Specific implementation manners
[0047] During the movement of the robot, the laser sensor is fixed on the fixture at the end of the robot. The sensor collects and transmits data for analyzing the weld quality. According to the characteristics of robot welding industry, the present invention proposes a U-shaped weld detection method. Now, the cross-sectional data at a certain moment is given as an embodiment for elaboration. As Figure 1 shown, the following steps are included in this embodiment:
[0048] Step 1, data denoising:
[0049] Noises such as isolated points and outliers generated by the laser sensor will affect the accuracy of the final ideal model. Therefore, targeted removal or adjustment should be carried out according to the distribution. The noises generated by the laser sensor scanning measurement have diversity: the active non-contact covering measurement may generate useless data and outlier noises on the surface of non-measurement target objects due to environmental interference; the sharp features on the object surface and the like may cause the laser incident angle to change drastically, resulting in measurement burr noises; the laser ranging method without a cooperative target will inevitably generate tiny random noises.
[0050] Perform median filtering on the distance data of the laser sensor. When filtering a sequence xj (-∞ < j < ∞), first define a window with an odd length M, M = 2N + 1, where N is a positive integer. For a certain data point x(i) to be processed, the data samples within its neighborhood window are x(i - N), …, x(i), …, x(i + N), where x(i) is the data sample value located at the center of the window. After arranging these M sample values in ascending order, the median value, the sample value at i, is defined as the output value of the median filtering. Perform the above median filtering operation on all data points;
[0051] Through experiments, when M = 65, the median filtering has a good result in removing the noise of the data.
[0052] Step 2, determination of the reference line:
[0053] As Figure 2 shown, determine the reference line L for subsequent feature extraction and weld analysis.
[0054] Visualize all the distance data points of the laser sensor at a certain moment, analyze the form of the curve, and it can be determined that the form of the fitting curve is a straight line, and the equation is y = ax + b;
[0055] For the curve fitting function φ(x), it is not required to strictly pass through all data points (x i , y i ). That is to say, the deviation (also known as the residual) of the fitting function φ(x) at x i is not strictly equal to zero, which is a system of inconsistent equations:
[0056]
[0057] In order for the approximate curve of the fitting to reflect the change trend of the given data points as much as possible, the sum of the squares of the errors between the actual values and the fitting line is selected as the measurement standard, that is, the minimum value of the sum of the squares of the errors under the least squares method is required:
[0058]
[0059] According to the least squares method, the normal equations are established and solved to obtain the undetermined parameters a and b of the baseline equation:
[0060]
[0061] After obtaining the baseline equation L, calculate the angle between the baseline and the horizontal line. It can be known that the slope of the baseline L equation is a, and the angle θ between it and the horizontal line L0 is arctan a.
[0062] Obtain the fitting line equation, and further calculate the angle between the baseline and the horizontal line. If the angle does not meet the standard, the weld is considered unqualified.
[0063] Step 3: Corner detection:
[0064] As Figure 2 shown, the corner points B and C, as the two boundary contact points between the weld and the plane and the inflection points of the curve, are important feature points. In order to make the corner detection more stable, the algorithm needs to meet conditions such as scale invariance, rotation invariance, and anti-noise influence. Based on the above requirements, the concept of the gray difference of adjacent pixel points is proposed, and the gray change value is calculated in the image using a moving window.
[0065] Perform binarization operation on the weld cross-section to obtain the cross-section image;
[0066] Construct a mathematical model to calculate the gray difference of the moving window. Translating the image window by [u, v] generates a gray change E(u, v) as:
[0067] E(u, v) = ∑w(x, y)[I(x + u, y + v) - I(x, y)] 2
[0068] In order to reduce the computational amount, the Taylor series is used to simplify the formula:
[0069] From \(I(x + u, y + v)=I(x, y)+I_{u}u + I_{v}v+O(u, v)\) x \(u + I_{v}v+O(u\) y , \(v)\) 2 , \(v\) 2 )
[0070] We get: \(E(u, v)=\sum w(x, y)[I_{u}u + I_{v}v+O(u\) x \(u + I_{v}v+O(u\) y , \(v)\) 2 , \(v\) 2 )]
[0071]
[0072] For a local tiny displacement \([u, v]\), the following expression can be approximately obtained:
[0073] \(E(u, v)\approx[u, v]M\)
[0074] where \(M\) is a \(2\times2\) matrix, which can be obtained from the reciprocal of the image:
[0075]
[0076] Filter each pixel of the cross-sectional image using horizontal and vertical difference operators to obtain \(I_{u}\) x , \(I_{v}\), and further the partial derivative matrix \(M\) can be obtained; y Perform Gaussian smoothing filtering on the four elements of the partial derivative matrix \(M\) to eliminate some unnecessary isolated points and protrusions, obtaining a new matrix \(M\);
[0077] \(M\) is the covariance matrix of the gradient. In practical applications, in order to be able to apply better programming, a corner response function \(R\) is defined, and whether a pixel is a corner is judged by determining the magnitude of \(R\);
[0078] Perform local maximum suppression on the corner response function \(R\) and select its maximum value at the same time. In the corner response function \(R\), points that simultaneously satisfy \(R(i, j)\) being greater than a certain threshold and \(R(i, j)\) being the local maximum within a certain neighborhood are considered corners;
[0079] According to the obtained corners \(B\) and \(C\), calculate the distance \(d\) between the two corners as:
[0080]
[0081]
[0082] This distance is the width of the weld. If this width value does not meet the standard, the weld is considered unqualified.
[0083] Step 4, approximate area calculation:
[0084] Such as Figure 2As shown in the figure, the cross-sectional area of the weld seam is the area of the figure enclosed by the curve between the two corner points B and C and the reference line L. This area can be approximately calculated using the infinitesimal method. The curved trapezoid is approximated by a corresponding narrow trapezoid to replace the narrow curved trapezoid, and the sum of the areas of the narrow trapezoids is taken as the approximate value of the curved trapezoid area.
[0085] Based on the calculation results of the reference line and the corner points, determine the integration interval and divide the integration interval into several small intervals. The area of each small interval is approximately obtained using a small trapezoid;
[0086] Calculate the distance between two adjacent data points as the height of each small trapezoid, that is, the distance between the point (x i , y i ) and the point (x i+1 , y i+1 ):
[0087]
[0088] Calculate the distances from two adjacent data points (x i , y i ), (x i+1 , y i+1 ) to the reference line as the upper and lower bases of each small trapezoid. Let the function values of the function y = f(x) corresponding to each sub-point be y0, y1, …, y n . Then, for each small trapezoid in the integration interval, the upper base d1 is the distance from the point (x i , y i ) to the reference line L, and the lower base d2 is the distance from the point (x i+1 , y i+1 ) to the reference line L:
[0089]
[0090] According to the trapezoid area calculation formula, obtain the area of each small trapezoid and sum the areas of all small trapezoids. This value is the approximate value of the cross-sectional area of the weld seam;
[0091] If this area value does not meet the standard, the weld seam is considered unqualified.
[0092] Step 5: Weld height calculation:
[0093] As Figure 2 shown in the figure, based on the calculation results of the corner points B and C and the reference line, select the curve segment between the corner points B and C and calculate the distance between each data point in the segment and the reference line L (y = ax + b):
[0094]
[0095] Select the farthest distance as the weld height h. If this height value does not meet the standard, the weld is considered unqualified.
[0096] Step 6, Inclination Recognition:
[0097] Select the data segment between two corner points, and convert each data point (x i , y i ) into voxel grid data (x′ i , y′ i ). Assume that a voxel grid represents an l×l grid in the data points, then (x′ i , y′ i ) = (x i , y i ) ÷ l;
[0098] For any two adjacent point cloud points, determine whether the converted voxel grids satisfy eight-connectivity. If they do not satisfy eight-connectivity, calculate the slope k between the two points, and perform grid filling operations according to the slope:
[0099] I The slope does not exist: Start from the lower grid and fill the grid upward to the upper grid;
[0100] II The absolute value of the slope is less than or equal to 1. Start from the left point, maintain an increment value. Each time an operation is performed, the filling grid is increased by 1 along the x-axis, and then the slope k is added to the increment value. If the absolute value of the increment value is greater than 0.5 at this time, the filling grid is moved one grid along the y-axis and filled accordingly (if the increment value is positive, the y value is increased by 1, otherwise, the y value is decreased by 1), otherwise the filling grid does not move along the y-axis and is filled. After that, the increment value is increased or decreased by 1 to make its absolute value less than 0.5;
[0101] III The absolute value of the slope is greater than 1. Start from the lower point, maintain an increment value. Each time an operation is performed, the filling grid is increased by 1 along the y-axis, and then the slope k is added to the increment value. If the absolute value of the increment value is greater than 0.5 at this time, the filling grid is moved one grid along the x-axis and filled accordingly (if the increment value is positive, the x value is increased by 1, otherwise, the x value is decreased by 1), otherwise the filling grid does not move along the x-axis and is filled. After that, the increment value is increased or decreased by 1 to make its absolute value less than 0.5;
[0102] Join the connected curve and the reference line L to form a closed figure, and select a point inside the closed figure for four-connected flood filling;
[0103] Perform the following operation multiple times until the entire voxel map no longer changes: For each row of voxels, scan from left to right. If the current voxel is filled, use the 3×3 matrix centered on the voxel to determine whether the current voxel is an isolated point, an intermediate point, a straight line segment point, or a boundary point that will increase the connected components after removal. If the current node does not belong to any of the above categories, the voxel is considered to be removed;
[0104] Each point (x i ,y i )Construct error formula (kx i +by i ) 2 , combining all error terms, we can get the least squares problem:
[0105]
[0106] Calculate the derivatives of k and b, and we get:
[0107]
[0108] For this least squares problem, select the corresponding learning rate α and perform multiple calculation operations until the change of the solution parameters k and b is less than the threshold or the number of iterations exceeds the set upper limit;
[0109] For the obtained central axis fitting straight line, calculate its angle with the reference line. If the angle does not meet the requirements, it is considered that tilt has occurred and the weld is unqualified.
[0110] Step 7: Contour detection:
[0111] 1) Select multiple frames of data from multiple weld samples and filter out those with pores (such as Figure 3 ) or slag inclusions (such as Figure 4 ) and other defects, and segment and annotate them to obtain a training set;
[0112] 2) Establish a U-net network, and use the training set obtained in 1) to train the U-net network to obtain a U-net network model. The U-net network structure is as follows:
[0113] The contraction path of I U-net is a conventional convolutional network, which first performs two 3×3 convolutions, followed by a maximum pooling operation to downsample the entire image. Repeat the operation four or more times;
[0114] II For the result in I, perform two 3×3 convolutions, then upsample using the up-convolution operation and crop the previous bottom feature map. Repeat the operation four times or more;
[0115] III For the results in II, perform two 3×3 convolutions and then one 1×1 convolution;
[0116] IV Calculate the results in III using the softmax function to obtain the final output;
[0117] 3) Input the data to be detected into the U-net network model obtained in 2) for prediction and output the prediction results;
[0118] 4) If there are defective areas in the prediction results in 3), divide the areas and issue a warning.
[0119] In this article, specific examples are used to elaborate on the principles and implementation methods of the present invention. The descriptions of the above embodiments are only used to help understand the method and its core idea of the present invention. It should be noted that for those of ordinary skill in the art of this technology, without departing from the principles of the present invention, several improvements and modifications can still be made to the present invention, and these improvements and modifications also fall within the protection scope of the claims of the present invention.
Claims
1. A U-shaped weld detection method, characterized in that, The weld detection method includes the following steps: Baseline determination step: Obtain laser sensor data and determine the baseline of the weld cross-section; Corner point detection step: Obtain the corner points of the curve in the weld cross-section based on the gray difference of adjacent pixel points, and calculate the weld width; Approximate area calculation step: Obtain the approximate area of the weld cross-section by the infinitesimal method; Weld height calculation step, which includes: Perform binarization operation on the weld cross-section to obtain a cross-sectional image; Construct a mathematical model, calculate the gray difference of the moving window, and simplify and solve the gray change generated by the translation of the image window; Use horizontal and vertical difference operators to filter each pixel of the cross-sectional image to obtain the partial derivatives in the x and y directions, and obtain a partial derivative matrix; Perform Gaussian smoothing filtering on the partial derivative matrix to eliminate some isolated points and protrusions, and obtain a new partial derivative matrix; Define a corner response function according to the partial derivative matrix, and use the new partial derivative matrix to calculate the corner response function corresponding to each pixel, and judge whether the pixel is a corner point through the corner response function value; Perform local maximum suppression on the corner response function, and at the same time select its maximum value. In the corner response function, the points that simultaneously satisfy the two conditions of being greater than a certain threshold and being a local maximum within a certain domain are considered corner points; According to the obtained corner points, calculate the distance between two corner points, and this distance is the weld width; Among them, in the corner response function, the points that simultaneously satisfy the two conditions of being greater than a certain threshold and being a local maximum within a certain domain are considered corner points; Tilt recognition step: Convert the data points into voxel grid data, perform filling and removal operations on the voxel grid data according to the slope to obtain the curve center axis, and calculate the angle between the center axis and the baseline to obtain the weld tilt angle; Contour detection step: Establish a U-net network, and use the training set obtained by segmentation annotation to train the convolutional neural network to obtain a U-net network model.
2. The U-shaped weld detection method according to claim 1, characterized in that It also includes a data denoising step, which includes: Select a data point to be processed; Taking this data point as the middle position, arrange all the data points in the neighborhood window with an odd length in ascending order; Use the median value after sorting as the value of the data point to be processed.
3. The U-shaped weld detection method according to claim 1, wherein The baseline determination step includes: Visualize all the data points of the laser sensor at a certain moment to obtain the form of the curve in the weld cross-section, and set the equation of the straight line and the undetermined coefficients; Establish an equation system for the curve according to the least squares method and solve it to obtain the undetermined coefficients of the fitted straight line; Obtain the fitted straight line equation; Calculate the angle between the baseline and the horizontal line.
4. The U-shaped weld detection method according to claim 1, wherein The approximate area calculation step includes: According to the calculation results of the baseline and corner points, determine the integration interval, and divide the integration interval into several small intervals. The area of each small interval is approximately obtained by a small trapezoid; Calculate the distance between two adjacent data points as the height of each small trapezoid, and calculate the distances from two adjacent data points to the baseline as the upper base and lower base of each small trapezoid respectively; According to the trapezoid area calculation formula, obtain the area of each small trapezoid, and sum the areas of all small trapezoids. This value is the approximate value of the cross-sectional area of the weld.
5. The U-shaped weld detection method according to claim 1, wherein, The weld height calculation step includes: According to the calculation results of the corner points and the reference line, the curve segment between the corner points in the weld section is selected; Calculate the distance between each data point and the baseline; Select the maximum distance as the weld height.
6. The U-shaped weld detection method according to claim 1, characterized in that, The tilt recognition step comprises: Select the data segment between two corner points and convert each data point into voxel grid data; For any two adjacent data points, determine whether the voxel grid satisfies eight connectivity. If the two do not satisfy eight connectivity, calculate the slope between the two points and perform grid filling operations based on the slope. The connected curves and baselines are spliced to form a closed figure, and a point in the closed figure is selected to perform four-way flood filling; Perform the following operation multiple times until the entire voxel map no longer changes: For each row of voxels, scan from left to right. If the current voxel is filled, use the 3×3 matrix centered on the voxel to determine whether the current voxel is an isolated point, an intermediate point, a straight line segment point, or a boundary point that will increase the connected components after removal. If the current node does not belong to any of the above categories, the voxel is considered to be removed. Construct an error formula for each point in the obtained skeleton, combine all error terms to obtain the least squares problem, select the corresponding learning rate for the least squares problem, and perform multiple calculation operations until the change in the solution parameter is less than the threshold or the number of iterations exceeds the set upper limit; For the obtained median axis fitting line, calculate the angle between it and the reference line.
7. The U-shaped weld detection method according to claim 1, characterized in that, The contour detection step comprises: Select multiple frames of data from multiple weld samples, filter out images with defects such as pores and slag inclusions, and segment and calibrate them to obtain a training set; Establish a U-net network, use the labeled training set for training, and obtain a U-net network model; Input the data to be tested into the trained network model for prediction, and output the prediction results; If there are defective areas in the predicted results, the areas will be divided and a weld failure prompt message will be issued.
8. The weld detection method according to claim 7, characterized in that, The grid filling operation according to the slopes of two adjacent data points also includes: Ⅰ Slope does not exist: Start from the lower grid and fill the grid upwards to the upper grid; Ⅱ The absolute value of the slope is less than or equal to 1. Starting from the left point, maintain an increment value. Each operation will increase the filling grid along the x-axis by 1, and then increase the slope k on the increment value. If the absolute value of the increment value is greater than 0.5 at this time, the filling grid will be moved one grid on the y-axis and filled. If the increment value is positive, the y value is increased by 1, otherwise, the y value is reduced by 1. Otherwise, the filling grid will not be moved on the y-axis and filled. Then, the increment value is increased or decreased by 1 to make its absolute value less than 0.5; Ⅲ The absolute value of the slope is greater than 1. Starting from the lower point, maintain an increment value. Each operation will increase the filling grid along the y-axis by 1, and then increase the slope k to the increment value. If the absolute value of the increment value is greater than 0.5 at this time, the filling grid will be moved one grid on the x-axis and filled. If the increment value is positive, the x value is increased by 1, otherwise, the x value is reduced by 1. Otherwise, the filling grid will not move on the x-axis and fill. Then, the increment value will be increased or decreased by 1 to make its absolute value less than 0.5.
Citation Information
Patent Citations
Weld appearance shape based on line laser scanning and surface defect detection method
CN104697467A
Laser brazing weld surface defect detection method based on envelope line recognition
CN110987944A