A workpiece welding slag detection method, medium and system based on a 3D line scanning camera
By acquiring workpiece point cloud data through a 3D line scan camera and filtering out non-welding slag points using straight-line distance and point cloud cluster span, the problem of low efficiency in manual inspection is solved, achieving efficient and accurate welding slag detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SPEEDBOT ROBOTICS CO LTD
- Filing Date
- 2022-11-07
- Publication Date
- 2026-05-08
AI Technical Summary
In existing technologies, the detection of residual welding slag after welding relies on manual visual inspection, which is inefficient and prone to missing small welding slag particles, resulting in incomplete removal.
A workpiece welding slag detection method based on a 3D line scan camera is adopted. By acquiring single-frame point cloud data of the workpiece, the straight-line distance and point cloud cluster span are extracted. Then, non-welding slag point clouds are filtered out using clustering segmentation algorithms and preset thresholds to accurately detect the location of welding slag.
It achieves efficient and accurate welding slag detection, and can comprehensively identify welding slag on the surface of workpieces, thus improving detection efficiency and accuracy.
Smart Images

Figure CN115760731B_ABST
Abstract
Description
Technical Field
[0001] This invention mainly relates to the field of welding slag detection technology, specifically to a workpiece welding slag detection method, medium, and system based on a 3D line scan camera. Background Technology
[0002] As is well known, industrial component assemblies often require welding processes. The weld slag remaining on the surface of these components after welding can cause significant wear and damage to the surfaces of subsequent assembled workpieces. Therefore, sandpaper is typically used to remove this surface weld slag. Currently, the main method for removing this weld slag relies on manually locating these tiny weld slag particles scattered throughout the workpiece surface with the naked eye, and then grinding them away. This method is not only time-consuming and labor-intensive, but also carries a high risk of missing some surface weld slag. Summary of the Invention
[0003] The technical problem to be solved by this invention is: in view of the technical problems existing in the prior art, this invention provides a workpiece welding slag detection method, medium and system based on a 3D line scan camera with high detection efficiency and high detection accuracy.
[0004] To solve the above-mentioned technical problems, the technical solution proposed by this invention is as follows:
[0005] A method for detecting weld slag on workpieces based on a 3D line scan camera, comprising the following steps:
[0006] S1. Acquire single-frame point cloud data of the workpiece; where the single-frame point cloud data is obtained through a 3D line scan camera;
[0007] S2. Extract the straight line L from the single frame point cloud data, calculate the distance Dst from each point on the single frame point cloud data to the straight line L, compare the distance Dst with the preset distance threshold Dst_thresh, and filter out the corresponding point cloud when the distance Dst is less than the preset distance threshold Dst_thresh. At the same time, calculate the z coordinate z_l of the projection point of each point on the straight line L. If the z coordinate of the point is less than the z coordinate z_l of the projection point, filter out the point to ensure that the point is above the straight line L rather than below it.
[0008] S3. All the retained point clouds are stitched together onto a total point cloud cloud_all. The point cloud clusters in the total point cloud cloud_all are segmented out, and the span distance of the point cloud clusters in different directions is calculated. The span distance in different directions is compared with the preset span distance threshold. If the span distance is greater than the preset span distance threshold, the corresponding point cloud clusters are filtered to obtain the workpiece welding slag.
[0009] Preferably, in step S2, a point P1 and a direction vector V1 on the line L are obtained; then, using the distance calculation function from the point to the line and the values of P1 and V1, the distance Dst from each point on the single frame point cloud data to the line L is calculated.
[0010] Preferably, in step S3, point cloud clusters with a size greater than n in the total point cloud cloud_all are segmented, and the maximum and minimum values of the x and y coordinates of each point cloud cluster are calculated. The span distance x_value in the X direction is obtained by subtracting the minimum value from the maximum value of the x coordinate; the span distance y_value in the y direction is obtained by subtracting the minimum value from the maximum value of the y coordinate.
[0011] Preferably, a clustering segmentation algorithm is used to segment out point cloud clusters with a size greater than n in the total point cloud cloud_all.
[0012] Preferably, in step S1, the line laser emission frequency of the 3D line scanner is determined based on the detection accuracy and the moving speed of the 3D line scanner.
[0013] Preferably, after obtaining the weld slag point cloud, its centroid coordinates are calculated and converted into the coordinates of the workpiece moving module.
[0014] The present invention also discloses a computer-readable storage medium having a computer program stored thereon, the computer program performing the steps of the method described above when run by a processor.
[0015] The present invention further discloses a workpiece welding slag detection system based on a 3D line scan camera, including a memory and a processor. The memory stores a computer program, which executes the steps of the method described above when run by the processor.
[0016] Compared with the prior art, the advantages of the present invention are as follows:
[0017] The workpiece welding slag detection method and system based on a 3D line scan camera of the present invention achieves welding slag detection through point cloud detection, which has high detection efficiency; and determines welding slag by point cloud height, which can accurately detect welding slag on the surface of the workpiece; therefore, the above overall solution has high detection efficiency and comprehensive and accurate detection. Attached Figure Description
[0018] Figure 1 This is a flowchart of the detection method of the present invention in an embodiment.
[0019] Figure 2 This is an embodiment of the line scan camera of the present invention in a specific application. Detailed Implementation
[0020] The present invention will be further described below with reference to the accompanying drawings and specific embodiments.
[0021] The principle of a line scan camera is explained below: A line scan camera acquires data from only one line at a time, generally referred to as single-frame data. After continuous scanning to obtain multiple frames of data, these frames are stitched together to obtain a complete point cloud. To acquire a good point cloud, many parameters of the line scan camera need to be set, such as exposure, line scan range, filtering mechanism, and emission frequency. Among these, the emission frequency is particularly important because it is directly related to the accuracy in the y-direction. Generally, the direction along the laser is defined as the x-direction, the direction of laser movement is defined as the y-direction, and the z-direction is the direction in which the line laser is emitted. The accuracy in the x and z directions can generally be set internally by the camera. The accuracy in the y-direction, which is the distance between two adjacent frames of point cloud in the y-direction, needs to be calculated based on the emission frequency of the line laser and the movement speed in the y-direction. The specific calculation formula is as follows:
[0022] Y_Resolution=V / F (1)
[0023] Where Y_Resolution represents the accuracy in the Y direction, V is the movement speed in the Y direction, and F is the emission frequency of the line laser. The emission frequency of the line laser in a 3D line scanner depends on the detection accuracy and the movement speed of the 3D line scanner. Specifically, if an accuracy of at least 0.1mm in the Y direction is required, and... Figure 2 If the moving module can reach a speed of 70 mm / s, then the line laser emission frequency must be set to at least 700 frames per second. If the moving module can reach a speed of 50 mm / s, then the line laser emission frequency must be set to at least 500 frames per second.
[0024] Meanwhile, in camera selection, while meeting the workpiece inspection cycle time, it is best to choose a camera with a small field of view and higher accuracy. This will result in significantly less noise in the generated point cloud after scanning, which is crucial for the stability of subsequent weld slag detection. This is because weld slag segmentation is mainly based on height information, and some noise may be insensitive to the height threshold and could be mistaken for weld slag, thus affecting the final judgment result.
[0025] exist Figure 2 In the diagram, A represents the Y-axis moving module of the line scan camera; B1 and B2 represent the X-axis moving modules of the line scan camera; C represents the workpiece surface inspection area; D represents the line scan camera; and E represents the marking machine.
[0026] After setting the parameters of the line scan camera, the X-axis and Y-axis modules are used to scan the entire workpiece surface in region C at a constant speed. During the scanning process, weld slag detection can be performed simultaneously. The specific process is as follows: Figure 1 As shown:
[0027] S1. Acquire single-frame point cloud data of the workpiece; where the single-frame point cloud data is obtained through a 3D line scan camera;
[0028] S2. Extract the straight line L from the single frame point cloud data, calculate the distance Dst from each point on the single frame point cloud data to the straight line L, compare the distance Dst with the preset distance threshold Dst_thresh, and filter out the corresponding point when the distance Dst is less than the preset distance threshold Dst_thresh. At the same time, calculate the z coordinate z_l of the projection point of each point on the straight line L. If the z coordinate of the point is less than the z coordinate z_l of the projection point, filter out the point. It is necessary to ensure that the point is above the straight line L rather than below it.
[0029] S3. All the retained point clouds are stitched together onto a total point cloud cloud_all. The point cloud clusters in the total point cloud cloud_all are segmented out, and the span distance of the point cloud clusters in different directions is calculated. The span distance in different directions is compared with the preset span distance threshold. If the span distance is greater than the preset span distance threshold, the corresponding point cloud clusters are filtered to obtain the workpiece welding slag.
[0030] In one specific embodiment, in step S2, the RANSAC algorithm is used to extract the straight line L from the data of each frame of point cloud, and a point P1 and direction vector V1 on the straight line are obtained; then, the distance Dst from each point on the single frame of data to the straight line L is calculated using the distance calculation function from the point to the straight line and the values of P1 and V1; finally, points with Dst less than Dst_thresh are filtered out by the preset distance threshold Dst_thresh passed in by the external host computer software, and points with Dst greater than Dst_thresh are retained. At the same time, the z coordinate z_l of the projection point of each point on the straight line is calculated. If the z coordinate of the point is less than the z coordinate z_l of the projection point, the point is filtered out, because the welding slag is generally higher than the surface of the attached workpiece.
[0031] In one specific embodiment, in step S3, all the point clouds obtained after filtering each frame are stitched together onto a single point cloud, cloud_all. Then, a clustering segmentation algorithm is used to segment point cloud clusters in cloud_all that have more than 3 dimensions. The maximum and minimum x-coordinates and y-coordinates of each point cloud cluster are calculated, and the span distance x_value in the X direction is obtained by subtracting the minimum x-coordinate from the maximum x-coordinate. Similarly, the span distance y_value in the Y direction is obtained. Since some point cloud clusters are components on the surface of the workpiece and do not belong to welding slag, and the x_value and y_value of these component point cloud clusters are significantly greater than those of welding slag, these interfering point clouds can be filtered out by setting a preset span threshold.
[0032] Finally, after the above filtering, the weld slag point cloud is obtained. Its centroid coordinates are calculated and fed back to the host computer software, which then converts them into coordinates in the module. The host computer software controls the marking machine to place an NG mark near the weld slag location based on the weld slag coordinates. This allows subsequent manual operation to quickly locate the weld slag and remove it using these marks.
[0033] The workpiece welding slag detection method based on a 3D line scan camera of the present invention achieves welding slag detection through point cloud detection, which has high detection efficiency; and judges welding slag by point cloud height, which can accurately detect welding slag on the surface of the workpiece; therefore, the above overall solution has high detection efficiency and comprehensive and accurate detection.
[0034] This invention also discloses a computer-readable storage medium storing a computer program thereon, which, when run by a processor, executes the steps of the method described above. This invention further discloses a workpiece welding slag detection system based on a 3D line scan camera, including a memory and a processor, wherein the memory stores a computer program, which, when run by a processor, executes the steps of the method described above. The medium and system of this invention correspond to the above-described detection methods and also possess the advantages described above.
[0035] As shown in this disclosure and the claims, unless the context clearly indicates otherwise, the words "a," "an," "an," and / or "the" are not specifically singular and may include plural forms. The terms "first," "second," and similar terms used in this disclosure do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Similarly, the terms "comprising" or "including" mean that the element or object preceding the word covers the element or object listed after the word and its equivalents, without excluding other elements or objects. The terms "connected" or "linked" are not limited to physical or mechanical connections but may include electrical connections, whether direct or indirect.
[0036] The above are merely preferred embodiments of the present invention. The scope of protection of the present invention is not limited to the above embodiments. All technical solutions falling within the scope of the present invention's concept are within the scope of protection of the present invention. It should be noted that for those skilled in the art, any improvements and modifications made without departing from the principles of the present invention should be considered within the scope of protection of the present invention.
Claims
1. A method for detecting weld slag on workpieces based on a 3D line scan camera, characterized in that, Including the following steps: S1. Acquire single-frame point cloud data of the workpiece; where the single-frame point cloud data is obtained through a 3D line scan camera; S2. Extract the straight line L from the single-frame point cloud data, calculate the distance Dst from each point on the single-frame point cloud data to the straight line L, and compare the distance Dst with a preset distance threshold Dst_thresh. If the distance Dst is less than the preset distance threshold Dst_thresh, the corresponding point cloud is filtered out. At the same time, calculate the z-coordinate of the projection point of each point on the straight line L. If the z-coordinate of the point is less than the z-coordinate of the projection point z_l, the point is filtered out to ensure that the point is above the straight line L rather than below it. The straight line L is a straight line representing the baseline of the working surface. S3. All the retained point clouds are stitched together onto a total point cloud cloud_all. The point cloud clusters in the total point cloud cloud_all are segmented out, and the coordinate span distance of the point cloud clusters in the x and y directions is calculated. The span distance in different directions is compared with the preset span distance threshold. If the span distance is greater than the preset span distance threshold, the corresponding point cloud clusters are filtered to obtain the workpiece welding slag. In step S3, a clustering segmentation algorithm is used to segment point cloud clusters with a size greater than n in the total point cloud cloud_all, and the maximum and minimum values of the x and y coordinates of each point cloud cluster are calculated. The span distance x_value in the X direction is obtained by subtracting the minimum value from the maximum value of the x coordinate; the span distance y_value in the y direction is obtained by subtracting the minimum value from the maximum value of the y coordinate; where n is a natural number, n≥3.
2. The workpiece welding slag detection method based on a 3D line scan camera according to claim 1, characterized in that, In step S2, a point P1 and a direction vector V1 on the line L are obtained; then, using the distance calculation function from the point to the line and the values of P1 and V1, the distance Dst from each point on the single frame point cloud data to the line L is calculated.
3. The workpiece welding slag detection method based on a 3D line scan camera according to claim 1, characterized in that, Using a clustering segmentation algorithm, point cloud clusters with a size greater than n in the total point cloud cloud_all are segmented out.
4. The workpiece welding slag detection method based on a 3D line scan camera according to claim 1 or 2, characterized in that, In step S1, the line laser emission frequency of the 3D line scanner is determined based on the detection accuracy and the moving speed of the 3D line scanner.
5. The workpiece welding slag detection method based on a 3D line scan camera according to claim 1 or 2, characterized in that, After obtaining the point cloud of welding slag, its centroid coordinates are calculated and converted into the coordinates of the workpiece moving module.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that, The computer program, when run by a processor, performs the steps of the method as described in any one of claims 1 to 5.
7. A workpiece welding slag detection system based on a 3D line scan camera, comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, The computer program, when run by a processor, performs the steps of the method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Racing track cone bucket detection and target point tracking method based on multi-line laser radar
CN110780305A
Welding defect detection method based on point cloud information
CN114240944A