CN-115760731-B - Workpiece welding slag detection method, medium and system based on 3D line scanning camera
Abstract
The invention discloses a workpiece welding slag detection method and system based on a 3D line scanning camera, wherein the method comprises the steps of S1, obtaining single-frame point clouds of a workpiece, S2, extracting straight lines aiming at the single-frame point clouds, calculating the distance from each point on the point clouds to the straight lines, comparing the distance with a preset distance threshold, filtering the corresponding point clouds when the distance is smaller than the preset distance threshold, simultaneously calculating the z coordinate z_l of a projection point of each point on the straight lines, filtering the point when the z coordinate of each point is smaller than the z coordinate z_l of the projection point, S3, splicing all reserved point clouds to a total point cloud, dividing the point clouds in the total point cloud, solving the span distances of the point clouds in different directions, comparing the span distances of the different directions with the preset span distance threshold, and filtering the corresponding point clouds when the span distances of the point clouds are larger than the preset span distance threshold, so as to obtain the workpiece welding slag. The invention has the advantages of high detection efficiency, accurate and comprehensive detection and the like.
Inventors
- WANG CHAO
- DENG JUNJIE
- LI QING
- LI HUANG
Assignees
- 湖南视比特机器人有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20221107
Claims (7)
- 1. A workpiece welding slag detection method based on a 3D line scanning camera is characterized by comprising the following steps: s1, acquiring single-frame point cloud data of a workpiece, wherein the single-frame point cloud data is obtained through a 3D line scanning camera; S2, extracting a straight line L for single-frame point cloud data, calculating the distance Dst between each point on the single-frame point cloud data and the straight line L, comparing the distance Dst with a preset distance threshold Dst_thresh, filtering corresponding point clouds when the distance Dst is smaller than the preset distance threshold Dst_thresh, and simultaneously calculating the z coordinate of a projection point of each point on the straight line L, and filtering the point to ensure that the point is above the straight line L but not below the straight line L if the z coordinate of the point is smaller than the z coordinate z_l of the projection point; S3, all the reserved point clouds are spliced to a total point cloud group_all, point clouds in the total point cloud group_all are segmented, coordinate span distances of the point clouds in the x direction and the y direction are calculated, and span distances in different directions are compared with a preset span distance threshold value; In the step S3, point clouds with the size number larger than n in the total point clouds group_all are segmented by using a clustering segmentation algorithm, the maximum value and the minimum value of the X coordinate and the y coordinate of each point cloud are calculated, the maximum value and the minimum value of the X coordinate are subtracted to obtain the span distance x_value of the X direction, the maximum value and the minimum value of the y coordinate are subtracted to obtain the span distance y_value of the y direction, and n is a natural number and is more than or equal to 3.
- 2. The method for detecting welding slag on a workpiece based on a 3D line scanning camera according to claim 1, wherein in step S2, a point P1 and a direction vector V1 on a straight line L are obtained, and then a distance Dst from each point on single-frame point cloud data to the straight line L is calculated by using a point-to-straight line distance calculation function and values of P1 and V1.
- 3. The workpiece welding slag detection method based on the 3D line scanning camera according to claim 1, wherein the point cloud clusters with the size number larger than n in the total point cloud group_all are segmented through a clustering segmentation algorithm.
- 4. The 3D wire sweep camera based workpiece slag detection method as defined in claim 1 or 2, wherein in step S1, the wire laser emission frequency of the 3D wire sweep machine is determined according to the detection accuracy and the 3D wire sweep machine moving speed.
- 5. The method for detecting the welding slag of the workpiece based on the 3D line scanning camera according to claim 1 or 2, wherein after the welding slag point cloud is obtained, the barycenter coordinates of the welding slag point cloud are obtained and converted into the coordinates of the workpiece moving module.
- 6. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, performs the steps of the method according to any one of claims 1-5.
- 7. A 3D line scan camera based workpiece slag detection system comprising a memory and a processor, the memory having stored thereon a computer program, characterized in that the computer program when run by the processor performs the steps of the method according to any of claims 1-5.
Description
Workpiece welding slag detection method, medium and system based on 3D line scanning camera Technical Field The invention mainly relates to the technical field of welding slag detection, in particular to a workpiece welding slag detection method, medium and system based on a 3D line scanning camera. Background It is well known that industrial component assemblies often require a welding process, and that the residue remaining on the component surfaces after welding can cause significant wear damage to the subsequently assembled workpiece surfaces, so it is often an option to abrade these surface residues with sandpaper. Currently, the main method for grinding the welding slag is to manually and visually search for the fine welding slag scattered on each position of the surface of the workpiece, and then grind, so that time and labor are wasted, and some surface welding slag is likely to be leaked. Disclosure of Invention The invention aims to solve the technical problems in the prior art, and provides a workpiece welding slag detection method, medium and system based on a 3D line scanning camera, which are high in detection efficiency and accurate in detection. In order to solve the technical problems, the technical scheme provided by the invention is as follows: A workpiece welding slag detection method based on a 3D line scanning camera comprises the following steps: s1, acquiring single-frame point cloud data of a workpiece, wherein the single-frame point cloud data is obtained through a 3D line scanning camera; s2, extracting a straight line L from single-frame point cloud data, calculating the distance Dst from each point on the single-frame point cloud data to the straight line L, comparing the distance Dst with a preset distance threshold Dst_thresh, filtering corresponding point clouds when the distance Dst is smaller than the preset distance threshold Dst_thresh, and simultaneously calculating the z coordinate z_l of a projection point of each point on the straight line L, and filtering the point if the z coordinate of the point is smaller than the z coordinate z_l of the projection point, so as to ensure that the point is above the straight line L but not below the straight line L; S3, all the reserved point clouds are spliced to a total point cloud group_all, point clouds in the total point cloud group_all are segmented, the span distances of the point clouds in different directions are obtained, the span distances of the different directions are compared with a preset span distance threshold value, and if the span distances are larger than the preset span distance threshold value, the corresponding point clouds are filtered, so that the workpiece welding slag is obtained. Preferably, in step S2, a point P1 and a direction vector V1 on the straight line L are acquired, and then the distance Dst from each point on the single-frame point cloud data to the straight line L is calculated by using the point-to-straight line distance calculation function and the values of P1 and V1. Preferably, in step S3, the point cloud clusters with the size number greater than n in the total point cloud group_all are segmented, the X coordinate of each point cloud cluster is calculated, the maximum value and the minimum value of the y coordinate are calculated, the maximum value of the X coordinate is subtracted from the minimum value to obtain the span distance x_value in the X direction, and the maximum value of the y coordinate is subtracted from the minimum value to obtain the span distance y_value in the y direction. Preferably, the point cloud clusters with the size number larger than n in the total point cloud closed_all are segmented through a clustering segmentation algorithm. Preferably, in step S1, the line laser emission frequency of the 3D line scanner is determined according to the detection accuracy and the moving speed of the 3D line scanner. Preferably, after the welding slag point cloud is obtained, the barycenter coordinates of the welding slag point cloud are obtained and converted into the coordinates of the workpiece moving module. The invention also discloses a computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, performs the steps of the method as described above. The invention further discloses a workpiece welding slag detection system based on the 3D line scanning camera, which comprises a memory and a processor, wherein the memory is stored with a computer program which executes the steps of the method when being executed by the processor. Compared with the prior art, the invention has the advantages that: the workpiece welding slag detection method and system based on the 3D line scanning camera are high in detection efficiency by detecting the welding slag through point cloud, and can accurately detect the welding slag on the surface of the workpiece by judging the welding slag through the point cloud height, so that the dete