Weld seam recognition method and device, computer device and storage medium
By scanning the welded workpiece along a preset scanning trajectory on different planes, the approximate intersection point of the weld is determined, which solves the problem of insufficient accuracy and consistency in traditional weld recognition methods and achieves higher accuracy weld recognition.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENZHEN HANS ROBOT CO LTD
- Filing Date
- 2024-12-23
- Publication Date
- 2026-06-30
AI Technical Summary
Traditional weld seam identification methods are insufficient in terms of accuracy and consistency, especially in complex workpieces or high-precision welding requirements, where manual teaching and simple sensor identification have low accuracy.
The welding workpiece is scanned along preset vertical first and second scanning trajectories to determine the approximate intersection of the first and second scanning lines. The starting and ending coordinates of the weld are obtained by fitting line segments. The laser or scanning equipment is used to scan different planes to reduce the uncertainty of human operation.
It improves the accuracy and consistency of weld identification, reduces the uncertainty caused by human operation by covering the weld from multiple angles, and achieves more accurate determination of the start and end coordinates of the weld.
Smart Images

Figure CN119820054B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of welding technology, and in particular to a weld identification method, apparatus, computer equipment, storage medium, and computer program product. Background Technology
[0002] With the development of welding technology, in order to meet the requirements of high precision and high efficiency welding, weld seams are usually planned on the workpiece before actual welding. Then, welding robots or other welding equipment are controlled to weld along the weld seams. Therefore, how to accurately identify weld seams has become the key to improving welding accuracy.
[0003] In traditional solutions, it is usually necessary to identify the start and end points of the weld seam through manual teaching or by relying on manual visual inspection and simple sensors. For example, the operator first manually controls the welding robot to move along the weld seam to inform the welding robot of the start and end points of the weld seam.
[0004] However, traditional solutions, whether manual teaching, visual inspection, or simple sensor-based weld seam identification, are clearly insufficient in terms of accuracy and consistency, especially when faced with complex workpieces or high-precision welding requirements, where the weld seam identification accuracy of the above solutions is low. Summary of the Invention
[0005] Therefore, it is necessary to provide a weld identification method, apparatus, computer equipment, computer-readable storage medium, and computer program product that can improve the accuracy of weld identification in response to the above-mentioned technical problems.
[0006] Firstly, this application provides a weld identification method. The method includes:
[0007] The welding workpiece is scanned along a preset first scanning trajectory and a preset second scanning trajectory respectively, and a first scanning line and a second scanning line are determined. The first scanning trajectory and the second scanning trajectory are respectively located in a first plane and a second plane that are perpendicular to each other. Both the first scanning trajectory and the second scanning trajectory contain the weld seam.
[0008] Determine the approximate intersection point of the first scan line and the second scan line;
[0009] The starting point coordinates and ending point coordinates of the weld are determined based on the first scan line, the second scan line, and the approximate intersection point.
[0010] In one embodiment, the step of scanning the welding workpiece along a preset first scanning trajectory and a preset second scanning trajectory, respectively, to determine the first scanning line and the second scanning line, includes:
[0011] The welding workpiece is scanned along a preset first scanning trajectory and a preset second scanning trajectory, respectively, to obtain the first scanning result and the second scanning result;
[0012] The first scan result and the second scan result are respectively fitted into polylines containing a preset number of line segments to obtain the first scan line and the second scan line.
[0013] In one embodiment, fitting the first scan result and the second scan result into a polyline containing a preset number of line segments to obtain a first scan line and a second scan line includes:
[0014] The first scan result is fitted into a first scan line containing three line segments, the first scan line including a first line segment, a second line segment and a third line segment connected in sequence;
[0015] The second scan result is fitted into a second scan line containing three line segments, the second scan line including a fourth line segment, a fifth line segment and a sixth line segment connected in sequence.
[0016] In one embodiment, determining the approximate intersection point of the first scan line and the second scan line includes:
[0017] Determine the first approximate intersection point of the first line segment and the fourth line segment, and determine the second approximate intersection point of the third line segment and the sixth line segment;
[0018] The approximate intersection point includes the first approximate intersection point and the second approximate intersection point.
[0019] In one embodiment, the first plane is an XY plane, the second plane is an XZ plane, and the approximate intersection points include a first approximate intersection point of the first line segment and the fourth line segment, and a second approximate intersection point of the third line segment and the sixth line segment; determining the start-point and end-point coordinates of the weld seam based on the first scan line, the second scan line, and the approximate intersection points includes:
[0020] Based on the X and Y coordinates of the first approximate intersection point, determine the X and Y coordinates of the starting point of the weld.
[0021] Based on the X and Y coordinate values of the second approximate intersection point, determine the X and Y coordinate values of the end point of the weld.
[0022] Based on the coordinates of the second line segment, the fifth line segment, the first approximate intersection point, and the second approximate intersection point, determine the Z-coordinate value of the starting point of the weld and the Z-coordinate value of the ending point of the weld;
[0023] The starting coordinates of the weld include the X, Y, and Z coordinates of the starting point of the weld, and the ending coordinates of the weld include the X, Y, and Z coordinates of the ending point of the weld.
[0024] In one embodiment, determining the Z-coordinate value of the start point of the weld and the Z-coordinate value of the end point of the weld based on the coordinate values of the second line segment, the fifth line segment, the first approximate intersection point, and the second approximate intersection point includes:
[0025] When the second line segment is parallel to the fifth line segment, the distance between the second line segment and the fifth line segment is determined. Based on the distance and the Z coordinate value of the first approximate intersection point, the Z coordinate value of the starting point of the weld is determined. Based on the distance and the Z coordinate value of the second approximate intersection point, the Z coordinate value of the ending point of the weld is determined.
[0026] When the second line segment is not parallel to the fifth line segment, the Z coordinate value of the starting point of the weld and the Z coordinate value of the ending point of the weld are determined by interpolation based on the coordinate values of the first approximate intersection point and the second approximate intersection point.
[0027] Secondly, this application also provides a weld identification device. The device includes:
[0028] The scanning module is used to scan the welding workpiece along a preset first scanning trajectory and a preset second scanning trajectory, and to determine the first scanning line and the second scanning line. The first scanning trajectory and the second scanning trajectory are respectively located in a first plane and a second plane that are perpendicular to each other. Both the first scanning trajectory and the second scanning trajectory contain the weld seam.
[0029] An approximate intersection point determination module is used to determine the approximate intersection point of the first scan line and the second scan line;
[0030] The weld seam identification module is used to determine the start-point and end-point coordinates of the weld seam based on the first scan line, the second scan line, and the approximate intersection point.
[0031] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps in the above-described weld seam identification method embodiments.
[0032] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, implements the steps in the above-described weld seam identification method embodiments.
[0033] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the steps in the above-described weld seam identification method embodiments.
[0034] The aforementioned weld seam identification method, apparatus, computer equipment, storage medium, and computer program product differ from traditional solutions that rely on manual teaching. This solution scans the welded workpiece along preset first and second scanning trajectories, with these trajectories located on mutually perpendicular first and second planes, both encompassing the weld seam. This scanning on different planes allows for multi-angle coverage of the weld seam, reducing uncertainties caused by manual operation and standardizing the process of acquiring weld seam-related information. This effectively addresses the inconsistency issues of traditional solutions. Furthermore, after acquiring the first and second scanning lines, their approximate intersection point is determined. Finally, based on the first and second scanning lines and the determined approximate intersection point, the start and end points of the weld seam can be comprehensively and accurately reflected, improving the accuracy of weld seam identification. Attached Figure Description
[0035] Figure 1 This is an application environment diagram of the weld identification method in one embodiment;
[0036] Figure 2 This is a flowchart illustrating a weld identification method in one embodiment;
[0037] Figure 3 This is a schematic diagram of a weld in one embodiment;
[0038] Figure 4 This is a schematic diagram of the first scan trajectory in one embodiment;
[0039] Figure 5 This is a schematic diagram of the second scan trajectory in one embodiment;
[0040] Figure 6 This is a flowchart illustrating the weld identification method in another embodiment;
[0041] Figure 7 This is a flowchart illustrating the weld identification method in yet another embodiment;
[0042] Figure 8 This is a schematic diagram of the first scan line and the second scan line in one embodiment;
[0043] Figure 9 This is a flowchart illustrating the process of determining the Z-coordinate values of the start and end points of a weld in one embodiment.
[0044] Figure 10This is a flowchart illustrating the process of determining the Z-coordinate values of the start and end points of a weld in another embodiment.
[0045] Figure 11 This is a structural block diagram of a weld seam recognition device in one embodiment;
[0046] Figure 12 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0047] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0048] The weld identification method provided in this application embodiment can be applied to, for example, Figure 1 In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104, or it can be located in the cloud or on another network server.
[0049] Specifically, terminal 102 can be a visual acquisition device such as a laser scanner, or server 104 can control terminal 102 to scan the welding workpiece along a preset first scanning trajectory and a preset second scanning trajectory, respectively, to determine the first scanning line and the second scanning line. The first scanning trajectory and the second scanning trajectory are respectively located in a first plane and a second plane that are perpendicular to each other. Both the first scanning trajectory and the second scanning trajectory contain the weld. Then, server 104 determines the approximate intersection point of the first scanning line and the second scanning line. Finally, server 104 determines the starting coordinates and ending coordinates of the weld based on the first scanning line, the second scanning line and the approximate intersection point.
[0050] Server 104 can be implemented using a standalone server or a server cluster consisting of multiple servers.
[0051] In one embodiment, such as Figure 2 As shown, a weld identification method is provided, which can be applied to... Figure 1 Taking server 104 as an example, the following steps are included:
[0052] S100, scan the welding workpiece along the preset first scanning trajectory and the preset second scanning trajectory respectively, and determine the first scanning line and the second scanning line.
[0053] The first and second scanning trajectories are located on a first plane and a second plane, respectively, which are perpendicular to each other. Both the first and second scanning trajectories include the weld seam. The first and second scanning lines are essentially sets of points. Since the first and second scanning trajectories are located on two perpendicular planes, the first scanning line reflects the projection characteristics of the weld seam on the first plane, and the second scanning line reflects the projection characteristics of the weld seam on the second plane. In this way, the first and second scanning lines obtained by scanning can cover the area where the weld seam is located as comprehensively as possible.
[0054] like Figure 3 As shown, line segment PQ represents the weld seam to be welded, point P is the starting point of the weld seam, and point Q is the ending point of the weld seam. To accurately control the welding robot to weld the workpiece along the weld seam, the coordinates of points P and Q need to be determined first, serving as the starting and ending points of the welding robot's arc. Specifically, a laser can scan the workpiece along a preset first scanning trajectory and a preset second scanning trajectory. The laser can be pre-calibrated with a collaborative robot (e.g., a welding robot), and the first and second scanning lines obtained by the laser scanning the workpiece are both within the collaborative robot's coordinate system.
[0055] S200, determine the approximate intersection point of the first scan line and the second scan line.
[0056] The first scan line and the second scan line are not actually in the same plane. Therefore, the first scan line and the second scan line do not actually have a real intersection point. In three-dimensional space, the two points that are closest to each other on the first scan line and the second scan line can be considered as their approximate intersection point.
[0057] For example, since both the first and second scan lines are point sets containing a number of points, several straight lines can be used to approximate these points, resulting in the first and second scan lines, which can be represented by broken line segments. In space, the approximate focus of two straight lines on different planes can be determined by numerical iteration, geometric approximation, or other methods to identify the two closest points on the two lines. For instance, two points can be arbitrarily selected on the first and second scan lines, and the distance between these two points in space can be calculated. The positions of these two points on the first and second scan lines can be iterated continuously until the two points with the smallest distance are determined, which are then used as the approximate intersection of the first and second scan lines.
[0058] It should be noted that for complex welded workpieces, the approximate intersection point may not necessarily be the start or end point of the weld. However, the approximate intersection point can still provide some positional information for the start and end points of the weld, because the first and second scan lines depict the position of the weld in space from different vertical planes. By combining the approximate intersection point, as well as the direction of the first and second scan lines, the start and end points of the weld can be further analyzed.
[0059] S300: Determine the starting and ending coordinates of the weld seam based on the first scan line, the second scan line, and the approximate intersection point.
[0060] Specifically, the first and second scan lines are obtained by scanning the welded workpiece along a preset scan trajectory, reflecting the spatial position information of the weld from different vertical planes. Following the above steps, the first and second scan lines can be fitted with a preset number of line segments, such as three line segments.
[0061] For example, such as Figure 4 As shown, the preset first scanning trajectory can be as indicated by the arrow direction, with the laser moving along... Figure 4 The workpiece is scanned in the direction of the arrow to obtain the first scan line. Then, three line segments are used to fit the first scan line, i.e. Figure 4 From Similarly, such as Figure 5 As shown, the preset first scanning trajectory can be as indicated by the arrow direction, with the laser moving along... Figure 5 The arrow direction is used to scan the welding workpiece to obtain the second scan line. Similarly, three line segments are used to fit the second scan line, i.e. Figure 5 In .
[0062] Furthermore, it can be calculated and The approximate intersection point is used as a reference point for the start of the weld. and The approximate intersection point is used as a reference point for the end of the weld, for example... and The approximate intersection point is and ,in In superior, In Up, can be taken and The midpoint of the X-coordinate and the endpoint of the Y-coordinate are used to determine the X-coordinate and Y-coordinate values of the starting point of the weld, and the endpoint of the weld is determined in the same way.
[0063] Furthermore, since the scan lines obtained by the laser scanning are all in the coordinate system of the collaborative robot, the posture of the collaborative robot may change between two scans. and There may be slight deviations in the Z direction, therefore, it can be determined according to... and Information such as the included angle is used to fit the Z coordinate values of the start and end points of the weld using interpolation methods, and finally the start and end coordinates of the weld are determined.
[0064] The aforementioned weld seam identification method differs from traditional methods that rely on manual teaching. This method scans the welded workpiece along two preset scanning trajectories: a first scan trajectory and a second scan trajectory. These trajectories lie on mutually perpendicular first and second planes, respectively, and both include the weld seam. Scanning on different planes allows for multi-angle coverage of the weld seam, reducing the uncertainty caused by manual operation and standardizing the process of acquiring weld seam information. This effectively addresses the inconsistency issues of traditional methods. Furthermore, after acquiring the first and second scan lines, their approximate intersection point is determined. Finally, based on the first and second scan lines and the determined approximate intersection point, the start and end points of the weld seam can be comprehensively and accurately reflected, improving the accuracy of weld seam identification.
[0065] In one embodiment, such as Figure 6 As shown, S100 includes:
[0066] S110, scan the welding workpiece along the preset first scanning trajectory and the preset second scanning trajectory respectively, and obtain the first scanning result and the second scanning result.
[0067] S120, the first scan result and the second scan result are respectively fitted into polylines containing a preset number of line segments to obtain the first scan line and the second scan line.
[0068] Specifically, when a laser or other scanning device scans the welded workpiece along the first scanning trajectory, the scanning device will collect data from the surface of the welded workpiece at a preset sampling frequency, obtaining the spatial coordinates of multiple scanning points. These numerous data points together constitute the first scanning result. Similarly, when a laser or other scanning device scans the welded workpiece along the second scanning trajectory, it can also obtain the spatial coordinates of multiple scanning points, constituting the second scanning result.
[0069] Furthermore, since the first and second scan results contain a large number of data points, directly using these data points to analyze the weld location is difficult. Therefore, simplification and abstraction are required. The data points in the first and second scan results are fitted into polyline segments to obtain the first and second scan lines. Fitting methods include, but are not limited to, least squares method, Ramer-Douglas-Peucker (RDP) algorithm, etc. The basic idea of the RDP algorithm is to recursively find the point farthest from the given polyline fitting line and then, based on a preset accuracy threshold, [the remaining data is missing from the provided text]. To determine whether to retain this point, if the distance from the point to the fitted line is greater than a preset accuracy threshold. Then this point will be preserved, and the polyline will be divided into two segments at this point. The same process will be recursively performed on these two segments until the distance from all points to the given fitted line is less than or equal to the preset accuracy threshold. Furthermore, by adjusting the preset precision threshold... The number of line segments in the first and second scan lines obtained by final fitting can be adjusted.
[0070] In this embodiment, the scanning results obtained directly by the scanning device contain a large number of discrete points. By fitting these points with line segments, the originally complex set of points can be simplified into a polyline. In subsequent operations such as calculating the approximate intersection of two scanning lines and determining the starting and ending coordinates of the weld, processing the polyline is much simpler than processing a large number of discrete scanning points, greatly reducing the computational complexity and effectively improving the weld recognition efficiency.
[0071] In one embodiment, such as Figure 7 As shown, S120 includes:
[0072] S121, the first scan result is fitted into a first scan line containing three line segments, the first scan line including a first line segment, a second line segment and a third line segment connected in sequence.
[0073] S122, the second scan result is fitted into a second scan line containing three line segments, the second scan line including a fourth line segment, a fifth line segment and a sixth line segment connected in sequence.
[0074] Following the above embodiment, taking a case with 3 line segments as an example, as... Figure 4 As shown, the first line segment is The second line segment is The third line segment is ,like Figure 5 As shown, the fourth line segment is The fifth line segment is The sixth line segment is .
[0075] Specifically, the following example uses the RDP algorithm to fit the first scan result to explain in detail how the point set in the scan result is simplified into line segments. Let the first scan result be denoted as the point set. Initially, the point set is simplified into line segments. ,in As the starting point of the point set, For the endpoint of the point set, calculate These intermediate points to line segments Find the point with the largest vertical distance. This point is the one with the greatest perpendicular distance from the line connecting the starting point and the ending point. Let this perpendicular distance be denoted as... .like Less than or equal to a preset threshold Then discard Translate these intermediate points directly into line segments. Alternative, if Greater than the preset threshold Then keep and the line segment from The point is split into two segments, namely line segments. and line segments The following will focus on line segments. and line segments The same method is used to process intermediate points until the perpendicular distance from the intermediate point of each line segment to the corresponding line segment is less than or equal to a preset threshold. In this embodiment, by adjusting a preset threshold... This results in the first and second scan lines containing only three line segments.
[0076] In this embodiment, by fitting the scanning results into three line segments, compared to using a large number of discrete scanning points, the complexity of subsequent data processing is greatly reduced. Since the three line segments can more accurately describe the trajectory of the weld, the starting point coordinates and ending point coordinates of the weld can be accurately determined based on the positional relationship of each line segment, thereby improving the weld recognition efficiency.
[0077] In one embodiment, S200 includes: determining a first approximate intersection point of a first line segment and a fourth line segment, and determining a second approximate intersection point of a third line segment and a sixth line segment, wherein the approximate intersection point includes the first approximate intersection point and the second approximate intersection point.
[0078] Following the above embodiments, the spatial positional relationship between the first scan line and the second scan line is as follows: Figure 8 As shown, by determining the first line segment With the fourth line segment The first approximate intersection point can be used to further determine the X and Y coordinates of the weld start point. Similarly, by determining the third line segment... With the sixth line segment The second approximate intersection point can further determine the X and Y coordinate values of the end point coordinates of the weld.
[0079] Specifically, to determine the first line segment With the fourth line segment Taking the first approximate intersection point as an example, the calculation process is as follows: Let the first line segment be... There exists a certain point The fourth line segment There exists a certain point on ,based on and the first line segment Direction vector and based on and the fourth line segment Direction vector The first line segment can be constructed. Parametric equation of the line and the fourth line segment The parametric equations As shown in equations (1) and (2) respectively:
[0080] (1)
[0081] (2)
[0082] To determine the first line segment With the fourth line segment To find the first approximate intersection point, we need to find the shortest distance between the lines containing the two line segments. This can be done by first determining a vector perpendicular to the lines containing the two line segments (i.e., the normal vectors of the two lines), and then finding the pair of points that minimizes the length of this vector. Specifically, we first construct a connection... and vector Then determine what makes the vector The point where the cross product of the direction vectors of the two lines is 0 is determined by solving equation (3). and ,parameter Corresponding to the first line segment Points on the line, parameters Corresponding to the fourth line segment The points on the line are the points whose coordinates minimize the distance between the two lines, i.e., the first approximate intersection point.
[0083] (3)
[0084] It should be noted that after obtaining the first approximate intersection point, it is necessary to determine whether the first approximate intersection point meets the preset conditions. For example, the first approximate intersection point should be on the first line segment. Or the fourth line segment If the calculated first approximate intersection point does not meet the preset condition, then the preset threshold of the fitting stage needs to be adjusted. The first scan result is then refitted until the first approximate intersection point satisfies the preset condition. Similarly, the third line segment can be determined using the same method described above. and the sixth line segment The second approximate intersection point.
[0085] In this embodiment, through the first line segment With the fourth line segment The first approximate intersection point, and the determination of the third line segment and the sixth line segment The second approximate intersection point can serve as an important reference point for the start of the weld and the end of the weld, thus providing a high-quality data foundation for determining the position of the weld in space and improving the efficiency of weld identification.
[0086] In one embodiment, such as Figure 9 As shown, S300 includes:
[0087] S310, Based on the X and Y coordinate values of the first approximate intersection point, determine the X and Y coordinate values of the starting point of the weld.
[0088] S320, based on the X and Y coordinates of the second approximate intersection point, determine the X and Y coordinates of the end point of the weld.
[0089] S330, based on the coordinate values of the second line segment, the fifth line segment, the first approximate intersection point, and the second approximate intersection point, determine the Z-coordinate value of the starting point of the weld and the Z-coordinate value of the ending point of the weld.
[0090] The first plane is the XY plane, the second plane is the XZ plane, the approximate intersection points include the first approximate intersection point of the first line segment and the fourth line segment, and the second approximate intersection point of the third line segment and the sixth line segment. The starting point coordinates of the weld include the X, Y, and Z coordinate values of the starting point of the weld, and the ending point coordinates of the weld include the X, Y, and Z coordinate values of the ending point of the weld.
[0091] Specifically, assume that the first approximate intersection points are respectively and ,in Located in the first line segment superior, Located in the fourth line segment Above. Similarly, assume the second approximate intersection points are respectively and ,in Located in the third line segment superior, Located in the sixth line segment Above. The X and Y coordinate values of the weld start point can be... , The mean of the X and Y coordinate values, under ideal conditions, is as follows: Figure 8 As shown, , The X-coordinate values are equal. , The Y-coordinate values are also equal, so we can directly... , The X and Y coordinates are used as the X and Y coordinates of the weld start point, respectively. Similarly, the X and Y coordinates of the weld end point can be... , The average of the X and Y coordinate values, under ideal conditions, , The X-coordinate values are equal. , The Y-coordinate values are also equal, so we can directly... , The X and Y coordinate values are used as the X and Y coordinate values of the end point coordinate of the weld, respectively.
[0092] Furthermore, since the collaborative robot's posture may have changed slightly during the first and second scans, and The Z-coordinate values will have slight differences, and similarly... The Z-coordinate values will also vary slightly. This can be considered in conjunction with the angle between the second and fifth line segments, and... , The Z-coordinate values of the weld start point and the Z-coordinate values of the weld end point are calculated by taking the mean or by interpolation.
[0093] In this embodiment, the X and Y coordinates of the start and end points of the weld can be determined by using the coordinates of the first and second approximate intersection points. In addition, this solution also considers that the posture of the collaborative robot may change during the two scanning processes, and therefore considers using interpolation methods to determine the Z coordinates of the start and end points of the weld, thereby improving the weld recognition efficiency and accuracy.
[0094] In one embodiment, such as Figure 10As shown, S330 includes:
[0095] S331, when the second line segment is parallel to the fifth line segment, determine the distance between the second line segment and the fifth line segment, determine the Z coordinate value of the starting point of the weld based on the distance and the Z coordinate value of the first approximate intersection point, and determine the Z coordinate value of the ending point of the weld based on the distance and the Z coordinate value of the second approximate intersection point.
[0096] S332, when the second line segment and the fifth line segment are not parallel, the Z coordinate value of the starting point of the weld and the Z coordinate value of the ending point of the weld are determined by interpolation based on the coordinate values of the first approximate intersection point and the second approximate intersection point.
[0097] Specifically, first determine that the second line segment is And the fifth line segment is Whether they are parallel, for example, to determine if the second line segment is And the fifth line segment is Are the direction vectors proportional? If they are proportional, it means they are parallel. Alternatively, calculate the second line segment as... And the fifth line segment is The angle between included angle It can be based on the second line segment as And the fifth line segment is Calculation of direction vectors, for example The value of is equal to the product of the dot product of the two direction vectors and the magnitude of the direction vector.
[0098] The second line segment is And the fifth line segment is In the case of parallel lines, only the second line segment needs to be calculated. And the fifth line segment is minimum distance between At this point, the start of the weld can be considered to be located in the z-direction. and The minimum distance between the Z coordinate values The second line segment can be And the fifth line segment is Connecting any points on each line segment, the resulting vector is given by the second line segment. And the fifth line segment is The projection onto the normal vector, based on and Z-coordinate and minimum distance This allows us to determine the Z-coordinate value of the weld start point. Similarly, the weld end point is located at [Z-coordinate value] in the z-direction. The middle of the Z coordinate value, based on Z-coordinate and minimum distance This allows us to determine the Z-coordinate value of the end point of the weld.
[0099] The second line segment is And the fifth line segment is In the case of non-parallel welds, interpolation can be used to calculate the Z-coordinates of the start and end points of the weld. Specifically, based on the first approximate intersection point... and Determine the starting point of the weld. The formula for the Z-coordinate value is shown in equation (4):
[0100] (4)
[0101] In equation (4), The X-coordinate value of the weld start point. This is the Z-coordinate value of the weld's starting point. Similarly, the weld's ending point can also be calculated. The Z-coordinate value.
[0102] In this embodiment, the second line segment is And the fifth line segment is In the case of parallel lines, only the minimum distance between the two lines needs to be calculated to quickly determine the starting and ending coordinates of the weld. In the second line segment... And the fifth line segment is Even when the welds are not parallel, the starting and ending coordinates of the weld can be quickly determined by interpolation, which can improve the efficiency of weld identification.
[0103] To provide a clearer explanation of the weld identification method proposed in this application, a specific embodiment is provided below, which includes the following steps:
[0104] The welding workpiece is scanned along the preset first scanning trajectory and the preset second scanning trajectory respectively to obtain the first scanning result and the second scanning result.
[0105] The first scan result is fitted into three line segments to obtain the first scan line, which includes the first line segment, the second line segment, and the third line segment connected in sequence. The second scan result is fitted into three line segments to obtain the second scan line, which includes the fourth line segment, the fifth line segment, and the sixth line segment connected in sequence.
[0106] Determine the first approximate intersection point of the first and fourth line segments, and determine the second approximate intersection point of the third and sixth line segments.
[0107] Based on the X and Y coordinates of the first approximate intersection point, determine the X and Y coordinates of the starting point of the weld. Based on the X and Y coordinates of the second approximate intersection point, determine the X and Y coordinates of the ending point of the weld.
[0108] When the second line segment is parallel to the fifth line segment, determine the distance between the second line segment and the fifth line segment. Based on the distance and the Z-coordinate value of the first approximate intersection point, determine the Z-coordinate value of the start point of the weld. Based on the distance and the Z-coordinate value of the second approximate intersection point, determine the Z-coordinate value of the end point of the weld.
[0109] When the second and fifth line segments are not parallel, the Z-coordinate values of the starting point and the ending point of the weld are determined by interpolation based on the coordinate values of the first and second approximate intersection points.
[0110] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0111] Based on the same inventive concept, this application also provides a weld identification device for implementing the weld identification method described above. The solution provided by this device is similar to the solution described in the above method; therefore, the specific limitations in one or more weld identification device embodiments provided below can be found in the limitations of the weld identification method described above, and will not be repeated here.
[0112] In one embodiment, such as Figure 11 As shown, a weld seam recognition device 500 is provided, including: a scanning module 510, an approximate intersection point determination module 520, and a weld seam recognition module 530, wherein:
[0113] The scanning module 510 is used to scan the welding workpiece along a preset first scanning trajectory and a preset second scanning trajectory, and to determine the first scanning line and the second scanning line. The first scanning trajectory and the second scanning trajectory are respectively located in a first plane and a second plane that are perpendicular to each other. Both the first scanning trajectory and the second scanning trajectory contain the weld seam.
[0114] The approximate intersection point determination module 520 is used to determine the approximate intersection point of the first scan line and the second scan line.
[0115] The weld identification module 530 is used to determine the starting point coordinates and ending point coordinates of the weld based on the first scan line, the second scan line, and the approximate intersection point.
[0116] In one embodiment, the scanning module 510 is used to scan the welding workpiece along a preset first scanning trajectory and a preset second scanning trajectory respectively, to obtain a first scanning result and a second scanning result, and to fit the first scanning result and the second scanning result into a polyline containing a preset number of line segments respectively, to obtain a first scanning line and a second scanning line.
[0117] In one embodiment, the scanning module 510 is used to fit the first scanning result into a first scanning line containing three line segments, the first scanning line including a first line segment, a second line segment and a third line segment connected in sequence, and to fit the second scanning result into a second scanning line containing three line segments, the second scanning line including a fourth line segment, a fifth line segment and a sixth line segment connected in sequence.
[0118] In one embodiment, the approximate intersection point determination module 520 is used to determine a first approximate intersection point between a first line segment and a fourth line segment, and to determine a second approximate intersection point between a third line segment and a sixth line segment. The approximate intersection point includes the first approximate intersection point and the second approximate intersection point.
[0119] In one embodiment, the first plane is the XY plane, the second plane is the XZ plane, and the approximate intersection points include the first approximate intersection point of the first line segment and the fourth line segment, and the second approximate intersection point of the third line segment and the sixth line segment. The weld identification module 530 is used to determine the X and Y coordinate values of the starting point of the weld based on the X and Y coordinate values of the first approximate intersection point, to determine the X and Y coordinate values of the ending point of the weld based on the X and Y coordinate values of the second approximate intersection point, and to determine the Z coordinate values of the starting point and the ending point of the weld based on the coordinate values of the second line segment, the fifth line segment, the first approximate intersection point, and the second approximate intersection point. The coordinates of the starting point of the weld include the X, Y, and Z coordinate values of the starting point of the weld, and the coordinates of the ending point of the weld include the X, Y, and Z coordinate values of the ending point of the weld.
[0120] In one embodiment, the weld identification module 530 is used to determine the distance between the second line segment and the fifth line segment when the second line segment and the fifth line segment are parallel, determine the Z coordinate value of the start point of the weld based on the distance and the Z coordinate value of the first approximate intersection point, and determine the Z coordinate value of the end point of the weld based on the distance and the Z coordinate value of the second approximate intersection point. When the second line segment and the fifth line segment are not parallel, the module uses interpolation to determine the Z coordinate value of the start point of the weld and the Z coordinate value of the end point of the weld based on the coordinate values of the first approximate intersection point and the second approximate intersection point.
[0121] Each module in the aforementioned weld seam identification device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of a computer device in software form, so that the processor can call and execute the corresponding operations of each module.
[0122] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 12 As shown, the computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores data such as preset first scan trajectories and preset second scan trajectories. The I / O interfaces are used for information exchange between the processor and external devices. The communication interface is used for communication with external terminals via a network connection. When executed by the processor, the computer program implements a weld seam identification method.
[0123] Those skilled in the art will understand that Figure 12 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0124] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described weld seam identification method embodiment.
[0125] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in the above-described weld seam identification method embodiment.
[0126] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above-described weld seam identification method embodiment.
[0127] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0128] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0129] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0130] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for weld identification, characterized in that, The method includes: The welding workpiece is scanned along a preset first scanning trajectory and a preset second scanning trajectory to obtain a first scanning result and a second scanning result. The first scanning result and the second scanning result are respectively fitted into a polyline containing a preset number of line segments to obtain a first scanning line and a second scanning line. The first scanning trajectory and the second scanning trajectory are respectively located in the XY plane and the XZ plane, which are perpendicular to each other. Both the first scanning trajectory and the second scanning trajectory contain the weld. Determine the approximate intersection point of the first scan line and the second scan line, wherein the approximate intersection point is the point pair of the first scan line and the second scan line that are closest to each other in three-dimensional space; The starting point coordinates and ending point coordinates of the weld are determined based on the first scan line, the second scan line, and the approximate intersection point.
2. The method according to claim 1, characterized in that, The step of fitting the first scan result and the second scan result into a polyline containing a preset number of line segments to obtain the first scan line and the second scan line includes: The first scan result is fitted into a first scan line containing three line segments, the first scan line including a first line segment, a second line segment and a third line segment connected in sequence; The second scan result is fitted into a second scan line containing three line segments, the second scan line including a fourth line segment, a fifth line segment and a sixth line segment connected in sequence.
3. The method according to claim 2, characterized in that, Determining the approximate intersection point of the first scan line and the second scan line includes: Determine the first approximate intersection point of the first line segment and the fourth line segment, and determine the second approximate intersection point of the third line segment and the sixth line segment; The approximate intersection point includes the first approximate intersection point and the second approximate intersection point.
4. The method according to claim 2, characterized in that, The first plane is the XY plane, the second plane is the XZ plane, and the approximate intersection points include the first approximate intersection point of the first line segment and the fourth line segment, and the second approximate intersection point of the third line segment and the sixth line segment; determining the start-point and end-point coordinates of the weld seam based on the first scan line, the second scan line, and the approximate intersection points includes: Based on the X and Y coordinates of the first approximate intersection point, determine the X and Y coordinates of the starting point of the weld. Based on the X and Y coordinate values of the second approximate intersection point, determine the X and Y coordinate values of the end point of the weld. Based on the coordinates of the second line segment, the fifth line segment, the first approximate intersection point, and the second approximate intersection point, determine the Z-coordinate value of the starting point of the weld and the Z-coordinate value of the ending point of the weld; The starting coordinates of the weld include the X, Y, and Z coordinates of the starting point of the weld, and the ending coordinates of the weld include the X, Y, and Z coordinates of the ending point of the weld.
5. The method according to claim 4, characterized in that, Based on the coordinates of the second line segment, the fifth line segment, the first approximate intersection point, and the second approximate intersection point, the Z-coordinate value of the start point of the weld and the Z-coordinate value of the end point of the weld are determined, including: When the second line segment is parallel to the fifth line segment, the distance between the second line segment and the fifth line segment is determined. Based on the distance and the Z coordinate value of the first approximate intersection point, the Z coordinate value of the starting point of the weld is determined. Based on the distance and the Z coordinate value of the second approximate intersection point, the Z coordinate value of the ending point of the weld is determined. When the second line segment is not parallel to the fifth line segment, the Z coordinate value of the starting point of the weld and the Z coordinate value of the ending point of the weld are determined by interpolation based on the coordinate values of the first approximate intersection point and the second approximate intersection point.
6. A weld seam identification device, characterized in that, The device includes: The scanning module is used to scan the welding workpiece along a preset first scanning trajectory and a preset second scanning trajectory to obtain a first scanning result and a second scanning result. The first scanning result and the second scanning result are respectively fitted into a polyline containing a preset number of line segments to obtain a first scanning line and a second scanning line. The first scanning trajectory and the second scanning trajectory are respectively located in the mutually perpendicular XY plane and XZ plane. Both the first scanning trajectory and the second scanning trajectory contain the weld. An approximate intersection point determination module is used to determine the approximate intersection point of the first scan line and the second scan line, wherein the approximate intersection point is the point pair that is closest to the first scan line and the second scan line in three-dimensional space; The weld seam identification module is used to determine the start-point and end-point coordinates of the weld seam based on the first scan line, the second scan line, and the approximate intersection point.
7. The apparatus according to claim 6, characterized in that, The scanning module is further configured to fit the first scanning result into a first scanning line containing three line segments, the first scanning line including a first line segment, a second line segment and a third line segment connected in sequence, and to fit the second scanning result into a second scanning line containing three line segments, the second scanning line including a fourth line segment, a fifth line segment and a sixth line segment connected in sequence.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 5.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.