Automatic welding position identification method for large workpieces to be welded
Images were collected through binocular cameras and point cloud registration fusion was used to use PointNetLK++ point cloud registration network model to solve the problem of welding position recognition of large-scale welding workpieces, and efficient and accurate welding position recognition is achieved, reducing costs and improving accuracy.
Patent Information
- Application Number
- CN202111663553.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-31
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2041-12-31
AI Technical Summary
Existing welding position identification technology is difficult to efficiently and accurately identify the welding position of large welded workpieces.
The binocular camera is used for calibration, multiple sets of images are collected and converted into three-dimensional point cloud information through the BM matching algorithm. Then, point cloud registration fusion is used to use the PointNetLK++ point cloud registration network model to delete the background point cloud, calculate the vector vector, extract the boundary points, and segment the three-dimensional point cloud model through the RANSAC multi-plane segmentation algorithm to determine the welding position.
It realizes efficient and accurate welding position recognition of large welded workpieces, reduces identification costs, and improves three-dimensional reconstruction accuracy and welding position recognition accuracy.
Smart Images

Figure CN114273826B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the fields of artificial intelligence and industrial automation, and in particular relates to a method for automatically identifying welding positions of large workpieces to be welded. Background Art
[0002] Traditional welding methods are mainly manual operations, which are labor-intensive, inefficient, and have poor welding quality stability in a harsh welding environment. In order to free welders from heavy manual labor, domestic and foreign experts and scholars have developed various robot intelligent welding position recognition technologies and successfully applied them in the field of robot welding.
[0003] At present, there are four main methods for robot welding position recognition:
[0004] The first is an identification method based on radioactive detection. Radioactive detection is a widely used detection method, which has the characteristics of high recognition resolution and stable and reliable detection quality. The commonly used rays in the field of radioactive detection are mainly x-rays and gamma rays. Since the radioactive detection method can detect the surface information of the workpiece to be welded and penetrate into the interior of the workpiece to be welded, it can intuitively detect the internal situation of the workpiece to be welded. Therefore, the radioactive detection method can not only be used to detect the shape, size and position information of the welding position, but also to detect defects. However, during the detection process, this method must wear radiation protection equipment to avoid radioactive contamination from causing harm to the workers' bodies, and the related equipment is relatively expensive, and the overall cost is high.
[0005] The second is a welding position recognition method based on line structured light. However, this method has high sensor cost, complex structure and is easily interfered by environmental noise.
[0006] The third method is a welding position recognition method based on threshold segmentation and edge detection. When this method uses traditional edge detection operators to extract edges, the image of the welding position extracted has many noise points, and the image edge is discontinuous and broken.
[0007] The fourth is a welding position recognition method based on deep learning. As artificial intelligence and deep learning algorithms have shown increasingly better recognition results in the field of image processing, scholars at home and abroad have gradually used neural network algorithms to identify weld types and locate weld position information. However, this method relies on a standard data set containing various weld types, and the cost of manually annotating data sets is high. Among them, the weld is the seam formed after welding, that is, the seam formed by melting the welding rod and the metal at the joint.
[0008] With the development of industrial robot technology, computer vision detection technology, deep learning technology and other technologies, the application of vision-based intelligent recognition and detection technology in the welding field has been increasing, greatly improving the automation and intelligence of welding robots. Welding position recognition technology is a key technology for realizing welding automation and intelligence, and is also a key factor in realizing intelligent planning of welding paths. The current welding position recognition technology has not been able to efficiently and accurately identify the positions that need to be welded on large welding workpieces. Summary of the invention
[0009] Purpose of the invention: In view of the problems existing in the prior art, the present invention proposes a method for automatically identifying the welding position of large workpieces to be welded that can be used efficiently and accurately.
[0010] Technical solution: In order to achieve the above-mentioned purpose, the present invention provides a method for automatically identifying the welding position of a large workpiece to be welded, which is characterized by comprising the following steps:
[0011] Step 1: Calibrate the binocular camera;
[0012] Step 2: Collect multiple sets of images of the large workpiece to be welded by moving the binocular camera;
[0013] Step 3: Preprocess the left and right views of each set of images collected in step 2;
[0014] Step 4: Use the BM matching algorithm to transform each group of images processed in step 3 in turn, and obtain a corresponding set of three-dimensional point cloud information for each group of images;
[0015] Step 5: Preprocess each set of 3D point cloud information obtained in step 4 in turn;
[0016] Step 6: Based on the PointNetLK++ point cloud registration network model with embedded spatial attention mechanism and channel attention mechanism, the multiple sets of pre-processed 3D point cloud data obtained in step 5 are sequentially fused to obtain a 3D point cloud model containing a complete workpiece to be welded and its background;
[0017] Step 7: Delete the background point cloud in the three-dimensional point cloud model including the complete workpiece to be welded and its background obtained in step 6 to obtain a three-dimensional point cloud model of the workpiece to be welded;
[0018] Step 8: Calculate the normal vector of each point cloud in the three-dimensional point cloud model of the workpiece to be welded;
[0019] Step 9: Determine the boundary points in the three-dimensional point cloud model of the workpiece to be welded according to the normal vector of each point cloud obtained in step 8;
[0020] Step 10: Segment the three-dimensional point cloud model of the workpiece to be welded obtained in step 7 using the RANSAC multi-plane segmentation algorithm to obtain each plane of the workpiece to be welded;
[0021] Step 11: Calculate the distance between each boundary point obtained in step 9 and each plane obtained in step 10 respectively. If the distance between a boundary point and at least two planes is 0, retain the corresponding point, form a set of all the retained points, and propose the points that make up the weld, thereby completing the weld extraction.
[0022] Furthermore, in step 3, the method for preprocessing the left and right views of each group of images collected in step 2 is: reading the calibration result of step 1 into OpenCV, and then performing distortion elimination and row alignment on the left camera captured pictures and the right camera captured pictures in each group of images collected in step 2, so that the imaging origin coordinates of the left camera captured pictures and the right camera captured pictures in each group of images are consistent, the optical axes of the left and right cameras are parallel, the left and right imaging planes are coplanar, and the epipolar lines are aligned.
[0023] Further, the step 4 specifically includes the following steps:
[0024] Step 4-1: Construct a window of the same size and cover the images captured by the left and right cameras of the binocular camera respectively;
[0025] Step 4-2: Select all the pixels in the window area and make a difference in the corresponding positions one by one, take the absolute value of the difference and sum it as the similarity of the two pixel blocks;
[0026] Step 4-3: Move the window and repeat steps 4-1 to 4-2 to complete the similarity calculation of all corresponding pixel blocks, and take the area with the minimum value as the best matching pixel block; the pixel block is composed of pixels within the window size;
[0027] Step 4-4: Match the feature points with edge, corner and other information in the calibrated binocular image to obtain the disparity map, and use the disparity distance formula to calculate the depth map. Finally, according to the geometric model of the binocular camera, transform it into three-dimensional space to obtain three-dimensional point cloud information.
[0028] Furthermore, the preprocessing in step 5 includes: point cloud denoising, outlier removal and point cloud smoothing.
[0029] Furthermore, the PointNetLK++ point cloud registration network model based on embedded spatial attention mechanism and channel attention mechanism inputs the output result of the second layer sharedMLP of the PointNetLK network model into the attention mechanism module that adds the spatial attention mechanism and the channel attention mechanism for processing, and inputs the processed result into the third layer sharedMLP.
[0030] Further, the method of obtaining a three-dimensional point cloud model including a complete workpiece to be welded and its background in step 6 is:
[0031] Step 6-1: In the initial state, the first and second groups of 3D point cloud data obtained in step 5 are input into the PointNetLK++ point cloud registration network model, and the PointNetLK++ point cloud registration network model outputs a transformation matrix; the transformation matrix is applied to the first or second group of 3D point cloud data to obtain first superimposed 3D point cloud data;
[0032] Step 6-2: Input the obtained nth superimposed 3D point cloud data and the mth group of 3D point cloud data into the PointNetLK++ point cloud registration network model, and apply the transformation matrix output by the PointNetLK++ point cloud registration network model to the input nth superimposed 3D point cloud data to obtain the n+1th superimposed 3D point cloud data; the initial value of n is 1, m represents the number of each group of 3D point cloud data obtained in step 5, and the initial value of m is 3;
[0033] Step 6-3: Let n=n+1, m=m+1, and then determine whether m at this time is greater than the total number of groups of 3D point cloud data obtained in step 5. If not, repeat steps 6-2 to 6-3; if greater, directly output the last superimposed 3D point cloud data, that is, obtain a 3D point cloud model containing a complete workpiece to be welded and its background.
[0034] Furthermore, the basis for deleting the background point cloud in step 7 is a label pre-set on the background, and the label is a QR code label or a color label.
[0035] Furthermore, the method for determining the boundary points in step 9 is: calculating the cosine similarity of the normal vectors of each point cloud and its nearest k points, and when the cosine similarity is less than 0.5, the point is considered to be a boundary point.
[0036] The present invention also provides a computer-readable medium storing software, wherein the software includes instructions that can be executed by one or more computers, and the instructions enable the one or more computers to perform operations through such execution, and the operations include the process of the aforementioned method for automatically identifying the welding position of a large workpiece to be welded.
[0037] The present invention also provides a computer system, comprising:
[0038] one or more processors;
[0039] A memory stores operable instructions, wherein when the instructions are executed by the one or more processors, the one or more processors perform operations, wherein the operations include the process of the aforementioned method for automatically identifying welding positions of large workpieces to be welded.
[0040] The present invention reconstructs the unit model of the large workpiece to be welded by adding the PointNetLK++ point cloud registration network model with spatial attention mechanism and channel attention mechanism on the basis of the PointNetLK network model, combining the point cloud data converted from the images of the large workpiece to be welded at different angles collected by a binocular camera, and then extracts the boundary points of the welding model by using the gradient change of the normal vector, and then further screens the points to be welded according to the distances from the points at the intersection to different planes, so as to accurately identify the welding position of the workpiece to be welded.
[0041] Beneficial effects: The present invention not only effectively reduces the recognition cost, but also greatly improves the accuracy of three-dimensional reconstruction of large welding models and the accuracy of identifying the positions to be welded. At the same time, it facilitates the operation and management of welding operations by technicians. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 A schematic diagram of an automatic welding position recognition system for large workpieces to be welded;
[0043] Figure 2 Reconstruct a flow chart for a 3D point cloud model that includes the complete workpiece to be welded and its background;
[0044] Figure 3 This is a schematic diagram of the PointNetLK++ network model. Specific implementation methods
[0045] The technical solution of the present invention is further described in detail below with reference to the accompanying drawings:
[0046] like Figure 1 As shown, the present invention discloses a welding position automatic identification system for large workpieces to be welded, comprising a calibration module, a data acquisition module, a three-dimensional point cloud model reconstruction module and a welding position identification module;
[0047] Among them, the calibration module mainly calibrates the set binocular camera to obtain the internal parameters, translation and rotation parameters, and distortion parameters of the left and right cameras of the binocular camera.
[0048] The data acquisition module mainly uses a binocular camera to collect multiple sets of images of the workpiece to be welded. Since the workpiece to be welded is a large workpiece, in order to improve the recognition accuracy, it is necessary to collect images of the workpiece to be welded at a close distance during the image acquisition stage. In this way, the image collected each time is only a part of the workpiece to be welded, and multiple acquisitions are required to obtain the complete workpiece to be welded. In this embodiment, the binocular camera is set on the acquisition track. Each time the binocular camera is moved, an image of the workpiece to be welded is collected. Through multiple acquisitions, each part of the workpiece to be welded is collected. At the same time, the contents of the images collected twice adjacently have intersections.
[0049] Since the binocular camera has two cameras, the image collected at each position includes the image collected by the left camera and the image collected by the right camera. The two images collected at each position constitute a group of images. The data acquisition module first pre-processes the two images in each group of images separately, so that the imaging origin coordinates of the left camera and the right camera are consistent, the optical axes of the left and right cameras are parallel, the left and right imaging planes are coplanar, and the epipolar lines are aligned. Then the BM matching algorithm is used to convert each group of images into a group of three-dimensional point cloud data.
[0050] The 3D point cloud model reconstruction module generates a 3D point cloud model of the complete workpiece to be welded based on the multiple sets of 3D point cloud data generated by the data acquisition module and the PointNetLK++ point cloud registration network model; according to the set labels, all background point clouds are deleted to obtain a complete 3D point cloud model of the workpiece to be welded.
[0051] The welding position recognition module uses the gradient change of the normal vector to extract the edge points of the welding model, and then further screens out the points that need to be welded according to the distance from the points at the intersection to different planes, thereby accurately identifying the welding position.
[0052] The method for automatically identifying the welding position of a large workpiece to be welded adopted in this embodiment comprises the following steps:
[0053] Step 1: Calibrate the binocular camera: In this embodiment, the binocular camera is calibrated mainly using a calibration plate to obtain the internal parameters, translation and rotation parameters, and distortion parameters of the left and right cameras of the binocular camera. Specifically, the following steps are included:
[0054] Step 1-1: Use a binocular camera to collect 100 sets of images of a calibration plate at different positions. In this embodiment, a calibration plate with a grid size of 23 mm is used;
[0055] Step 1-2: Input the 100 groups of images collected in step 1-1 into Matlab software respectively, and use the stereoCameraCalibrator function in Matlab software to complete the stereo camera calibration, and obtain the internal parameters, translation and rotation parameters, and distortion parameters of the left and right cameras of the stereo camera.
[0056] Step 2: Collect multiple sets of images of the large workpiece to be welded by moving the binocular camera; complete the image acquisition of the large welded workpiece. Among them, the contents of the two adjacent sets of images have intersections.
[0057] Step 3: Read the calibration result of step 1 into OpenCV, and then perform distortion elimination and row alignment on the left camera captured pictures and the right camera captured pictures in each group of images collected in step 2, so that the imaging origin coordinates of the left camera captured pictures and the right camera captured pictures in each group of images are consistent, the optical axes of the left and right cameras are parallel, the left and right imaging planes are coplanar, and the epipolar lines are aligned.
[0058] Step 4: Use the BM matching algorithm to transform each group of images processed in step 3 in turn, and each group of images obtains a corresponding set of three-dimensional point cloud information. Specifically, the following steps are included:
[0059] Step 4-1: Construct a window of the same size and cover the images captured by the left and right cameras of the binocular camera respectively;
[0060] Step 4-2: Select all the pixels in the window area and make a difference in the corresponding positions one by one, take the absolute value of the difference and sum it as the similarity of the two pixel blocks;
[0061] Step 4-3: Move the window and repeat steps 4-1 to 4-2 to complete the similarity calculation of all corresponding pixel blocks, and take the area with the minimum value as the best matching pixel block; the pixel block is composed of pixels within the window size;
[0062] Step 4-4: Match the feature points with edge, corner and other information in the calibrated binocular image to obtain the disparity map, and use the disparity distance formula to calculate the depth map. Finally, according to the geometric model of the binocular camera, transform it into three-dimensional space to obtain three-dimensional point cloud information.
[0063] Step 5: Preprocess each set of 3D point cloud information obtained in step 4. The 3D point cloud information includes the position coordinates of each point.
[0064] The PCL point cloud processing open source library is mainly used to perform three point cloud preprocessing operations on point cloud data: point cloud denoising, outlier removal, and point cloud smoothing.
[0065] Since the amount of point cloud data acquired by the binocular camera is relatively large and the target noise is generally on the surface of the target point cloud, the Gaussian filtering algorithm can generally be used to define that if a point cloud is less than a certain density, it is regarded as a noise point, thereby completing the point cloud denoising process.
[0066] The StatisticalOutlierRemoval filter is used to remove outliers. A statistical analysis is performed on the neighborhood of each point to calculate the average distance from it to all neighboring points. It is assumed that the result is a Gaussian distribution, whose shape is determined by the mean and standard deviation. Points with average distances outside the standard range can be defined as outliers and removed from the data. The standard range is defined by the global distance mean and variance.
[0067] The average method is used for point cloud smoothing. The average method replaces the original point with the average value of the 3D coordinates of the adjacent points. According to the formula You can get the smoothed point X i′ , where X ij Indicates point X i The average value of the three-dimensional coordinates of the jth neighboring point, n represents the point X i The total number of neighboring points, j represents the number of the neighboring point.
[0068] Step 6: Based on the trained PointNetLK++ point cloud registration network model, the pre-processed multiple sets of 3D point cloud data obtained in step 5 are sequentially fused to obtain a 3D point cloud model containing the complete workpiece to be welded and its background. Figure 2 As shown, the specific steps are:
[0069] Step 6-1: In the initial state, the first and second groups of 3D point cloud data are input into the PointNetLK++ point cloud registration network model, and the PointNetLK++ point cloud registration network model outputs a transformation matrix including a translation vector and a rotation matrix; the transformation matrix is applied to the first or second group of 3D point cloud data to obtain first superimposed 3D point cloud data;
[0070] Step 6-2: Input the obtained nth superimposed 3D point cloud data and the mth group of 3D point cloud data into the PointNetLK++ point cloud registration network model, and apply the transformation matrix output by the PointNetLK++ point cloud registration network model to the input nth superimposed 3D point cloud data to obtain the n+1th superimposed 3D point cloud data; the initial value of n is 1, m represents the number of each group of 3D point cloud data obtained in step 5, and the initial value of m is 3;
[0071] Step 6-3: Let n=n+1, m=m+1, and then determine whether m at this time is greater than the total number of groups of 3D point cloud data obtained in step 5. If not, repeat steps 6-2 to 6-3; if greater, directly output the last superimposed 3D point cloud data, that is, obtain a 3D point cloud model containing a complete workpiece to be welded and its background.
[0072] The PointNetLK++ point cloud registration network model used in this embodiment adds a spatial attention mechanism and a channel attention mechanism to the PointNetLK network model to capture global context dependencies. The spatial attention mechanism and the channel attention mechanism act independently on the feature extraction module of the PointNetLK network model.
[0073] like Figure 3 As shown in the figure, the PointNetLK++ point cloud registration network model inputs the output result of the second layer sharedMLP in the PointNetLK network model into the attention mechanism module for calculation; the attention mechanism module includes two independent submodules, namely the spatial attention mechanism submodule and the channel attention mechanism submodule; the output result of the second layer sharedMLP is input into the spatial attention mechanism submodule and the channel attention mechanism submodule respectively; the spatial attention mechanism submodule first obtains the position feature according to the spatial attention mechanism, and the result of weighted summation of the obtained position feature and the result of the second layer sharedMLP output is used as the output of the spatial attention mechanism submodule; the channel attention mechanism submodule first obtains the channel feature according to the channel attention mechanism, and the result of weighted summation of the obtained channel feature and the result of the second layer sharedMLP output is used as the output of the channel attention mechanism submodule. The outputs of the spatial attention mechanism submodule and the channel attention mechanism submodule are added and fused, and the result of the addition and fusion is the output of the attention mechanism module; the output of the attention mechanism module is the input of the third layer sharedMLP.
[0074] Figure 3 In, P S represents the input source point cloud, P T Represents the input template point cloud, and N represents the total number of points in each group of input point cloud data; in this embodiment, in the initial state, the first group of point cloud data and the second group of point cloud data can be randomly selected as source voltage or template point cloud input; starting from the nth time, where n≥2, the nth superimposed three-dimensional point cloud data is input as the template point cloud into the PointNetLK++ point cloud registration network model, and the mth group of three-dimensional point cloud data is input as the source point cloud into the PointNetLK++ point cloud registration network model.
[0075] Among them, the spatial attention mechanism performs weighted summation based on the location information of the neighborhood points, selectively aggregates the features of each location, and associates similar features. The channel attention mechanism integrates the correlation features between all channels and selectively emphasizes the interdependent channel relationships. In order to further obtain the global dependency feature, the output results of the two modules are added and fused to adaptively integrate local and global dependencies.
[0076] The PointNetLK++ point cloud registration network model in this embodiment needs to be trained before use. The training data is the ModelNet40 standard data set, which consists of 40 categories and 12311 gridded CAD models. Among them, we use 9843 models as training sets and 2468 models as test sets.
[0077] Step 7: According to the label pre-set on the background where the large workpiece to be welded is located, the background point cloud in the three-dimensional point cloud model including the complete workpiece to be welded and its background obtained in step 6 is deleted, thereby obtaining a three-dimensional point cloud model of the workpiece to be welded. In this embodiment, the background where the large workpiece to be welded is located is set as a QR code, and different color labels can also be selected. Here, the background where the large workpiece to be welded is located is a desktop that carries the workpiece to be welded.
[0078] Step 8: Calculate the normal vector of each point cloud in the three-dimensional point cloud model of the workpiece to be welded.
[0079] Step 9: Determine the boundary points in the three-dimensional point cloud model of the workpiece to be welded according to the normal vector of each point cloud obtained in step 8. The specific method is: calculate the cosine similarity of the normal vectors of each point cloud and its nearest k points. When the cosine similarity is less than 0.5, it is considered that the point is a point on the boundary. In this embodiment, k is generally set to 20.
[0080] Step 10: Use the RANSAC multi-plane segmentation algorithm to segment the three-dimensional point cloud model of the workpiece to be welded obtained in step 7 to obtain each plane of the workpiece to be welded.
[0081] Step 11: Calculate the distance between each boundary point obtained in step 9 and each plane obtained in step 10 respectively. If the distance between a boundary point and at least two planes is 0, retain the corresponding point and form a set of all the retained points. The set of points is the position to be welded, thereby completing the identification of the welding position.
[0082] The welding position automatic identification system for large workpieces to be welded provided in this embodiment also includes a human-computer interaction client module, which realizes the acquisition, processing and transmission of sensor data. This module uses the QT graphical user interface application development framework to design a visual interface, integrating the functions of the three modules of data acquisition, three-dimensional reconstruction and welding position identification. Through the "signal-slot" mechanism of QT, the operation can be completed by clicking the corresponding button. When the user clicks the data acquisition button, the binocular camera of the data acquisition module in the system can be started to obtain the welding model; when the user clicks the three-dimensional reconstruction button, the three-dimensional model real-time display window can provide an interface to display the point cloud data alignment process of the welding model and the final reconstruction effect in real time; when the user clicks the welding position identification button, the welding position identification result display window can provide an interface to display the specific position of the position to be welded in the model of the workpiece to be welded. Thereby facilitating the implementation of subsequent automatic welding.
[0083] This embodiment also provides a computer-readable medium storing software, wherein the software includes instructions that can be executed by one or more computers, and the instructions, through such execution, cause the one or more computers to perform operations, and the operations include the process of the aforementioned method for automatically identifying welding positions of large workpieces to be welded.
[0084] This embodiment also provides a computer system, including: one or more processors; a memory, storing operable instructions, wherein when the instructions are executed by the one or more processors, the one or more processors perform operations, and the operations include the process of the aforementioned method for automatically identifying welding positions of large workpieces to be welded.
[0085] It should be understood that the example of the aforementioned method for automatically identifying the welding position of a large workpiece to be welded in this embodiment can be in any computer system including data storage and data processing, and the aforementioned computer system can be at least one electronic processing system or electronic device including a processor and a memory, such as a PC, whether it is a personal PC, a commercial PC, or a PC for graphics processing, or a server-level PC. These PCs realize wired and / or wireless data transmission by having a data interface and / or a network interface.
[0086] In other embodiments, the computer system may also be a server, especially a cloud server, having data storage, processing and network communication functions.
[0087] An exemplary computer system generally includes at least one processor, a memory, and a network interface connected by a system bus. The network interface is used to communicate with other devices / systems.
[0088] The processor is used to provide computation and control of the system.
[0089] The memory includes non-volatile memory and cache.
[0090] The non-volatile memory generally has a massive storage capacity and can store an operating system and computer programs. These computer programs may include operable instructions that, when executed by one or more processors, enable the one or more processors to execute the process of the method for automatically identifying the welding position of a large workpiece to be welded according to the aforementioned embodiment of the present invention.
[0091] In necessary or reasonable implementations, the aforementioned computer system, whether a PC device or a server, may also include more or fewer components than those shown in the diagram, or a combination, or use different hardware, software or other components or different deployment methods.
[0092] The above description is only a specific implementation method of the patent of the present invention, but the protection scope of the present invention is not limited thereto. Any person familiar with the technology can understand and think of any changes or substitutions within the technical scope disclosed by the present invention, which should be included in the scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A method for automatically identifying the welding position of a large workpiece to be welded, characterized in that: The following steps are involved: Step 1: Calibrate the binocular camera; Step 2: Collect multiple sets of images of the large welding workpiece by moving the binocular camera; Step 3: Preprocess the left and right views of each set of images collected in step 2; Step 4: Use the BM matching algorithm to transform each group of images processed in step 3 in turn, and obtain a corresponding set of three-dimensional point cloud information for each group of images; Step 5: Preprocess each set of 3D point cloud information obtained in step 4 in turn; Step 6: Based on the PointNetLK++ point cloud registration network model with embedded spatial attention mechanism and channel attention mechanism, the multiple sets of pre-processed 3D point cloud data obtained in step 5 are sequentially fused to obtain a 3D point cloud model containing a complete workpiece to be welded and its background; Step 7: Delete the background point cloud in the three-dimensional point cloud model including the complete workpiece to be welded and its background obtained in step 6 to obtain a three-dimensional point cloud model of the workpiece to be welded; Step 8: Calculate the normal vector of each point cloud in the three-dimensional point cloud model of the workpiece to be welded; Step 9: Determine the boundary points in the three-dimensional point cloud model of the workpiece to be welded according to the normal vector of each point cloud obtained in step 8; Step 10: Segment the three-dimensional point cloud model of the workpiece to be welded obtained in step 7 using the RANSAC multi-plane segmentation algorithm to obtain each plane of the workpiece to be welded; Step 11: Calculate the distance between each boundary point obtained in step 9 and each plane obtained in step 10 respectively. If the distance between a boundary point and at least two planes is 0, retain the corresponding point, form a set of all the retained points, and propose the points that make up the weld, thereby completing the weld extraction.
2. The method for automatically identifying the welding position of a large workpiece to be welded according to claim 1, characterized in that: The method for preprocessing the left and right views of each group of images collected in step 2 in step 3 is: reading the calibration result of step 1 into OpenCV, and then performing distortion elimination and row alignment on the left camera captured pictures and the right camera captured pictures in each group of images collected in step 2, so that the imaging origin coordinates of the left camera captured pictures and the right camera captured pictures in each group of images are consistent, the optical axes of the left and right cameras are parallel, the left and right imaging planes are coplanar, and the epipolar lines are aligned.
3. The method for automatically identifying the welding position of a large workpiece to be welded according to claim 1, characterized in that: The step 4 specifically comprises the following steps: Step 4-1: Construct a window of the same size and cover the images captured by the left and right cameras of the binocular camera respectively; Step 4-2: Select all the pixels in the window area and make a difference in the corresponding positions one by one, take the absolute value of the difference and sum it as the similarity of the two pixel blocks; Step 4-3: Move the window and repeat steps 4-1 to 4-2 to complete the similarity calculation of all corresponding pixel blocks, and take the area with the minimum value as the best matching pixel block; the pixel block is composed of pixels within the window size; Step 4-4: Match the feature points with edges and corners in the calibrated binocular image to obtain a disparity map, and use the disparity distance formula to calculate the depth map. Finally, according to the geometric model of the binocular camera, transform it into three-dimensional space to obtain three-dimensional point cloud information.
4. The method for automatically identifying the welding position of a large workpiece to be welded according to claim 1, characterized in that: The preprocessing in step 5 includes: point cloud denoising, outlier removal and point cloud smoothing.
5. The method for automatically identifying the welding position of a large workpiece to be welded according to claim 1, characterized in that: The PointNetLK++ point cloud registration network model based on embedded spatial attention mechanism and channel attention mechanism is to input the output result of the second layer sharedMLP of the PointNetLK network model into the attention mechanism module that adds the spatial attention mechanism and the channel attention mechanism for processing, and input the processed result into the third layer sharedMLP.
6. The method for automatically identifying the welding position of a large workpiece to be welded according to claim 1, characterized in that: The method for obtaining a three-dimensional point cloud model including a complete workpiece to be welded and its background in step 6 is: Step 6-1: In the initial state, the first and second groups of 3D point cloud data obtained in step 5 are input into the PointNetLK++ point cloud registration network model, and the PointNetLK++ point cloud registration network model outputs a transformation matrix; the transformation matrix is applied to the first or second group of 3D point cloud data to obtain first superimposed 3D point cloud data; Step 6-2: Input the obtained nth superimposed 3D point cloud data and the mth group of 3D point cloud data into the PointNetLK++ point cloud registration network model, and apply the transformation matrix output by the PointNetLK++ point cloud registration network model to the input nth superimposed 3D point cloud data to obtain the n+1th superimposed 3D point cloud data; the initial value of n is 1, m represents the number of each group of 3D point cloud data obtained in step 5, and the initial value of m is 3; Step 6-3: Let n=n+1, m=m+1, and then determine whether m at this time is greater than the total number of groups of 3D point cloud data obtained in step 5. If not, repeat steps 6-2 to 6-3; if greater, directly output the last superimposed 3D point cloud data, that is, obtain a 3D point cloud model containing a complete workpiece to be welded and its background.
7. The method for automatically identifying the welding position of a large workpiece to be welded according to claim 1, characterized in that: The basis for deleting the background point cloud in step 7 is a label pre-set on the background, and the label is a QR code label or a color label.
8. The method for automatically identifying the welding position of a large workpiece to be welded according to claim 1, characterized in that: The method for determining the boundary points in step 9 is: calculating the cosine similarity of the normal vectors of each point cloud and its nearest k points, and when the cosine similarity is less than 0.5, the point is considered to be a boundary point.
9. A computer-readable medium storing software, characterized in that: The software includes instructions that can be executed by one or more computers, and the instructions enable the one or more computers to perform operations through such execution, and the operations include the process of the method for automatic identification of welding positions of large workpieces to be welded as described in any one of claims 1-8.
10. A computer system, characterized in that: include: one or more processors; A memory storing operable instructions, wherein when the instructions are executed by the one or more processors, the one or more processors perform operations, wherein the operations include the process of the method for automatically identifying the welding position of a large workpiece to be welded as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Monocular image-oriented three-dimensional object detection method based on three-dimensional reconstruction
CN110689008A
Parallax optimization method based on attention mechanism
CN112509021A