Laser welding weld feature point recognition method and device based on deep learning
The YOLOv4 model is used to identify weld feature points and calculate the incident angle in laser welding, solving the problems of versatility and robustness of laser welding in the existing technology, and realizing real-time identification of various weld shapes and laser incident angle adjustment. , improving welding quality and system adaptability.
Patent Information
- Application Number
- CN202111467997.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-03
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2041-12-03
AI Technical Summary
The existing technology lacks versatility and robustness in laser welding, makes it difficult to classify various weld shapes in real time, and fails to effectively consider the adjustment of the laser incident angle, which affects the welding quality.
Using the YOLOv4 model combined with deep learning technology, weld feature point identification and contour shape analysis are performed through line laser sensor sampling images, the laser incident angle reference vector is calculated, and the feature point coordinates and incident angle information are transmitted to the robot control system to achieve real-time Posture adjustment.
It improves the recognition and classification accuracy of laser welding, enhances the robustness of the system, maintains efficient welding quality in complex welding environments, and adapts to the shape changes of three-dimensional special-shaped welds.
Smart Images

Figure CN114140439B
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of robot welding, and specifically is a method and device for identifying characteristic points of laser welding welds based on deep learning. Background Art
[0002] In recent years, laser welding has become increasingly popular in the industry due to its advantages such as high power density, low residual stress, easy beam control, and high welding precision. However, since the energy of laser is concentrated at the focal point, it places relatively high requirements on the consistency of the workpiece. Therefore, in actual welding production applications, a large number of fixtures are often required to fix the position of the weldment during batch production, which increases production costs and lacks flexibility. In addition, if the structural shape of the workpiece changes, these special fixtures will lose their function. The current mainstream solution to this type of problem is to use line laser sensors for real-time tracking.
[0003] The conventional line laser sensor is essentially an active vision line laser sensor based on line structured light. Its hardware is mainly composed of a line laser transmitter, an industrial camera and a filter lens. When working, 1) the line laser transmitter projects a light curtain to the surface around the weld of the workpiece to be welded. The light curtain intersects with the surface to generate a laser stripe representing the cross-sectional contour of the workpiece. The industrial camera captures the laser stripe image after filtering the laser stripe. 2) Then, the pixel coordinates of the feature points used for welding are extracted from the image through the feature point extraction algorithm. 3) Finally, after completing the calibration of the internal and external parameters of the industrial camera, the pixel coordinates of the feature points are mapped to the actual physical space of the camera through the triangulation principle.
[0004] Among them, for step 2), the pixel coordinates of the feature points used for welding are extracted from the image through the feature point extraction algorithm. Because it only uses the feature information of a small part of the image, this algorithm has very high requirements on the precision and accuracy of feature extraction and feature matching, and is very sensitive to errors, resulting in high requirements on the software and hardware of the entire measurement algorithm, which is not easy to implement and is difficult to apply to actual laser welding tracking.
[0005] In addition, the current mainstream solutions are mostly used in the field of arc welding, and some laser welding tracking applications are mostly for welds of specific shapes. These applications are all for specified scenarios, and the welding parameters will also be adapted to the corresponding scenarios. The setting process is relatively complicated, which weakens the advantage of high flexibility of weld tracking. To this end, the closest existing technical solutions are described as follows:
[0006] An invention patent with application number CN202011463792.8 discloses a method for automatic weld tracking based on a deep neural network, which includes a feature point detection network and a feature point tracking network. The feature point position information output by the feature point detection network is input into the feature point tracking network to realize automatic weld tracking. The feature point detection network consists of a feature extraction module, an attention mechanism module, a priori frame generation module and an identification and positioning module. The weld feature point tracking network consists of a feature extraction module, an attention mechanism module and a response output module. The invention uses neural networks to realize automatic weld tracking, designs weld feature point extraction networks and tracking networks according to the characteristics of weld images, can improve the efficiency and quality of welding, and improve the adaptability of the automatic weld tracking system in actual complex welding environments.
[0007] Another invention patent with application number CN202011477237.0 discloses a weld tracking method and device based on independent correction type deep learning, the device includes: a working platform, a controller, a vertical guide rail, a horizontal guide rail, a welding gun fixture, a line structured light visual line laser sensor, and a servo motor; the method includes: S1: collecting weld structured light images; S2: reading weld structured light images; S3: using YOLOV3 to identify the current weld type and locate the weld center position; S4: using the weld center position located by S3 as the tracking target, and initializing the KCF tracker; S5: welding starts, using the KCF-YOLOV3 algorithm to track the weld in real time; until welding is completed. The welding device and welding method described in this invention can automatically identify multiple welds and accurately locate the weld center area, which can effectively improve the weld detection speed and recognition accuracy, thereby improving welding efficiency.
[0008] Another invention patent with application number CN202110024740.9 discloses a laser vision weld tracking system based on the ERFNet network, which includes a line structured light vision line laser sensor module for collecting weld image information; an image processing and communication module and a robot and machine control module, which processes weld image information based on the ERFNet network to obtain weld feature points; and a robot and machine control module, which receives weld feature point information, obtains welding path instructions and performs operations. It introduces the segmentation idea in deep learning into weld feature extraction, and accurately extracts the weld light strip center line and welding feature points of multi-layer and multi-pass welds under complex welding conditions. Unlike the traditional algorithm that first extracts the center line and then calculates the feature points based on the center line, the ERFNet network can accurately extract two types of features in multi-layer and multi-pass welding at the same time, and then transmits the welding feature point information to the robot control module, controls the welding robot to move to the welding location, and realizes multi-layer and multi-pass welding weld tracking.
[0009] In the above-mentioned closest existing technologies, there are many interference factors in the complex welding environment, such as reflections on the surface of metal materials, spatter, arc light, smoke, oxidation, dust, etc. during welding. Most of the weld images collected by line laser sensors are complex backgrounds and contain a lot of noise. To address these problems, traditional image processing methods are easily affected by working conditions, workpieces and weld types, and often lack versatility and robustness. In addition, the current feature point extraction algorithm is relatively single for the identification of weld types, and it is usually difficult to classify weld types in real time, which makes it difficult for conventional weld feature extraction algorithms to be applied to application scenarios where there are multiple weld shapes in the same weld. Therefore, deep learning needs to be introduced to realize the identification and positioning of composite weld feature points.
[0010] However, the current deep learning algorithms also have some shortcomings. The most important problem is that the current deep learning algorithms are mainly used in the field of arc welding, and these applications do not take into account the requirements of laser welding for the laser incident angle. Specifically, due to the concentrated energy in the heat affected zone of the welding focus and the directional energy projection, the welding incident angle needs to be adjusted in real time during the welding process to ensure the welding quality. The current mainstream deep learning tracking methods usually only give the coordinate position of the feature points in the image, and ignore the problem that in addition to the position of the weld point, the incident angle reference vector of the laser welding at that position needs to be given to plan the robot posture to adjust the laser incident angle.
[0011] An article by Guo Haibing on weld feature extraction based on line structured light vision line laser sensor (Electronic Technology and Software Engineering. CNKI: SUN: DZRU. 0. 2020-04-047: 115-117.) uses a refinement algorithm, image contour extraction, and straight line fitting steps.
[0012] Another paper by Li Yini is Research on Laser Welding Weld Recognition and Trajectory Generation Based on Deep Learning (Master's Thesis of Huazhong University of Science and Technology. 2021). This paper proposes a laser welding weld recognition and detection method based on deep learning, which can accurately extract weld feature points from weld images collected during the welding process, and can meet actual production applications.
[0013] Among them, the above-mentioned research paper on laser welding weld recognition and trajectory generation based on deep learning is the research content of this research group. This application is a further improvement and optimization based on this paper. Although the paper mentioned that the feasibility of using YOLOv4 for weld recognition and detection was obtained by analyzing the characteristics of the YOLOv4 model, there is no specific solution for using YOLOv4 for feature point extraction. Summary of the invention
[0014] A brief summary of embodiments of the present invention is provided below to provide a basic understanding of certain aspects of the present invention. It should be understood that the following summary is not an exhaustive summary of the present invention. It is not intended to identify key or important parts of the present invention, nor is it intended to limit the scope of the present invention. Its purpose is merely to provide certain concepts in a simplified form as a prelude to a more detailed description discussed later.
[0015] The improved content of the present invention corresponds to the content in step 2) in the background technology, that is, the image sampled by the CCD is analyzed through deep learning to obtain the pixel coordinates of the feature points in the image, and on this basis, the contour shape of the weld in the image is analyzed to give a reference vector for laser welding. At the same time, a laser welding weld feature point recognition method is implemented by using YOLOv4 as an algorithm for feature point extraction, which solves the problems of lack of versatility and robustness of traditional visual algorithms in the welding process of three-dimensional special-shaped welds and difficulty in real-time classification of weld types, and solves the problem that laser welding requires planning the laser incident angle posture while extracting feature points.
[0016] According to one aspect of the present application, a method for identifying characteristic points of laser welding welds based on deep learning is provided, which comprises:
[0017] The line laser sensor and the laser welding head are coaxially mounted on the robot end effector. During the welding process, the laser welding head and the line laser sensor maintain a rigid spatial relationship, and the welding focus (laser focus) of the laser welding head is at a certain distance from the sampling area of the line laser sensor, and the certain distance is the leading distance.
[0018] The position of feature points is obtained from the image sampled by the line laser sensor, and the weld type is classified. After that, the weld contour line is obtained after preprocessing the image, and the laser incident angle reference vector z′ is calculated based on the position of feature points, contour type and contour shape;
[0019] The coordinates of the feature points in the sampled image and the laser incident angle reference vector are sent to the robot control system; the robot control system performs space mapping and trajectory planning operations, converts the image feature points and the laser incident angle reference vector into control quantities that can control the robot's motion and outputs them to the robot to control the robot's motion. The so-called laser incident angle reference vector refers to the projection vector of the laser projection vector on the line laser sampling plane, and the sampling plane specifically refers to the laser light curtain projected by the line laser sensor.
[0020] Specifically, the position of the feature point is obtained from the image sampled by the line laser sensor, and the weld type is classified. Then, the weld contour line is obtained after preprocessing the image, and the laser incident angle reference vector is calculated in combination with the position of the feature point, the contour type and the shape of the contour line. Specifically, the following steps are included:
[0021] Step 1: First, perform model training: sample images to create a data set and train the YOLOv4 network;
[0022] Step 2: Use the trained YOLOv4 model to identify the current weld type and contour feature point image coordinates, and obtain the contour type and contour feature point coordinates of this sampling;
[0023] Step 3: Solve the laser input angle reference vector at the weld feature point.
[0024] Furthermore, the model training in step 1 specifically includes:
[0025] Step 11: Sampling four types of weld contour images, namely, internal fillet, external fillet, butt joint and overlap, through a line laser sensor;
[0026] Step 12: Use LabelImg to mark the location of the feature points and the type of weld contour;
[0027] Step 13: Use the Mosaic algorithm in the YOLOv4 model to expand the data;
[0028] Step 14: Divide the data set into training set, test set and validation set and then perform model training.
[0029] Further, the step 2 of obtaining the coordinates of the contour feature points specifically includes: using the trained YOLOv4 model to output the target bounding box, calculating the grayscale centroid of the image in the target bounding box, and replacing the sub-pixel corner point with it as the weld feature point output. In the prior art, most deep learning methods actually take the center point of the target bounding box as the output, but in fact the center point of the bounding box may have a certain deviation from the real feature, so the laser welding weld recognition and trajectory generation research paper based on deep learning in the background technology also uses sub-pixel corner points as weld feature point outputs like the prior art, and its purpose is to use a feature point extraction method different from the center after obtaining the target bounding box, and want to extract feature points with higher accuracy. However, in the actual welding process, there are many interferences in the bounding box, which makes the image contour in the box very complicated, so the sub-pixel corner point extraction method often cannot correctly extract feature points. Therefore, this application uses the grayscale centroid method to estimate the position of the feature point through the distribution of light intensity, so that the determination of the feature point is more accurate than the center point of the frame and is not as susceptible to interference as the sub-pixel corner point method.
[0030] Furthermore, the step 3 of solving the laser input angle reference vector at the weld feature point specifically includes:
[0031] Step 31: Apply morphological operations to the image to filter the image and segment the weld contour in the image and the large reflected interference images caused by the laser projected by the line laser sensor (these interference images mainly occur during the sampling process of the internal corner joint).
[0032] Step 32: Binarize the image, calculate the area of all image contours in the image, set the lower and upper thresholds of the contour area, remove the image contours whose area exceeds the threshold, and for image contours with a large area but within the area threshold, calculate the ratio of the image contour area to the area of the smallest enclosing rectangle in which it is located. If it is greater than a certain value, it is judged as reflective interference. Finally, select the image contour with the largest area among the remaining contours and judge it as the weld. (The image contour specifically refers to the contour of the image block in the picture, which is different from the weld contour mentioned above)
[0033] Step 33: Extracting single pixel contour lines, specifically including the following process:
[0034] Use Zhang Suen thinning algorithm to find the center line of the contour image;
[0035] According to the properties of the line laser sensor, the image contour is ideally arranged horizontally, and any horizontal coordinate uniquely maps to a vertical coordinate, so the leftmost and rightmost endpoints of the center line can be regarded as the boundaries of the contour. Specifically, all endpoints and branch points of the contour line are traversed, where the leftmost endpoint is regarded as the starting point and the rightmost endpoint is regarded as the end point;
[0036] There may be many burrs and loops on the center line, which need to be removed to obtain a single-pixel weld contour line;
[0037] Deburring: remove the branch segments other than the starting point and the end point;
[0038] Merge loops: Count the number of pixels contained in all branches at each branch point, and refer to the method of dynamic programming to solve the TSP problem to obtain the only shortest path from the starting point to the end point as the final single-pixel contour line.
[0039] Step 34: Based on the results of YOLOv4's classification of weld types, different posture calculation methods are used for calculation:
[0040] A. Calculation of inner corner and outer corner posture: Calculate the point P on the single-pixel contour line that is closest to the feature point required by YOLOv4, and use point P as the segmentation point to segment the contour line, dividing the contour into a left contour and a right contour. Perform straight line fitting on the left and right contours (the fitting points are obtained by sampling the contour points at alternate points), and the points close to the feature points are given higher fitting weights. The equation of the straight line on the left side of the feature point is A1x+B1y=C1. If A1≠0, take A1>0. If A1=0, take B1=-1. The direction vector of the straight line is taken as The equation of the line on the right is A2x+B2y=C2. If A2≠0, take A2>0. If A2=0, take B2=1. Then the direction vector of the line is The reference vector is
[0041] B. Splicing and overlap calculation: After refinement, the points close to the feature points have a higher fitting weight. For example, the contour points use the least squares method to fit the straight line Ax+By=C. If B≠0, take B<0, then
[0042] Furthermore, the robot control system converts the image feature points and the laser incident angle reference vector into control quantities that can control the robot's motion. That is, the pose of the robot's end effector is solved by combining the pixel coordinates of the feature points with the laser incident angle reference vector z′. This pose can be obtained by an affine matrix in the robot's world coordinate system: Indicates; where t represents the coordinate of the feature point in the robot world coordinate system, x represents the vector of the welding focus pointing to the sampling center point of the line laser sensor, which is defined by the movement direction of the welding process, and z represents the z-axis of the robot TCP coordinate system, which refers to the light emitting direction of the laser welding head. The formula is: z = x × (z′ w ×x), y can be determined by the right-hand rule.
[0043] where z′ is transformed into z′ w The process conforms to the following relationship:
[0044]
[0045] The process of transforming feature points from pixel coordinates to robot space coordinates t conforms to the following relationship:
[0046]
[0047] in, Represents the pixel homogeneous coordinates of feature points, represents the sensor internal parameter matrix, represents the sensor extrinsic matrix, is the hand-eye relationship matrix, It is the homogeneous transformation matrix from the current TCP coordinate system to the robot world coordinate system.
[0048] Among them, the deep learning network structure adopted in this application is YOLOv4: YOLOv4 is the most comprehensive and comprehensive model in the YOLO family. The network is mainly composed of three parts (for further details, please refer to the article Qiao S, Pang S, Luo G, et al. Automatic Detection of Cardiac Chambers Using an Attention-based YOLOv4 Framework from Four-chamber View of Fetal Echocardiography [J], 2020.), namely Backbone (backbone feature extraction network): a convolutional neural network that aggregates image features at different image granularities, and improves the previous generation Darknet53 structure, drawing on Cross Stage Partial Networks (cross-stage local network). The improved structure is called CSPDarknet53 structure. On the basis of ensuring high detection accuracy and computing speed, the size of the network model is reduced, and a larger network input resolution is obtained for detecting small targets; Neck (neck structure): a series of network layers that mix and combine image features and pass image features to the prediction layer; Prediction (classification regression prediction network): predict image features, generate bounding boxes and prediction categories.
[0049] According to another aspect of the present application, a deep learning-based laser welding weld feature point recognition device is provided, which includes: a line single laser line laser sensor, a laser welding machine, a laser welding head, an industrial computer, an industrial robot and an industrial control cabinet; the line laser sensor and the laser welding head are coaxially installed on the end effector of the industrial robot, and during the welding process, the laser welding head and the line laser sensor maintain a rigid spatial relationship, and the welding focus (laser focus) of the laser welding head is a certain distance away from the sampling area of the line laser sensor, and the certain distance is the front distance; the line laser sensor includes an industrial camera, a line laser transmitter and a filter (filter), wherein the industrial camera can be implemented by a CCD camera of model delsa genem1280, when working, the line laser transmitter projects a laser light curtain onto the weld of the workpiece to form laser stripes, and then the industrial camera samples the laser stripes through the filter to form a weld contour image to the industrial computer; the industrial computer processes the image to obtain parameters indicating the weld position and the welding laser incident angle, and then converts these parameters into robot-readable control quantities to control the robot movement to guide the welding head to weld. The industrial computer serves as the main control of the entire system, which mainly includes a visual system, a robot control system and a laser welding control system. The algorithm adopted in the present invention is mainly implemented by the visual system, which is implemented by the above-mentioned deep learning-based laser welding weld feature point recognition method, in which the deep learning network structure is YOLOv4.
[0050] The present invention classifies weld types and identifies the positions of weld contour feature points through the deep learning network structure YOLOv4, and finally calculates the laser incident angle reference vector in combination with the positions of the feature points, the contour type and the shape of the contour line. This ensures that in the weld tracking process of three-dimensional special-shaped welds, even if the weld contour has a large shape difference before and after, the system still has a relatively high recognition and classification accuracy and has relatively high robustness. At the same time, real-time laser incident angle posture planning is achieved while obtaining the weld feature points. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] The present invention may be better understood by referring to the following description in conjunction with the accompanying drawings, wherein the same or similar reference numerals are used throughout the drawings to represent the same or similar components. The accompanying drawings, together with the following detailed description, are incorporated in and form a part of this specification and are used to further illustrate the preferred embodiments of the present invention and to explain the principles and advantages of the present invention.
[0052] In the figure:
[0053] Figure 1 is a structural diagram of the overall hardware system of an embodiment of the present invention;
[0054] Figure 2This is an installation diagram of the robot end line laser sensor and welding head according to an embodiment of the present invention;
[0055] Figure 3 A structural diagram of a line laser sensor according to an embodiment of the present invention;
[0056] Figure 4 This is a flowchart of a method for identifying characteristic points of a laser welding seam according to an embodiment of the present invention;
[0057] Figure 5 This is a detailed flow chart of a method for identifying characteristic points of a laser welding seam according to an embodiment of the present invention. DETAILED DESCRIPTION
[0058] Embodiments of the present invention will be described below with reference to the accompanying drawings. Elements and features described in one drawing or one embodiment of the present invention may be combined with elements and features shown in one or more other drawings or embodiments. It should be noted that for the purpose of clarity, the representation and description of components and processes that are not related to the present invention and are known to those of ordinary skill in the art are omitted in the drawings and descriptions.
[0059] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0060] See also Figure 1-Figure 3 The embodiment of the present invention proposes a laser welding seam tracking method and device based on YOLOv4. The device includes a single laser line laser sensor 1, a laser welding machine 2, a laser welding head 3, an industrial computer 4, an industrial robot 5 and an industrial control cabinet 6.
[0061] See also Figure 2 The line laser sensor 1 and the welding gun of the laser welding head 3 are coaxially mounted on the robot end effector, and the sampling area of the line laser sensor is a distance in front of the laser focus of the welding gun. The line laser sensor 1 is composed of an industrial camera 9, a line laser transmitter 11 and a filter 8. In this embodiment, the model of the industrial camera is delsa gene m1280. When working, the structure is as follows Figure 3, a line laser transmitter 11 projects a laser light curtain 10 onto the workpiece weld 12 to form laser stripes 9, and then an industrial camera 7 samples the stripes 9 through a filter 8 to form a weld contour image for the industrial computer. The industrial computer processes the image to obtain parameters indicating the weld position and the incident angle of the welding laser, and then converts these parameters into robot-readable control quantities to control the robot movement and guide the welding head to weld. The industrial computer is the main control of the entire system, and is specifically divided into a visual system, a robot control system, and a laser welding control system. The algorithm used in the present invention is mainly implemented by the visual system.
[0062] Specifically, the deep learning network structure used by the visual system is YOLOv4: YOLOv4 is the most comprehensive and comprehensive model in the YOLO family. The network is mainly composed of three parts, namely Backbone (backbone feature extraction network): a convolutional neural network that aggregates image features at different image granularity, and improves the previous generation Darknet53 structure. It draws on Cross Stage Partial Networks (cross-stage local network). The improved structure is called CSPDarknet53 structure. On the basis of ensuring high detection accuracy and operation speed, the size of the network model is reduced, and a larger network input resolution is used to detect small targets; Neck (neck structure): a series of network layers that mix and combine image features, and pass image features to the prediction layer; Prediction (classification regression prediction network): predict image features, generate bounding boxes and predicted categories.
[0063] The visual system obtains the position of feature points from the image sampled by the line laser sensor and classifies the weld type. After preprocessing the image, the weld contour is obtained through algorithms such as centerline extraction, and the laser incident angle reference vector z′ is calculated based on the position of the feature points, the contour type, and the shape of the contour. Finally, the visual system sends the coordinates of the feature points in the image and the laser incident angle reference vector to the robot control system, performs spatial mapping, trajectory planning and other operations to convert the image feature points and reference vectors into control quantities that can control the robot's motion, and then outputs them to the robot to control the robot's motion.
[0064] The so-called laser incident angle reference vector refers to the projection vector of the laser projection vector on the line laser sampling plane, wherein the sampling plane specifically refers to the laser light curtain projected by the line laser sensor.
[0065] Specifically, Figure 4 and Figure 5 As shown in the figure, the visual system performs the following steps to realize the recognition of weld feature points:
[0066] Process 1: First, perform model training: sample images to create a data set and train the YOLOv4 network:
[0067] (1-1) The line laser sensor is used to sample the contour images of four types of welds: internal fillet joint, external fillet joint, butt joint and lap joint.
[0068] (1-2) Use LabelImg to mark the location of feature points and the type of weld contour.
[0069] (1-3) The Mosaic algorithm in the YOLOv4 model is used for data expansion.
[0070] (1-4) Divide the data set into training set, test set and validation set and then perform model training.
[0071] Process 2: In actual work, the trained YOLOv4 model is used to identify the current weld type and contour feature point image coordinates, and obtain the contour type and contour feature point coordinates of this sampling; specifically, it includes:
[0072] (2-1) Use the trained YOLOv4 model to identify the current weld type and obtain the contour type of this sampling;
[0073] (2-2) Use the trained YOLOv4 model to obtain the coordinates of the contour feature points: Use the trained YOLOv4 model to output the target bounding box, calculate the grayscale center of gravity of the image in the target bounding box, and use it to replace the sub-pixel corner points as the weld feature point output.
[0074] Process 3: Solve the laser input angle reference vector at the weld feature point:
[0075] (3-1) Morphological operations are applied to the image to filter the image and segment the weld contour and the large reflected interference images caused by the laser projection of the line laser sensor (these interference images mainly occur during the sampling process of the internal angle joint);
[0076] (3-2) Binarize the image processed by (3-1), calculate the area of all image contours in the image, set the lower and upper thresholds of the contour area, remove the image contours whose area exceeds the threshold, and for image contours with a large area but within the area threshold, calculate the ratio of the image contour area to the area of the smallest enclosing rectangle in which it is located. If it is greater than a certain value, it is judged as reflective interference. Finally, select the image contour with the largest area among the remaining contours and judge it as the weld. (The image contour specifically refers to the contour of the image block in the picture, which is different from the weld contour mentioned above)
[0077] Sampling images, image morphological operations, binarization, setting upper and lower thresholds of image contour area and area ratio threshold, calculating the areas of all image contours, calculating the area of the smallest enclosing rectangle of the contour, deleting contours that exceed the threshold and whose ratio of image contour area to its enclosing rectangle is less than the set value, and determining that the image with the largest area among the remaining image contours is the weld contour,
[0078] (3-3) Extracting single pixel contour line thinning algorithm to extract weld contour skeleton, remove burrs, merge loops to form single pixel contour, and combine feature point coordinates to give contour pixel fitting weights:
[0079] (3-3-0) Use Zhang Suen thinning algorithm to find the center line of the contour image;
[0080] (3-3-1) According to the properties of the line laser sensor, the image contour is ideally arranged horizontally, and any horizontal coordinate uniquely maps to a vertical coordinate. Therefore, the leftmost and rightmost endpoints of the center line can be regarded as the boundaries of the contour. Specifically, all endpoints and branch points of the contour line are traversed, where the leftmost endpoint is regarded as the starting point and the rightmost endpoint is regarded as the end point.
[0081] (3-3-2) There may be many burrs and loops on the center line, which need to be removed to obtain a single-pixel weld contour line;
[0082] (3-3-2-1) Deburring: remove the branch segments other than the starting point and the end point;
[0083] (3-3-2-2) Merge loop: Count the number of pixels contained in all branches at each branch point, and refer to the method of dynamic programming to solve the TSP problem to obtain the only shortest path from the starting point to the end point as the final single-pixel contour line;
[0084] (3-4) According to the results of YOLOv4 on weld type classification, different posture calculation methods are used:
[0085] (3-4-1) Calculation of inner corner and outer corner posture: Calculate the point P on the single-pixel contour line that is closest to the feature point required by YOLOv4, and use point P as the segmentation point to segment the contour line, dividing the contour into a left contour and a right contour. Perform straight line fitting on the left and right contours (the fitting points are obtained by sampling the contour points at alternate points), and the points close to the feature points are given higher fitting weights. The equation of the straight line on the left side of the feature point is A1x+B1y=C1. If A1≠0, take A1>0. If A1=0, take B1=-1. The direction vector of the straight line is The equation of the line on the right is A2x+B2y=C2. If A2≠0, take A2>0. If A2=0, take B2=1. Then the direction vector of the line is The reference vector is
[0086] (3-4-2) Splicing and overlap calculation: After refinement, the points close to the feature points have a higher fitting weight. For example, the contour points use the least squares method to fit the straight line Ax+By=C. If B≠0, take B<0, then The reference vector is a vector pointing from the feature point to the lower part of the image parallel to the normal of the fitting line.
[0087] Process 4: Solve the robot end pose based on feature points and reference vectors: The robot control system converts the image feature points and the laser incident angle reference vector into control quantities that can control the robot's motion, that is, the pose of the robot end effector is solved by combining the feature point pixel coordinates with the laser incident angle reference vector z′. This pose can be obtained by an affine matrix in the robot world coordinate system Indicates; where t represents the coordinate of the feature point in the robot world coordinate system, x represents the vector of the welding focus pointing to the sampling center point of the line laser sensor, which is defined by the movement direction of the welding process, and z represents the z-axis of the robot TCP coordinate system, which refers to the light emitting direction of the laser welding head. The formula is: z = x × (z′ w ×x), y can be determined by the right-hand rule.
[0088] where z′ is transformed into z′ w The process conforms to the following relationship:
[0089]
[0090] The process of transforming feature points from pixel coordinates to robot space coordinates t conforms to the following relationship:
[0091]
[0092] in, Represents the pixel homogeneous coordinates of feature points, represents the sensor internal parameter matrix, represents the sensor extrinsic matrix, is the hand-eye relationship matrix, It is the homogeneous transformation matrix from the current TCP coordinate system to the robot world coordinate system.
[0093] This application further improves and optimizes the research paper on laser welding weld recognition and trajectory generation based on deep learning mentioned in the background technology. This application specifically divides the feature point extraction step into two steps. First, deep learning gives a target bounding box, and then the content in the target bounding box is extracted through sub-pixel corner points to extract the fine coordinates of the feature points. At the same time, in order to avoid manually setting the threshold, which leads to the defect that the classification cannot be achieved if the weld types at different positions of the weld are different during the re-identification process, this application uses the grayscale centroid of the image in the target bounding box extracted by YOLO instead of the sub-pixel corner point extraction as the feature point output.
[0094] In addition, laser welding requires contour information to adjust the incident angle of the laser in real time, while the deep learning method in the prior art only extracts the type of contour and the location information of the feature points each time sampling, and the morphological information of the contour is lost after sampling. In response to this problem, this application specifically proposes step 3 to solve this problem. In the solutions of the prior art, one part does not mention the extraction of contour morphological information, and the other part obtains feature points through contour morphological information, but neither proposes how the contour morphological information is applied to the adjustment of welding posture. This is mainly because the welding trajectory of the current welding case is not too complicated. Secondly, these applications are basically arc welding, and there are no requirements for welding posture. Therefore, the application of the prior art does not need to consider these, that is, there is no above-mentioned technical problem. However, since the laser incident angle affects the welding quality in the laser welding in this application, the posture must be adjusted in real time to meet the welding needs. Therefore, the solution of step 3 of this application is to solve the unique technical problems encountered by this application.
[0095] Through the above scheme, the present application adopts the deep learning network structure YOLOv4 to determine the contour type, and extracts the contour feature points through YOLOv4, and then calculates the laser incident angle reference vector based on the position of the feature points, the contour type and the shape of the contour line, wherein the laser incident angle reference vector is calculated according to whether the contour type is an internal corner connection or an external corner connection. If it is an internal corner connection or an external corner connection, the contour line is divided, and straight lines are fitted on the left and right sides to calculate the angle to obtain the welding laser incident angle reference vector; if it is a splicing or overlapping, the single-pixel contour line is fitted with a straight line, and the normal vector of the fitted straight line is taken as the incident angle reference vector.
[0096] The solution of the present invention uses the deep learning network structure YOLOv4 to achieve a relatively high recognition and classification accuracy rate and robustness in the process of weld tracking of three-dimensional special-shaped welds, even if the shape of the weld contour before and after is quite different. At the same time, real-time laser incident angle posture planning is achieved while obtaining weld feature points.
[0097] It should be emphasized that the term “include / comprises” when used herein refers to the presence of features, elements, steps or components, but does not exclude the presence or addition of one or more other features, elements, steps or components.
[0098] The method of the present invention is not limited to being executed in the time sequence described in the specification, and may also be executed in other time sequences, in parallel or independently. Therefore, the execution order of the method described in this specification does not limit the technical scope of the present invention.
[0099] Although the present invention has been disclosed above by describing specific embodiments of the present invention, it should be understood that all the above embodiments and examples are exemplary rather than restrictive. Those skilled in the art may design various modifications, improvements or equivalents of the present invention within the spirit and scope of the appended claims. These modifications, improvements or equivalents should also be considered to be included in the protection scope of the present invention.
Claims
1. A laser welding weld feature point recognition method based on deep learning, characterized by: include: The line laser sensor and the laser welding head are coaxially mounted on the robot end effector. During the welding process, the laser welding head and the line laser sensor maintain a rigid spatial relationship, and the welding focus of the laser welding head is at a certain distance from the sampling area of the line laser sensor, and the certain distance is the leading distance. The position of the feature point is obtained from the image sampled by the line laser sensor, and the weld type is classified. After that, the weld contour line is obtained after preprocessing the image, and the laser incident angle reference vector is calculated in combination with the position of the feature point, the contour type and the shape of the contour line; wherein the so-called laser incident angle reference vector refers to the projection vector of the laser projection vector on the line laser sampling plane, and the line laser sampling plane specifically refers to the laser light curtain projected by the line laser sensor; The coordinates of the feature points in the sampled image and the reference vector of the laser incident angle are sent to the robot control system; the robot control system performs space mapping and trajectory planning operations, converts the image feature points and the reference vector of the laser incident angle into control quantities that can control the movement of the robot and outputs them to the robot to control the movement of the robot; The position of the feature point is obtained from the image sampled by the line laser sensor, and the weld type is classified. After that, the weld contour line is obtained after preprocessing the image, and the laser incident angle reference vector is calculated based on the position of the feature point, the contour type and the shape of the contour line. The specific steps include: Step 1: First, perform model training: sample images to create a data set and train the YOLOv4 network; Step 2: Use the trained YOLOv4 model to identify the current weld type and contour feature point image coordinates, and obtain the contour type and contour feature point coordinates of this sampling; Step 3: Solve the laser input angle reference vector at the weld feature point; The step 1 of model training specifically includes: Step 11: Sampling four types of weld contour images, namely, internal fillet, external fillet, butt joint and overlap, through a line laser sensor; Step 12: Use LabelImg to mark the location of the feature points and the type of weld contour; Step 13: Use the Mosaic algorithm in the YOLOv4 model to expand the data; Step 14: Divide the data set into training set, test set and validation set and then perform model training; The step 2 of obtaining the coordinates of the contour feature points specifically includes: using the trained YOLOv4 model to output a target bounding box, calculating the grayscale centroid of the image in the target bounding box, and replacing the sub-pixel corner point with the grayscale centroid as the weld feature point output; The step 3 of solving the laser input angle reference vector at the weld feature point specifically includes: Step 31: Apply morphological operations to the image to filter the image and segment the weld contour and the large reflection interference image caused by the laser projected by the line laser sensor in the image; Step 32: Binarize the image, calculate the area of all image contours in the image, set the lower and upper thresholds of the contour area, remove the image contours whose area exceeds the threshold, and for the image contours with a large area but within the area threshold, calculate the ratio of the round image contour product to the area of the smallest enclosing rectangle in which it is located. If it is greater than a certain value, it is judged as reflective interference. Finally, the image contour with the largest area among the remaining contours is selected and judged as the weld; Step 33: extracting single pixel contour lines; Step 34: Based on the results of YOLOv4 classification of weld types, a targeted posture calculation method is used to calculate the laser input angle reference vector at the weld feature point; The step 34 specifically includes: A. Calculation of inner corner and outer corner poses: Calculate the point P on the single-pixel contour line that is closest to the feature point required by YOLOv4, and segment the contour line using point P as the segmentation point, dividing the contour into a left contour and a right contour; perform straight line fitting on the left and right contours, and assign higher fitting weights to points close to the feature points; The equation of the line on the left side of the feature point is A1x+B1y=C1. If A1≠0, take A1>0. If A1=0, take B1=-1. Then the direction vector of the line is The equation of the line on the right is A2x+B2y=C2. If A2≠0, take A2>
0. If A2=0, take B2=1. Then the direction vector of the line is The reference vector is B. Splicing and overlap calculation: After refinement, the points close to the feature points have a higher fitting weight. For example, the contour points use the least squares method to fit the straight line Ax+By=C. If B≠0, take B<0, then 2. The method for identifying characteristic points of laser welding seams based on deep learning according to claim 1, characterized in that: The step 33 of extracting the single pixel contour line specifically includes the following process: Use thinning algorithm to find the center line of the contour image; According to the properties of the line laser sensor, the image contour is ideally arranged horizontally, and any horizontal coordinate uniquely maps to a vertical coordinate, so the leftmost and rightmost endpoints of the center line can be regarded as the boundaries of the contour. Specifically, all endpoints and branch points of the contour line are traversed, where the leftmost endpoint is regarded as the starting point and the rightmost endpoint is regarded as the end point; There may be many burrs and loops on the center line, which need to be removed to obtain a single-pixel weld contour line; Deburring: remove the branch segments other than the starting point and the end point; Merge loops: Count the number of pixels contained in all branches at each branch point, and refer to the method of dynamic programming to solve the TSP problem to obtain the only shortest path from the starting point to the end point as the final single-pixel contour line.
3. The laser welding weld feature point recognition method based on deep learning according to claim 1 is characterized in that: The robot control system converts the image feature points and the laser incident angle reference vector into control quantities that can control the robot motion, that is, the pixel coordinates of the feature points combined with the laser incident angle reference vector z ′ Solve the pose of the robot end effector, which can be obtained by an affine matrix in the robot world coordinate system Indicates; where t represents the coordinate of the feature point in the robot world coordinate system, x represents the vector of the welding focus pointing to the sampling center point of the line laser sensor, which is defined by the movement direction of the welding process, and z represents the z-axis of the robot TCP coordinate system, which refers to the light emitting direction of the laser welding head. The formula is: z = x × (z ′ w ×x) is solved, and y can be determined by the right-hand rule; where z ′ Convert to z ′ w The process conforms to the following relationship: The process of transforming feature points from pixel coordinates to robot space coordinates t conforms to the following relationship: in, Represents the pixel homogeneous coordinates of feature points, represents the sensor internal parameter matrix, represents the sensor extrinsic matrix, is the hand-eye relationship matrix, It is the homogeneous transformation matrix from the current TCP coordinate system to the robot world coordinate system.
4. A laser welding weld feature point recognition device based on deep learning, characterized in that: include: Line single laser line laser sensor, laser welding machine, laser welding head, industrial computer and industrial robot; the line laser sensor and the laser welding head are coaxially mounted on the end effector of the industrial robot, the laser welding head and the line laser sensor maintain a rigid spatial relationship during the welding process, and the welding focus of the laser welding head is a certain distance away from the sampling area of the line laser sensor, and the certain distance is the leading distance; The line laser sensor includes an industrial camera, a line laser transmitter and a filter. The line laser transmitter projects a laser light curtain onto the weld of the workpiece to form laser stripes. The industrial camera then samples the laser stripes through the filter to form a weld contour image for the industrial computer. The industrial computer processes the image to obtain parameters indicating the weld position and the incident angle of the welding laser, and then converts these parameters into control quantities readable by the robot to control the robot movement and guide the welding head to perform welding. The industrial computer includes a visual system, a robot control system and a laser welding control system, wherein the visual system adopts the deep learning-based laser welding weld feature point recognition method described in any one of claims 1-3.
Citation Information
Patent Citations
Automatic weld joint tracking method based on deep neural network
CN112548273A
Welding seam tracking method and device based on independent deviation correction type deep learning
CN112589232A
Laser vision seam tracking system based on ERFNet network
CN112756742A
Three-dimensional detection and welding seam inflection point identifying method for multilayer multiple welding seams of robot
CN107876970A
Intelligent control welding system based on vision measurement
CN112959329A
