D-type welding seam detection method
Through the method of 3D scanning, data pre -processing and edge extraction of type D welded seams, the problem of low accuracy of the D -type weld recognition accuracy is solved, and high -precision welded seam edge extraction and recognition is realized.
Patent Information
- Application Number
- CN202411229544.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-03
- Publication Date
- 2025-01-28
AI Technical Summary
The recognition accuracy of D-type welds is low, mainly because the point cloud data collected by 3D sensors contain point clouds inside the holes, which affects the accuracy of edge extraction.
Adopt a D -type weld detection method, including 3D scanning on the openings of the openings, sampling three -dimensional contour data, performing data downshift and inner wall filtering, extracting the D -type welded trajectory, and de -no -noise through cylindrical fitting and point projection. Finally extract the edge point of the weld and sort.
Effectively extract the edge point of the D -shaped welding, which improves the accuracy of weld recognition, and meets the needs of high -precision weld identification during the welding process.
Smart Images

Figure CN119379591A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and in particular to a D-type weld detection method. Background Art
[0002] D-type weld is a common welding form in industrial manufacturing. Its quality is directly related to the safety and reliability of the product. Figure 1 As shown, Figure 1 The intersection line formed on the surface of two circular tubular weldments when they intersect vertically is the intersection line. When welding, the two pipes need to be welded along this intersection line, which is also called a D-type weld. With the development of three-dimensional scanning technology and the rapid development of artificial intelligence technology, welding robots have also developed rapidly, and automatic welding using welding robots has been increasingly used.
[0003] The key technologies of automatic welding technology include weld recognition, path planning, trajectory tracking and weld quality control. Among them, the accuracy and real-time performance of weld recognition are key indicators for evaluating welding processes. Weld recognition technology relies on sensor technology. The sensor determines the weld position and guides the welding gun along the actual trajectory for welding. Therefore, weld recognition is crucial in the robotic welding process, and its recognition accuracy directly affects the overall quality of welding. The recognition of D-type welds is actually the identification of intersection lines. When two pipes intersect vertically, a hole needs to be opened in one pipe first. After the other pipe is inserted into the hole, the intersection line of the two pipes overlaps with the outer edge of the hole. From a spatial perspective, the shape of the D-type weld is a three-dimensional shape. Due to the influence of the wall thickness of the perforated pipe, the edge of the D-type weld collected by the 3D sensor basically contains an inner hole point cloud, such as Figure 2 As shown in the figure, this part of the point cloud will affect the accuracy of edge extraction, resulting in low accuracy in D-type weld recognition. Summary of the invention
[0004] To this end, the present invention provides a D-type weld detection method, which can effectively extract the edge points of the D-type weld and perform accurate detection of the weld edge points, thus solving the above-mentioned problem well.
[0005] In order to achieve the purpose of the present invention, the following technical solutions are adopted:
[0006] A D-type weld detection method, characterized by comprising the following steps:
[0007] Step 1: Perform 3D scanning on the perforated pipe fittings, sample the 3D contour data of the perforated pipe fittings, and obtain the sampled original point cloud data;
[0008] Step 2: preprocessing the original point cloud data, including data downsampling and inner wall point filtering, to obtain preprocessed point cloud data;
[0009] Step 3: Extract the D-type weld trajectory from the point cloud data obtained after preprocessing.
[0010] The D-type weld detection method, wherein step 2 comprises:
[0011] Step 2.1, data downsampling;
[0012] Step 2.2: Inner wall point filtering.
[0013] 3. The D-type weld detection method according to claim 2, characterized in that step 2.2 comprises:
[0014] (1) Cylindrical fitting;
[0015] (2) Eliminate points on the inner wall of the circular hole.
[0016] The D-type weld detection method, wherein step 3 comprises:
[0017] 3.1 Weld edge extraction;
[0018] 3.2 Sorting of weld edge points;
[0019] 3.3 Extract weld trajectory.
[0020] 5. The D-type weld detection method according to claim 2, characterized in that step 2.1 comprises:
[0021] (1) Divide the point cloud data into multiple voxels;
[0022] (2) For each voxel, calculate its center of mass;
[0023] (3) Voxel replacement
[0024] The D-type weld detection method, wherein:
[0025] (2) For each voxel, calculate its center of mass as follows:
[0026]
[0027] Among them, c ijk is the centroid of the body, N is the number of sampling points in the voxel, x n ,y n ,z n are the coordinates of the nth point within the voxel.
[0028] The D-type weld detection method, wherein:
[0029] (3) Voxel replacement is performed as follows:
[0030] Determine whether the body centroid is a sampling point in the voxel. If so, replace the voxel with the body centroid.
[0031] The D-type weld detection method, wherein: if not, the distance d from all sampling points in the voxel to the centroid is calculated n , the formula is as follows:
[0032]
[0033] Among them, c x,ijk ,c y,ijk ,c z,ijk are the x, y, and z coordinates of the center of mass, respectively;
[0034] Find d n The smallest point P min , as follows:
[0035]
[0036] Indicates taking the minimum value, that is, when the formula behind this symbol reaches the minimum value, d n The value of
[0037] The point with the smallest dn is used as the centroid of the voxel, called the optimized centroid, and the voxel is replaced by the optimized centroid.
[0038] The D-type weld detection method, wherein:
[0039] (1) Cylindrical fitting is performed as follows:
[0040] Based on the downsampled point cloud data, a cylinder is fitted. The cylinder fitting formula is as follows:
[0041] (x-x0) 2 +(y-y0) 2 +(z-z0) 2 -[m*(x-x0)+n*(y-y0)+k*(z-z0)] 2 =R 2
[0042] (x0, y0, z0): coordinates of a point on the axis of the fitting cylinder;
[0043] (m, n, k): direction vector of the fitted cylinder axis;
[0044] (x, y, z): coordinates of the downsampled point;
[0045] R: radius of the fitted cylinder;
[0046] The downsampled points are substituted into the above formula points through the least squares method and solved jointly to obtain the fitted cylinder parameters (x0, y0, z0), (m, n, k) and R.
[0047] The D-type weld detection method, wherein:
[0048] (2) The points on the inner wall of the circular hole are eliminated as follows:
[0049] Project the original point cloud data onto the side of the fitted cylinder, extract the edge on the projected point cloud, let A(x0, y0, z0) be a point on the central axis of the fitted cylinder, R be the radius of the fitted cylinder, P be any point in the original point cloud data, P" be the projection point of P on the side of the fitted cylinder, the projection point P" on the side of the fitted cylinder is expressed as follows:
[0050]
[0051] Among them, P' is the projection point of point P in the original point cloud data on the cylinder axis, where:
[0052]
[0053] is the vector passing through the origin and perpendicular to the cylinder axis:
[0054] For vector Model;
[0055] is the direction vector of the fitted cylinder axis, i.e. (m, n, k);
[0056] is a vector Model;
[0057]
[0058] is the vector from A to P;
[0059] A is the vector pointing to P';
[0060] All points in the original point cloud data are projected and calculated according to the above formula, and all points in the initial point cloud data are projected onto the fitting cylinder.
[0061] The D-type weld detection method, wherein in step 3:
[0062] 3.1 Weld edge extraction includes
[0063] The points in the projected point P" set are judged point by point, n points around the point to be judged are extracted, the n points are fitted to a plane, and the point to be judged and the n points are projected to a two-dimensional plane through the normal vector of the plane;
[0064] Then construct the vector AB formed by the projected point A and the projected points of the other n points, and calculate the angle a=arctan(y|x) of the vector AB in the XOY coordinate system, where x and y are the lengths of the vector AB on the x and y axes respectively;
[0065] Sort the angles calculated above, and calculate the difference between adjacent angles after sorting to obtain the maximum angle difference:
[0066]
[0067] Among them, Diff Angle max : Maximum angle difference, Angle n : The nth angle, and finally according to the input angle threshold Thresh and Diff Angle max In contrast, if Diff Angle max If it is less than the threshold, the point to be determined is an edge point, otherwise it is a non-edge point;
[0068] Repeat the above operation until all points P" are judged.
[0069] The D-type weld detection method, wherein in step 3:
[0070] 3.2 The weld edge point sorting includes:
[0071] (1) Calculate the edge point center O as follows:
[0072]
[0073] Assume the number of edge points is n, (x1, y1), (x2, y2), ..., (x n ,y n ) The coordinates of the n edge points in the XY coordinate system, (xi,yi) is used to represent the coordinates of the n edge points, and (Ox,Oy) is the coordinates of the center point of the n edge points;
[0074] (2) Construct the vectors of each edge point and the center coordinate O Calculate the angle between each vector and the X-axis as follows:
[0075] 1. Calculate the modulus of vector OP:
[0076] 2. Calculate the cosine of the angle between vector OP and the x-axis:
[0077] 3. Use the arccosine function (arccos) to calculate the angle:
[0078]
[0079] The calculation method of other edge points is the same as above. Finally, the calculated angles are sorted to obtain the sorted edge points.
[0080] A computer-readable storage medium stores a computer program, and the computer program implements the above method when executed by a processor.
[0081] An electronic device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the above method is implemented when the processor executes the program. BRIEF DESCRIPTION OF THE DRAWINGS
[0082] Figure 1 It is a schematic diagram of the D-type weld shape;
[0083] Figure 2 It is a schematic diagram of the inner wall points of the circular hole;
[0084] Figure 3 Schematic diagram of voxel filtering;
[0085] Figure 4 Schematic diagram of the result after downsampling the original point cloud data
[0086] Figure 5 It is a schematic diagram of the cylinder fitting results;
[0087] Figure 6 This is a schematic diagram of the point cloud projection principle;
[0088] Figure 7 This is a schematic diagram of the result after projection;
[0089] Figure 8 A schematic diagram of a vector formed by the projected point A to be projected and the points after projection of other n points;
[0090] Fig. 9 This is a schematic diagram of edge point extraction results;
[0091] Fig.10 Schematic diagram of edge point sorting;
[0092] Fig.11 This is a schematic diagram of the results of sorting by angle;
[0093] Fig.12 is a schematic diagram of the fitting weld trajectory curve;
[0094] Fig.13It is a schematic diagram of the standard trajectory curve;
[0095] Fig.14 Schematic diagram for visual comparison between the fitted weld trajectory curve and the standard trajectory curve. DETAILED DESCRIPTION
[0096] The following is combined with Figure 1-14 , the specific implementation methods of the present invention are described in detail. Obviously, the described embodiments are only some embodiments of the present invention, rather than all embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present invention. The implementation methods are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.
[0097] "One embodiment" or "some embodiments" described in this specification means that one or more embodiments of the present invention include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, in this specification, the terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized.
[0098] The D-type weld detection method of the present invention comprises the following steps:
[0099] Step 1: Use a 3D line laser profiler to scan the perforated pipe fitting, collect the three-dimensional profile data of the perforated pipe fitting, and obtain the original point cloud data after sampling;
[0100] Step 2: preprocessing the original point cloud data, including data downsampling and inner wall point filtering, to obtain preprocessed point cloud data;
[0101] Step 3: Extract the D-type weld trajectory from the point cloud data obtained after preprocessing.
[0102] Specifically:
[0103] The amount of original point cloud data obtained in step 1 is large, which will cause the subsequent point cloud processing to take a long time. In addition, due to the influence of the width of the sensor's own laser line and the sensor angle, there will be point clouds on the inner wall of the hole at the intersection line in the original point cloud, which will affect the subsequent extraction of the real intersection line. Therefore, based on the above two points, it is usually necessary to perform necessary preprocessing operations on the original point cloud data.
[0104] Step 2 includes:
[0105] Step 2.1: Data downsampling
[0106] The purpose of data downsampling is to reduce the resolution of the original point cloud, which has the advantage that the amount of data for subsequent data processing will be greatly reduced, thereby increasing the data processing speed. In the present invention, the resolution of the point cloud is reduced by performing voxel filtering on the point cloud data.
[0107] (1) Divide the point cloud data into multiple voxels (cube units): Convert the point cloud data into a series of small cubes, each of which is called a voxel. The smaller the voxel volume, the greater its number, and vice versa. The volume of the voxel can be adjusted as needed, and the present invention does not impose any special limitation on this.
[0108] (2) For each voxel, calculate its center of mass. The formula is as follows:
[0109]
[0110] Among them, c ijk is the centroid of the body, N is the number of sampling points in the voxel, x n ,y n ,z n are the coordinates of the nth point within the voxel.
[0111] (3) Voxel replacement
[0112] Determine whether the centroid of the body is a sampling point in the voxel. If so, replace the voxel with the centroid of the body. If not, calculate the distance d from all sampling points in the voxel to the centroid. n , the formula is as follows:
[0113]
[0114] Among them, c x,ijk ,c y,ijk ,c z,ijk are the x, y, and z coordinates of the center of mass, respectively.
[0115] Find d n The smallest point P min , as follows:
[0116]
[0117] Indicates taking the minimum value, that is, when the formula behind this symbol reaches the minimum value, d n The value of .
[0118] The point with the smallest dn is used as the centroid of the voxel, called the optimized centroid, and the voxel is replaced by the optimized centroid.
[0119] like Figure 3As shown, the red point shown in (d) is the centroid, and the blue point is its nearest point, that is, the point used as the last downsampling point and is used to replace the voxel.
[0120] The result after downsampling the original point cloud data is as follows Figure 4 The present invention can effectively reduce the sampling rate through the above-mentioned optimized voxel filtering method, and avoid the inaccuracy caused by directly replacing voxels with centroids.
[0121] Step 2.2: Inner wall point filtering
[0122] like Figure 2 As shown in the figure, based on the point cloud data acquired by the 3D sensor, there are some inner hole points (circular hole inner wall points) at the edge, and there is mis-extraction for extracting the weld edge. Therefore, before extracting the D-type weld, it is necessary to remove the inner hole points, that is, to filter the inner wall points. The present invention provides an effective inner hole point removal method for the D-type weld inner hole point cloud, and the main steps include cylindrical fitting, circular hole inner wall point elimination, etc., as follows.
[0123] (1) Cylindrical fitting
[0124] Based on the downsampled point cloud data, a cylinder is fitted. The cylinder fitting formula is as follows, which can be solved by the least squares method:
[0125] (x-x0) 2 +(y-y0) 2 +(z-z0) 2 -[m*(x-x0)+n*(y-y0)+k*(z-z0)] 2 =R 2
[0126] (x0, y0, z0): coordinates of a point on the axis of the fitting cylinder;
[0127] (m, n, k): direction vector of the fitted cylinder axis;
[0128] (x, y, z): coordinates of the downsampled point;
[0129] R: radius of the fitted cylinder;
[0130] The downsampled points are substituted into the above formula points through the least square method and solved jointly to obtain (x0, y0, z0), (m, n, k) and R. The fitting cylinder can be obtained through these three values.
[0131] The effect after fitting is as follows Figure 5 As shown, the white points are the original point cloud and the red points are the fitted cylinders. In the left figure, the white points are the original point cloud and the red points are the fitted cylinders; the middle figure is the original point cloud displayed separately; the right figure is the fitted cylinder displayed separately.
[0132] (2) Elimination of points on the inner wall of the circular hole
[0133] In order to eliminate the inner wall points of the circular hole, the present invention proposes a projection elimination method as follows:
[0134] Project the original point cloud data onto the side of the fitting cylinder and extract the edge on the projected point cloud, such as Figure 6 As shown in the figure, A(x0, y0, z0) is a point on the central axis of the fitted cylinder, R is the radius of the fitted cylinder, P is any point in the original point cloud data, P" is the projection point of P on the side of the fitted cylinder, and the projection point P" on the side of the fitted cylinder is expressed as follows:
[0135]
[0136] Among them, P' is the projection point of point P in the original point cloud data on the cylinder axis, where:
[0137]
[0138] is the vector passing through the origin and perpendicular to the cylinder axis:
[0139] For vector Model;
[0140] is the direction vector of the fitted cylinder axis, i.e. (m, n, k);
[0141] is a vector Model;
[0142]
[0143] is the vector from A to P;
[0144] A is the vector pointing to P'.
[0145] Through the above formula, all the points in the original point cloud data are projected and calculated according to the above formula. The result after projection is as follows Figure 7 shown.
[0146] In the above manner, the points on the inner wall of the circular hole are eliminated.
[0147] Step 3 includes:
[0148] The projected point P" set is processed as follows:
[0149] 3.1 Weld edge extraction
[0150] Edge extraction: The points in the projected point P" set are judged point by point, and n points around the point to be judged are extracted. The optional n can take any value in the set [10-30]. The n points are fitted to the plane through the PCA (principal component analysis) method, and the point to be judged and the n points are projected onto the two-dimensional plane through the normal vector of the plane, as shown in the figure above.
[0151] Then construct the vector formed by the projected point A and the projected points of other n points (such as point B, D, etc.) and etc. Figure 8 As shown, the angle a=arctan(y / x) of the vector AB in the XOY coordinate system is calculated, where x and y are the lengths of the vector AB on the x and y axes respectively.
[0152] Similarly, the angle between the projection point A and the projection vector of the other n points can be calculated. Then, the angles calculated above are sorted, and the difference between the adjacent angles after sorting is calculated to obtain the maximum angle difference:
[0153]
[0154] Among them, Diff Angle max : Maximum angle difference, Angle n : The nth angle, and finally according to the input angle threshold Thresh (for example, 90 degrees can be selected) and Diff Angle max In contrast, if Diff Angle max If it is less than the threshold, the point to be determined is an edge point, otherwise it is a non-edge point.
[0155] Repeat the above operation until all points P" are judged.
[0156] The extraction results are as follows Fig. 9 As shown, the white points are the projected point cloud and the red points are the extracted edge points.
[0157] Step 3 also includes:
[0158] 3.2 Weld edge point sorting
[0159] The present invention sorts edge points based on angle size, such as Fig.10 As shown:
[0160] (1) Calculate the edge point center O as follows:
[0161]
[0162] Assume the number of edge points is n, (x1, y1), (x2, y2), ..., (x n,y n ) The coordinates of the n edge points in the XY coordinate system, (xi,yi) is used to represent the coordinates of the n edge points, and (Ox,Oy) is the coordinates of the center point of the n edge points;
[0163] (2) Construct the vectors of each edge point and the center coordinate O Calculate the angle between each vector and the X-axis as follows:
[0164] 1. Calculate the modulus of vector OP:
[0165] 2. Calculate the cosine of the angle between vector OP and the x-axis:
[0166] 3. Use the arccosine function (arccos) to calculate the angle:
[0167]
[0168] The calculation method of other edge points is the same as above. Finally, the calculated angles are sorted to obtain the sorted edge points.
[0169] The sorting results are as follows Fig.11 As shown, for ease of viewing, only some of the sorted points are shown.
[0170] Step 3 also includes:
[0171] 3.3 Extracting weld trajectory
[0172] Based on the above steps, the sorted weld trajectory points are obtained. The trajectory is non-smooth and not friendly to robot walking. Therefore, it is necessary to plan the weld trajectory. The present invention mainly uses the B-spline cubic curve method to fit the weld points. The fitting effect is as follows: Fig.12 As shown, the red points are the fitted curves and the white points are the extracted weld points.
[0173] In order to verify the accuracy of the above-mentioned D-type weld retrieval method of the present invention, the present invention extracts the standard weld trajectory line in the CAD model, such as Fig.13 As shown, Fig.12 The fitting weld trajectory curve shown is Fig.13 The standard trajectory curve visualization comparison is as follows Fig.14 As shown, the red points are standard weld points and the white points are fitted weld curve points).
[0174] The average distance to the closest points is calculated as follows:
[0175] Assume that the fitted weld trajectory point set is A and the standard weld coordinate point set is B.
[0176] A={A1,A2,...,A n}
[0177] B={B1,B2,...,B n}
[0178] For each point Ai, find the nearest point Bj in B, whose minimum distance is:
[0179]
[0180] The average distance is:
[0181]
[0182] Finally, the actual calculated average distance of the nearest point is 0.0110821mm (corresponding to the average distance of the nearest point). The accuracy of D-type weld detection has been verified, and its accuracy is high and can meet actual welding needs.
[0183] The present invention also provides a computer-readable storage medium, which stores a computer program, and the computer program can be used to execute the above-mentioned D-type weld detection method.
[0184] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned D-type weld detection method when executing the program.
[0185] Through the present invention, the three-dimensional data of the D-type weld area can be processed and analyzed, and efficient and accurate identification of the D-type weld is achieved. The optimized point cloud downsampling algorithm can maintain the scale information of the original point cloud, so that the accuracy of subsequent weld extraction is guaranteed, while reducing the amount of data processing and improving the operation efficiency; based on the information of the fitted cylinder, the point projection denoising method is used to filter out the point cloud noise on the inner wall of the circular hole, which can effectively avoid the influence of the inner wall point cloud on the extracted edge, thereby improving the accuracy of weld extraction. Experimental results show that the present invention has good performance in practical applications, and the final fitted weld trajectory has high accuracy, which meets the needs of actual welding.
[0186] The above are only preferred embodiments of the present invention, and are not intended to limit the present invention in any form. Although the present invention has been disclosed as above in the form of preferred embodiments, it is not intended to limit the present invention. Any technical personnel in the field can make some changes or modify the technical contents disclosed above into equivalent embodiments without departing from the scope of the technical solution of the present invention. However, any brief modifications, equivalent changes and modifications made to the above embodiments based on the technical essence of the present invention without departing from the content of the technical solution of the present invention are still within the scope of the technical solution of the present invention.
Claims
1. A D-type weld detection method, characterized in that The following steps are involved: Step 1: Perform 3D scanning on the perforated pipe fittings, sample the 3D contour data of the perforated pipe fittings, and obtain the sampled original point cloud data; Step 2: preprocessing the original point cloud data, including data downsampling and inner wall point filtering, to obtain preprocessed point cloud data; Step 3: Extract the D-type weld trajectory from the point cloud data obtained after preprocessing.
2. The D-type weld detection method according to claim 1, characterized in that Step 2 includes: Step 2.1: Data downsampling.
3. The D-type weld detection method according to claim 1, characterized in that Step 3 includes: 3.1 Weld edge extraction; 3.2 Sorting of weld edge points; 3.3 Extract weld trajectory.
4. The D-type weld detection method according to claim 2, characterized in that Step 2.1 includes: (1) Divide the point cloud data into multiple voxels; (2) For each voxel, calculate its center of mass; (3) Voxel replacement.
5. The D-type weld detection method according to claim 4, characterized in that: (2) For each voxel, calculate its center of mass as follows: Among them, c ijk is the centroid of the body, N is the number of sampling points in the voxel, x n ,y n ,z n are the coordinates of the nth point within the voxel.
6. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method described in any one of claims 1 to 5 is implemented.