Weld break point marking method and device, electronic equipment and readable storage medium

CN119150195BActive Publication Date: 2026-09-22HUAGONG TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411313886.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-20
Publication Date
2026-09-22
Estimated Expiration
2044-09-20

AI Technical Summary

Benefits of technology

[0045]本发明实施例提供的焊缝断点标注方法、装置、电子设备及可读存储介质,首先采用粗定位的方式确定焊缝断点,针对每行激光线扫点,剔除超过预设深度阈值范围的激光线扫点,并将剩余的激光线扫点划分为若干段;基于激光线扫点的深度信息分别计算每段的平均深度值,沿激光线扫点的第一排列方向,依次判断当前段的平均深度值与上一段的平均深度值的变化幅度是否超过预设变化幅度,若超过,则将当前段的起始点确定第一焊缝断点;沿第二排列方向,按照同样的方法得到第二焊缝断点;然后采用精定位的方式通过迭代优化算法对第一焊缝断点和第二焊缝断点的位置进行修正,并以修正的最优的焊缝断点的位置信息进行标注。本发明通过粗定位和精定位结合的方式,通过即提高了焊缝断点标注的效率,又保证焊缝断点标注的精度。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119150195B_ABST
    Figure CN119150195B_ABST
Patent Text Reader

Abstract

The application provides a weld breakpoint labeling method and device, electronic equipment and readable storage medium. The method comprises the following steps: obtaining a weld dataset sample to be labeled; the weld dataset sample to be labeled is composed of a plurality of rows of laser line scanning point data; for each row of laser line scanning point, the laser line scanning point exceeding a preset depth threshold range is removed, and the remaining laser line scanning point is divided into a plurality of segments; the average depth value of each segment is calculated; along a first arrangement direction of the laser line scanning point, whether the change amplitude of the average depth value of the current segment and the average depth value of the last segment exceeds a preset change amplitude is judged in sequence, if yes, the starting point of the current segment is preliminarily determined as a first weld breakpoint; the preliminary position of a second weld breakpoint is obtained by the same method; and the positions of the first weld breakpoint and the second weld breakpoint are corrected. The application improves the efficiency of weld breakpoint labeling and ensures the accuracy of weld breakpoint labeling.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of welding technology, and more specifically, to a method, apparatus, electronic device, and readable storage medium for marking weld break points. Background Technology

[0002] In the field of weld seam tracking technology, the training accuracy of the weld seam recognition model directly affects the accuracy of weld seam recognition and the stability of tracking. Currently, one of the keys to improving the training accuracy of weld seam recognition models lies in improving the annotation accuracy of weld seam breakpoints in the weld seam dataset.

[0003] Traditional weld seam dataset annotation often relies on manual methods, which are not only inaccurate but also inefficient. Summary of the Invention

[0004] In view of this, the purpose of the present invention is to provide a method, apparatus, electronic device and readable storage medium for marking weld break points, so as to improve marking accuracy and marking efficiency.

[0005] Firstly, a method for marking weld breakpoints is provided, the method comprising:

[0006] Obtain a sample dataset of weld seams to be labeled; the sample dataset of weld seams to be labeled consists of several rows of laser line scan data, and the laser line scan data includes at least the depth information and position information of the laser line scan points;

[0007] For each row of laser line scan points, laser line scan points exceeding the preset depth threshold range are removed, and the remaining laser line scan points are divided into several segments;

[0008] Based on the depth information of the laser line scan points, the average depth value of each segment is calculated. Along the first arrangement direction of the laser line scan points, the first weld break point is determined using a coarse positioning method. The coarse positioning method is as follows: it is determined whether the change range between the average depth value of the current segment and the average depth value of the previous segment exceeds a preset change range. If it does, the starting point of the current segment is determined as the first weld break point. The current segment is each segment after the first segment. Along the second arrangement direction, the second weld break point is obtained using the same coarse positioning method. The second arrangement direction is the opposite direction to the first arrangement direction. The first arrangement direction is the scanning direction of the laser line scan points.

[0009] The positions of the first weld breakpoint and the second weld breakpoint are corrected by an iterative optimization algorithm to obtain the optimal weld breakpoint position, and the optimal weld breakpoint position information is used for labeling.

[0010] Optionally, calculating the average depth value for each segment based on the depth information of the laser line scan points includes:

[0011] The number of laser line scan points in each segment and the depth information of each laser line scan point are determined based on the number of segments.

[0012] The total depth information of a segment is calculated based on the depth information of each laser line scan point in that segment.

[0013] The average depth information is calculated based on the total depth information of each segment and the number of corresponding laser line scan points.

[0014] Optionally, the method for determining the preset variation range includes:

[0015] After calculating the average depth value for each segment, determine the maximum and minimum average depth values;

[0016] The maximum range of variation is determined based on the maximum and minimum average depth values.

[0017] The preset change range is determined based on the maximum change range and the number of segments.

[0018] Optionally, the step of correcting the positions of the first weld breakpoint and the second weld breakpoint using an iterative optimization algorithm to obtain the optimal weld breakpoint position includes:

[0019] Based on the current position information of the first weld breakpoint and the second weld breakpoint, piecewise linear fitting is performed to obtain the fitting depth value of each laser line scan point;

[0020] Calculate the residual sum of squares based on the fitted depth value and the true depth value;

[0021] Determine whether the sum of squared residuals has reached a local minimum;

[0022] If this is achieved, the positions of the first and second weld break points corresponding to the local minimum residual square sum are determined as the optimal weld break point positions.

[0023] If not reached, the gradient values ​​of the residual sum of squares at the current first weld breakpoint and second weld breakpoint are calculated respectively.

[0024] Based on the gradient values ​​of the residual sum of squares at the current first weld breakpoint and second weld breakpoint, and the position information of the first weld breakpoint and second weld breakpoint, the position information of the first weld breakpoint and second weld breakpoint is corrected.

[0025] Based on the corrected location information of the first and second weld seam breaks, piecewise linear fitting is continued, and the residual sum of squares is recalculated until the residual sum of squares reaches a local minimum.

[0026] Optionally, the step of correcting the position information of the first weld breakpoint and the second weld breakpoint based on the gradient values ​​of the residual sum of squares at the current first weld breakpoint and second weld breakpoint, respectively, and the position information of the first weld breakpoint and the second weld breakpoint includes:

[0027] Based on the gradient values ​​and position information of the residual sum of squares at the current first weld breakpoint and second weld breakpoint, respectively, the corrected position information of the weld breakpoint is calculated using the position correction formula, which is:

[0028]

[0029] in, This indicates the location information of weld break point j in the (k+1)th iteration correction; This indicates the location information of weld break point j in the k-th iteration correction;

[0030] j = 1 or 2, which is the breakpoint number; k represents the number of iterations; α is the search step size, with an initial value of 1; Let J be the gradient at weld breakpoint j after the k-th iteration correction; H is the Hessian matrix, which is a matrix composed of the second-order partial derivatives of the depth information of each laser line scan point. The initial Hessian matrix is ​​the identity matrix, and the Hessian matrix is ​​updated with each iteration correction.

[0031] Optionally, the update process of the Hessian matrix includes:

[0032] The update is based on the previously corrected Hessian matrix, and the weld breakpoint location and depth information before and after the correction. The update calculation formula is as follows:

[0033]

[0034] in, This indicates the positional deviation at weld break point j before and after correction; This represents the gradient change at weld break point j before and after the correction.

[0035] Optionally, the search step size is dynamically adjusted based on historical gradient information and the current gradient during each iteration.

[0036] Secondly, a weld breakpoint marking device is provided, the device comprising:

[0037] The acquisition unit is used to acquire a sample of the weld dataset to be labeled. The sample of the weld dataset to be labeled consists of several rows of laser line scan data. The laser line scan data includes at least the depth information and position information of the laser line scan points.

[0038] The rejection unit is used to reject laser line scan points that exceed a preset depth threshold range for each row of laser line scan points, and divide the remaining laser line scan points into several segments.

[0039] The determining unit is used to calculate the average depth value of each segment based on the depth information of the laser line scan points. Along the first arrangement direction of the laser line scan points, a coarse positioning method is used to determine the first weld breakpoint. The coarse positioning method is as follows: It is sequentially determined whether the change range between the average depth value of the current segment and the average depth value of the previous segment exceeds a preset change range. If it does, the starting point of the current segment is determined as the first weld breakpoint; the current segment refers to each segment after the first segment. Along the second arrangement direction, the second weld breakpoint is obtained using the same coarse positioning method. The second arrangement direction is opposite to the first arrangement direction; the first arrangement direction is the scanning direction of the laser line scan points.

[0040] The correction unit is used to correct the positions of the first weld breakpoint and the second weld breakpoint using an iterative optimization algorithm to obtain the optimal weld breakpoint position, and to mark the optimal weld breakpoint position information.

[0041] Thirdly, an electronic device is provided, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;

[0042] Memory, used to store computer programs;

[0043] When a processor executes a program stored in memory, it implements any of the steps described in the first aspect.

[0044] Fourthly, a computer-readable storage medium is provided, wherein a computer program is stored therein, and when executed by a processor, the computer program implements the steps of any of the methods described in the first aspect.

[0045] The weld breakpoint marking method, apparatus, electronic device, and readable storage medium provided in this invention first determine weld breakpoints using a coarse positioning method. For each row of laser scan points, laser scan points exceeding a preset depth threshold are removed, and the remaining laser scan points are divided into several segments. Based on the depth information of the laser scan points, the average depth value of each segment is calculated. Along the first arrangement direction of the laser scan points, it is sequentially determined whether the change range between the average depth value of the current segment and the average depth value of the previous segment exceeds a preset change range. If it does, the starting point of the current segment is determined as the first weld breakpoint. The second weld breakpoint is obtained along the second arrangement direction using the same method. Then, a fine positioning method is used to correct the positions of the first and second weld breakpoints through an iterative optimization algorithm, and the corrected optimal weld breakpoint position information is used for marking. This invention improves the efficiency of weld breakpoint marking while ensuring the accuracy of weld breakpoint marking by combining coarse and fine positioning.

[0046] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0047] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0048] Figure 1 A flowchart of the weld breakpoint marking method provided in an embodiment of the present invention is shown;

[0049] Figure 2 This diagram illustrates a sample of a weld dataset to be labeled, provided in an embodiment of the present invention.

[0050] Figure 3 This diagram illustrates the structure of a weld breakpoint marking device provided in an embodiment of the present invention.

[0051] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present invention is shown. Detailed Implementation

[0052] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.

[0053] Considering that traditional weld seam dataset annotation often relies on manual methods, which are not only inaccurate but also inefficient, this invention provides a weld seam breakpoint annotation method and apparatus, which will be described below through embodiments.

[0054] This invention provides a method for marking weld breakpoints, such as... Figure 1 As shown, the method includes the following steps:

[0055] Step S101: Obtain a sample of the weld dataset to be labeled; the sample of the weld dataset to be labeled consists of several rows of laser line scan data, and the laser line scan data includes at least the depth information and position information of the laser line scan points.

[0056] In this step, the weld area can be scanned using a laser line scanning camera. For example, if two steel plates are being welded, the scan is performed along the weld direction. The scanning is based on the resolution of the laser line scanning camera, for example, if the resolution is 1000*3200, then each scan will acquire 1000 rows of laser line scanning points, with 3200 laser line scanning points in each row. These 3200 points include weld breakpoints and line scanning points of the steel plates. The weld breakpoints need to be identified from these laser line scanning points.

[0057] For example, the sample of the weld dataset to be labeled can be represented by L:{(x i r i |1≤i≤N,x i ∈FOV} represents, where N is the number of data points in a weld data sample, x i The position of the laser line scan point in each row; r i x represents the depth value of the laser line scan point, and FOV represents the field of view of the laser line scan camera. For example, when the camera's field of view is 16cm, x i It increases uniformly from -8 to 8.

[0058] Step S102: For each row of laser line scan points, remove laser line scan points that exceed the preset depth threshold range, and divide the remaining laser line scan points into several segments.

[0059] For example, a preset depth threshold within a reasonable range can be set. The depth value of each laser scan point in each row can be compared with this preset depth threshold. If it exceeds the preset depth threshold, it can be identified as an abnormal point and removed. Figure 2 As shown, the three points between the two lines are the outliers to be removed.

[0060] In one example, each row of laser scan points can be divided into several segments as evenly as possible. The specific number of segments can be determined based on the number of laser scan points in each row. For example, 3200 laser scan points can be divided into 32 segments, with 100 laser scan points in each segment.

[0061] Step S103: Calculate the average depth value of each segment based on the depth information of the laser line scan points. Determine the first weld break point using a coarse positioning method along the first arrangement direction of the laser line scan points. The coarse positioning method is as follows: sequentially determine whether the change range between the average depth value of the current segment and the average depth value of the previous segment exceeds a preset change range. If it does, determine the starting point of the current segment as the first weld break point. The current segment is each segment after the first segment. Obtain the second weld break point along the second arrangement direction using the same coarse positioning method. The second arrangement direction is opposite to the first arrangement direction. The first arrangement direction is the scanning direction of the laser line scan points.

[0062] In one example, if a row of laser line scans is divided into 30 segments, the average depth value of each segment is compared with the previous segment sequentially from left to right. When the change in the average depth value exceeds a preset change range, the starting point of the current segment is taken as the position x of the first weld break. b1 That is, the break point of the first weld is P1:(x b1 y b1 ), and stop comparing; repeat the comparison from right to left in the same way until the location x of the second weld break point is determined. b2 That is, the break point of the second weld is P2:(x b2 y b2 ).

[0063] This step is a coarse positioning process. By comparing the average depth values, the approximate location of the weld break can be quickly determined, which can improve the efficiency of weld break marking.

[0064] Step S104: The positions of the first weld breakpoint and the second weld breakpoint are corrected by an iterative optimization algorithm to obtain the optimal weld breakpoint position, and the optimal weld breakpoint position information is marked.

[0065] This step is a fine-positioning step, which improves the accuracy of weld breakpoint marking by precisely correcting the position of the weld breakpoint. Common correction methods include, but are not limited to, statistical methods such as iterative optimization.

[0066] The embodiments of the present invention have been experimentally verified. Taking a laser line scan of a sample data length of 4400 points as an example, the average time for the traditional algorithm to annotate the weld data sample is about 0.267 seconds, while the average time for the method to annotate is about 0.036 seconds, which improves the annotation efficiency by about 7.4 times.

[0067] As can be seen from the above embodiments, the embodiments of the present invention improve the efficiency of weld marking and ensure the accuracy of weld breakpoint marking by combining coarse positioning and fine positioning.

[0068] Based on the above embodiments, calculating the average depth value of each segment based on the depth information of the laser line scan points specifically includes the following steps:

[0069] Step S103A: Determine the number of laser line scan points in each segment and the depth information of each laser line scan point based on the number of segments.

[0070] Step S103B: Calculate the total depth information of the segment based on the depth information of each laser line scan point in each segment.

[0071] The total depth of a segment can be obtained by summing the depth information of each laser line scan point. It should be noted that if adjacent segments share a common laser line scan point at their ends, this common laser line scan point can be included in the calculation of the next segment to avoid double counting.

[0072] Step S103C: Calculate the average depth information based on the total depth information of each segment and the number of corresponding laser line scan points.

[0073] In one example, the average depth value can be calculated using the following formula:

[0074]

[0075] Where S is the number of laser line scan points in each segment, and y i This represents the depth value of the i-th laser line scan point within this segment.

[0076] This invention divides the laser line scan points of each row into several segments through coarse positioning. By comparing the average depth values ​​between segments, on the one hand, the first weld breakpoint and the second weld breakpoint can be determined quickly and initially; on the other hand, the number of iterations for subsequent fine positioning can be greatly reduced, shortening the iteration time and thus improving the annotation efficiency of the dataset.

[0077] It improves the efficiency of weld breakpoint marking.

[0078] Based on the above embodiments, the method for determining the preset change range includes:

[0079] After calculating the average depth value for each segment, the maximum and minimum average depth values ​​are determined.

[0080] For example, for a weld divided into n segments, we have D1, D2...Dn representing the average depth of each segment.

[0081] The maximum range of variation is determined based on the maximum and minimum average depth values.

[0082] Find the maximum and minimum average depth values ​​among all segments. Let the maximum average depth be Dmax and the minimum average depth be Dmin.

[0083] The maximum variation can be defined as the difference between the maximum and minimum average depth values. That is: D m =Dmax-Dmin(2).

[0084] The preset change range is determined based on the maximum change range and the number of segments.

[0085] In one example, the preset change range can be expressed by the formula Perform the calculation.

[0086] Among them, D m The maximum range of change is represented by n, which is the number of segments.

[0087] In this embodiment, based on the number of segments and the maximum range of change, the maximum range of change is evenly distributed to each segment, thereby obtaining a reasonable range of change threshold. Once the range of change threshold is exceeded, the location of the breakpoint can be determined.

[0088] Based on the above embodiments, the positions of the first weld breakpoint and the second weld breakpoint are corrected using an iterative optimization algorithm to obtain the optimal weld breakpoint position, including the following steps:

[0089] Step S104A: Based on the current position information of the first weld breakpoint and the second weld breakpoint, perform piecewise linear fitting to obtain the fitting depth value of each laser line scan point.

[0090] In one example, P1 and P2 serve as the first and second weld breakpoints, dividing each row of laser line scans into three segments. The middle segment typically represents the weld area, while the two sides represent the steel plate areas. Specifically, this can be based on the first weld breakpoint P1:(x b1 y b1) and the second weld break point P2:(x b2 y b2 A piecewise linear function is constructed using the coordinates of the laser line scan points. This piecewise linear function can be used to obtain the fitted depth value for each laser line scan point. The piecewise linear function can be expressed as:

[0091]

[0092] in, This represents the fitted depth value of the i-th laser line scan point when the weld breakpoints are P1 and P2.

[0093] Step S104B: Calculate the residual sum of squares based on the fitted depth value and the true depth value.

[0094] In this step, the formula for calculating the sum of squared residuals is as follows:

[0095]

[0096] Among them, y i This represents the actual depth value of the laser line scan point. This is the fitted depth value.

[0097] Step S104C: Determine whether the sum of squared residuals has reached a local minimum.

[0098] In this step, it can be determined whether a local minimum has been reached by judging the change of the sum of squared residuals for a preset number of consecutive times. For example, if the sum of squared residuals does not continue to decrease after three consecutive times, it means that a local minimum has been reached.

[0099] Step S104D: If the condition is met, the positions of the first and second weld breakpoints corresponding to the local minimum residual square sum are determined as the optimal weld breakpoint positions.

[0100] Step S104E: If not reached, calculate the gradient values ​​of the residual sum of squares at the current first weld breakpoint and second weld breakpoint, respectively.

[0101] In this step, by differentiating the sum of squared residuals, the gradient values ​​of the sum of squared residuals at the current first weld breakpoint and the second weld breakpoint can be obtained.

[0102] In this step, the gradient calculation formula is as follows:

[0103]

[0104] Where j = 1 or 2, is the breakpoint number.

[0105] Step S104F: Based on the gradient values ​​of the residual sum of squares at the current first weld breakpoint and second weld breakpoint, and the position information of the first weld breakpoint and second weld breakpoint, correct the position information of the first weld breakpoint and the second weld breakpoint.

[0106] Step S104G: Based on the corrected position information of the first weld breakpoint and the second weld breakpoint, continue to perform piecewise linear fitting and recalculate the residual sum of squares until the residual sum of squares reaches a local minimum.

[0107] Based on the above embodiments, the correction of the position information of the first weld breakpoint and the second weld breakpoint based on the gradient values ​​of the residual sum of squares at the current first weld breakpoint and second weld breakpoint, respectively, and the position information of the first weld breakpoint and the second weld breakpoint includes:

[0108] Based on the gradient values ​​of the residual sum of squares at the current first weld breakpoint and second weld breakpoint, and the position information of the first and second weld breakpoints, the corrected position information of the weld breakpoint is calculated using the position correction formula:

[0109]

[0110] in, This indicates the location information of weld break point j in the (k+1)th iteration correction; This indicates the location information of weld break point j in the k-th iteration correction;

[0111] j = 1 or 2, which is the breakpoint number; k represents the number of iterations; α is the search step size, with an initial value of 1; Let J be the gradient at weld breakpoint j after the k-th iteration correction; H is the Hessian matrix, which is a matrix composed of the second-order partial derivatives of the depth information of each laser line scan point. The initial Hessian matrix is ​​the identity matrix, and the Hessian matrix is ​​updated with each iteration correction.

[0112] Based on the above embodiments, the Hessian matrix update process includes:

[0113] The update is based on the previously corrected Hessian matrix, and the weld breakpoint location and depth information before and after the correction. The update calculation formula is as follows:

[0114]

[0115] in, This indicates the positional deviation at weld break point j before and after correction; This represents the gradient change at weld break point j before and after the correction.

[0116] Based on the above embodiments, the search step size is dynamically adjusted according to historical gradient information and the current gradient during each iteration correction.

[0117] In this embodiment of the invention, the search step size is an important concept in optimization algorithms. The search step size usually refers to the magnitude of parameter updates in each iteration during the optimization process.

[0118] In one example, the search step size can be adjusted using the following formula:

[0119]

[0120] in, It is the sum of squares of all historical gradients at weld break point j. This represents the current gradient, where ∈ is a small positive number used to avoid the case where the denominator is zero.

[0121] In the above formula, the larger the historical gradient at the weld break point, the smaller the search step size; the smaller the historical gradient, the larger the search step size.

[0122] In this embodiment of the invention, the search step size determines the distance moved towards the gradient. A step size that is too large may cause the algorithm to oscillate around the optimal solution and fail to converge, while a step size that is too small will result in slow convergence. Therefore, this embodiment of the invention dynamically adjusts the search step size based on historical gradient information and current gradient information, which can ensure both speed and stability when correcting the weld breakpoint location.

[0123] Based on the same inventive concept, a weld break point marking device is provided, such as... Figure 3 As shown, the device includes:

[0124] The acquisition unit 301 is used to acquire a sample of the weld dataset to be labeled. The sample of the weld dataset to be labeled consists of several rows of laser line scan data, and the laser line scan data includes at least the depth information and position information of the laser line scan points.

[0125] The rejection unit 302 is used to reject laser line scan points that exceed a preset depth threshold range for each row of laser line scan points, and divide the remaining laser line scan points into several segments.

[0126] The determining unit 303 is used to calculate the average depth value of each segment based on the depth information of the laser line scan points, and to determine the first weld break point using a coarse positioning method along the first arrangement direction of the laser line scan points. The coarse positioning method is as follows: it is determined whether the change range between the average depth value of the current segment and the average depth value of the previous segment exceeds a preset change range. If it does, the starting point of the current segment is determined as the first weld break point; the current segment is each segment after the first segment; the second weld break point is obtained along the second arrangement direction using the same coarse positioning method. The second arrangement direction is the opposite direction to the first arrangement direction; the first arrangement direction is the scanning direction of the laser line scan points.

[0127] The method for determining the preset variation range includes: after calculating the average depth value of each segment, determining the maximum average depth value and the minimum average depth value; determining the maximum variation range based on the maximum average depth value and the minimum average depth value; and determining the preset variation range based on the maximum variation range and the number of segments.

[0128] The correction unit 304 is used to correct the positions of the first weld breakpoint and the second weld breakpoint using an iterative optimization algorithm to obtain the optimal weld breakpoint position, and to mark the optimal weld breakpoint position information.

[0129] Specifically, the determining unit is used for:

[0130] The number of laser line scan points in each segment and the depth information of each laser line scan point are determined based on the number of segments.

[0131] The total depth information of a segment is calculated based on the depth information of each laser line scan point in that segment.

[0132] The average depth information is calculated based on the total depth information of each segment and the number of corresponding laser line scan points.

[0133] Optionally, the correction unit is specifically used for:

[0134] Based on the current location information of the first and second weld seam breakpoints, piecewise linear fitting is performed to obtain the fitting depth value of each laser line scan point.

[0135] The sum of squared residuals is calculated based on the fitted depth value and the true depth value.

[0136] Determine whether the sum of squared residuals has reached a local minimum.

[0137] If this is achieved, the positions of the first and second weld breakpoints corresponding to the local minimum residual square sum are determined as the optimal weld breakpoint positions.

[0138] If not reached, calculate the gradient values ​​of the residual sum of squares at the current first weld breakpoint and second weld breakpoint, respectively.

[0139] The position information of the first weld breakpoint and the second weld breakpoint is corrected based on the gradient values ​​of the residual sum of squares at the current first weld breakpoint and second weld breakpoint, respectively, and the position information of the first weld breakpoint and the second weld breakpoint.

[0140] Based on the gradient values ​​of the residual sum of squares at the current first weld breakpoint and second weld breakpoint, and the position information of the first and second weld breakpoints, the corrected position information of the weld breakpoint is calculated using the position correction formula:

[0141]

[0142] in, This indicates the location information of weld break point j in the (k+1)th iteration correction; This indicates the location information of weld break point j in the k-th iteration correction;

[0143] j = 1 or 2, which is the breakpoint number; k represents the iteration number; α is the search step size, which is initially 1; the search step size is dynamically adjusted based on historical gradient information and the current gradient during each iteration correction; Let J be the gradient at weld breakpoint j after the k-th iteration correction; H is the Hessian matrix, which is a matrix composed of the second-order partial derivatives of the depth information of each laser line scan point. The initial Hessian matrix is ​​the identity matrix, and the Hessian matrix is ​​updated with each iteration correction.

[0144] The update process of the Hessian matrix includes:

[0145] The update is based on the previously corrected Hessian matrix, and the weld breakpoint location and depth information before and after the correction. The update calculation formula is as follows:

[0146]

[0147] in, This indicates the positional deviation at weld break point j before and after correction; This represents the gradient change at weld break point j before and after the correction.

[0148] Based on the corrected location information of the first and second weld seam breaks, piecewise linear fitting is continued, and the residual sum of squares is recalculated until the residual sum of squares reaches a local minimum.

[0149] Based on the same technical concept, embodiments of the present invention also provide an electronic device, such as... Figure 4As shown, it includes a processor 401, a communication interface 402, a memory 403, and a communication bus 404, wherein the processor 401, the communication interface 402, and the memory 403 communicate with each other through the communication bus 404.

[0150] Memory 403 is used to store computer programs;

[0151] The processor 401 is used to execute the program stored in the memory 403 to implement the steps of the weld breakpoint marking method.

[0152] The communication bus mentioned in the above electronic devices can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.

[0153] The communication interface is used for communication between the aforementioned electronic devices and other devices.

[0154] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.

[0155] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0156] The computer program product for marking weld break points provided in this embodiment of the invention includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods described in the preceding method embodiments. For specific implementation details, please refer to the method embodiments, which will not be repeated here.

[0157] The weld breakpoint marking device provided in this embodiment of the invention can be specific hardware on the device or software or firmware installed on the device. The implementation principle and technical effects of the device provided in this embodiment of the invention are the same as those in the foregoing method embodiments. For the sake of brevity, any parts not mentioned in the device embodiments can be referred to the corresponding content in the foregoing method embodiments. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can all be referred to the corresponding processes in the above method embodiments, and will not be repeated here.

[0158] In the embodiments provided by this invention, it should be understood that the disclosed apparatus and method can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the displayed or discussed mutual couplings, direct couplings, or communication connections may be through some communication interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.

[0159] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0160] In addition, the functional units in the embodiments provided by the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0161] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0162] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In addition, the terms "first", "second", "third", etc. are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0163] Finally, it should be noted that the above-described embodiments are merely specific implementations of the present invention, used to illustrate the technical solutions of the present invention, and not to limit it. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments within the technical scope disclosed in the present invention, or make equivalent substitutions for some of the technical features; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention. All should be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A method for marking weld breakpoints, characterized in that, The method includes: Obtain a sample dataset of weld seams to be labeled; the sample dataset of weld seams to be labeled consists of several rows of laser line scan data, and the laser line scan data includes at least the depth information and position information of the laser line scan points; For each row of laser line scan points, laser line scan points exceeding the preset depth threshold range are removed, and the remaining laser line scan points are divided into several segments; Based on the depth information of the laser line scan points, the average depth value of each segment is calculated. Along the first arrangement direction of the laser line scan points, a coarse positioning method is used to determine the first weld breakpoint. This coarse positioning method involves sequentially determining whether the change in the average depth value of the current segment compared to the average depth value of the previous segment exceeds a preset change range. If it does, the starting point of the current segment is determined as the first weld breakpoint. The current segment refers to each segment after the first segment. Along the second arrangement direction, the second weld breakpoint is obtained using the same coarse positioning method. The second arrangement direction is opposite to the first arrangement direction. The first arrangement direction is the scanning direction of the laser line scan points. Based on the current position information of the first weld breakpoint and the second weld breakpoint, piecewise linear fitting is performed to obtain the fitting depth value of each laser line scan point; Calculate the residual sum of squares based on the fitted depth value and the true depth value; Determine whether the sum of squared residuals has reached a local minimum; If this is achieved, the positions of the first and second weld break points corresponding to the local minimum residual square sum are determined as the optimal weld break point positions. If not reached, the gradient values ​​of the residual sum of squares at the current first weld breakpoint and second weld breakpoint are calculated respectively. Based on the gradient values ​​of the residual sum of squares at the current first weld breakpoint and second weld breakpoint, and the position information of the first weld breakpoint and second weld breakpoint, the position information of the first weld breakpoint and second weld breakpoint is corrected by a preset position correction formula. Based on the corrected location information of the first and second weld breakpoints, piecewise linear fitting is continued, and the sum of squared residuals is recalculated until the sum of squared residuals reaches a local minimum, thus obtaining the optimal weld breakpoint location, which is then labeled with the optimal weld breakpoint location information.

2. The method according to claim 1, characterized in that, The calculation of the average depth value for each segment based on the depth information from the laser line scan points includes: The number of laser line scan points in each segment and the depth information of each laser line scan point are determined based on the number of segments. The total depth information of a segment is calculated based on the depth information of each laser line scan point in that segment. The average depth information is calculated based on the total depth information of each segment and the number of corresponding laser line scan points.

3. The method according to claim 1, characterized in that, The methods for determining the preset variation range include: After calculating the average depth value for each segment, determine the maximum and minimum average depth values; The maximum variation range is determined based on the maximum and minimum average depth values. The preset change range is determined based on the maximum change range and the number of segments.

4. The method according to claim 1, characterized in that, The position correction calculation formula is: in, Indicates the first The weld break point was corrected in the next iteration. Location information; Indicates the first The weld break point was corrected in the next iteration. Location information; , where is the breakpoint number; Indicates the number of iterations; This is the search step size, initially set to 1. For the first The weld breakpoint after the second iteration The gradient at the point; H is the Hessian matrix, which is a matrix composed of the second-order partial derivatives of the depth information of each laser line scan point. The initial Hessian matrix is ​​the identity matrix, and the Hessian matrix is ​​updated with each iteration.

5. The method according to claim 4, characterized in that, The update process of the Hessian matrix includes: The update is based on the previously corrected Hessian matrix, and the weld breakpoint location and depth information before and after the correction. The update calculation formula is as follows: in, , indicating the weld break point before and after correction Positional deviation at the location; This indicates the weld break point before and after the correction. The gradient change at that point.

6. The method according to claim 4, characterized in that, The search step size is dynamically adjusted based on historical gradient information and the current gradient during each iteration.

7. A weld breakpoint marking device, characterized in that, The device includes: The acquisition unit is used to acquire a sample of the weld dataset to be labeled; the sample of the weld dataset to be labeled consists of several rows of laser line scan data, and the laser line scan data includes at least the depth information and position information of the laser line scan points; The rejection unit is used to reject laser line scan points that exceed a preset depth threshold range for each row of laser line scan points, and divide the remaining laser line scan points into several segments. The determining unit is used to calculate the average depth value of each segment based on the depth information of the laser line scan points, and to determine the first weld break point using a coarse positioning method along the first arrangement direction of the laser line scan points. The coarse positioning method is as follows: it is determined whether the change range between the average depth value of the current segment and the average depth value of the previous segment exceeds a preset change range. If it does, the starting point of the current segment is determined as the first weld break point; the current segment is each segment after the first segment. The second weld break point is obtained along the second arrangement direction using the same coarse positioning method. The second arrangement direction is the opposite direction to the first arrangement direction; the first arrangement direction is the scanning direction of the laser line scan points. The correction unit is used to perform piecewise linear fitting based on the current position information of the first weld breakpoint and the second weld breakpoint to obtain the fitting depth value of each laser line scan point. Calculate the residual sum of squares based on the fitted depth value and the true depth value; Determine whether the sum of squared residuals has reached a local minimum; If this is achieved, the positions of the first and second weld break points corresponding to the local minimum residual square sum are determined as the optimal weld break point positions. If not reached, the gradient values ​​of the residual sum of squares at the current first weld breakpoint and second weld breakpoint are calculated respectively. Based on the gradient values ​​of the residual sum of squares at the current first weld breakpoint and second weld breakpoint, and the position information of the first weld breakpoint and second weld breakpoint, the position information of the first weld breakpoint and second weld breakpoint is corrected by a preset position correction formula. Based on the corrected location information of the first and second weld breakpoints, piecewise linear fitting is continued, and the sum of squared residuals is recalculated until the sum of squared residuals reaches a local minimum, thus obtaining the optimal weld breakpoint location, which is then labeled with the optimal weld breakpoint location information.

8. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the steps of the method described in any one of claims 1-6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the method described in any one of claims 1-6.

Citation Information

Patent Citations

  • Detecting Trend Changes in Time Series Data

    US20220107992A1

  • Method for detecting surface welding quality of friction stir welding

    US20230415258A1