Weld joint breakpoint marking method and device, electronic equipment and readable storage medium

By using a combination of coarse positioning and iterative optimization algorithms in the weld data set annotation, the problems of traditional manual labeling are solved, and efficient and accurate weld breakpoint labeling are achieved.

CN119150195AActive Publication Date: 2024-12-17HUAGONG TECHNOLOGY CO LTD
View PDF 14 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

The labeling of traditional weld data sets relies on manual methods, resulting in inaccurate and inefficient labeling, affecting the training accuracy and tracking stability of the weld recognition model.

Method used

By combining coarse positioning and fine positioning, by obtaining the weld data set samples to be marked, removing laser line sweep points that exceed the preset depth threshold range, dividing segments and calculating the average depth value, coarse positioning determines the weld breakpoint, and then The breakpoint position is corrected through iterative optimization algorithm to improve the labeling accuracy and efficiency.

Benefits of technology

The efficiency and accuracy of weld breakpoint labeling is significantly improved. The labeling time of traditional algorithm is about 0.267 seconds, while the labeling time of this method is about 0.036 seconds, which is about 7.4 times higher.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119150195A_ABST
    Figure CN119150195A_ABST
Patent Text Reader

Abstract

The invention provides a welding seam breakpoint marking method and device, electronic equipment and a readable storage medium. The method comprises the steps that a to-be-marked welding seam data set sample is obtained; the to-be-labeled weld data set sample consists of a plurality of rows of laser line scanning point data; for each row of laser line scanning points, laser line scanning points exceeding a preset depth threshold range are removed, and the remaining laser line scanning points are divided into a plurality of sections; the average depth value of each section is calculated, whether the variation amplitude of the average depth value of the current section and the variation amplitude of the average depth value of the previous section exceed the preset variation amplitude or not is sequentially judged in the first arrangement direction of the laser line scanning points, and if yes, the starting point of the current section is preliminarily determined as a first weld joint breakpoint; obtaining an initial position of a second weld joint breakpoint according to the same method; and correcting the positions of the first welding seam breakpoint and the second welding seam breakpoint. According to the method, the welding seam breakpoint marking efficiency is improved, and the welding seam breakpoint marking precision is guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of welding technology, and in particular to a weld breakpoint marking method, device, electronic equipment and readable storage medium. Background Art

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

[0003] Traditional weld datasets are often annotated manually, which is not only inaccurate but also inefficient. Summary of the invention

[0004] In view of this, an object of the present invention is to provide a weld breakpoint marking method, device, electronic device and readable storage medium to improve marking accuracy and marking efficiency.

[0005] In a first aspect, a weld breakpoint marking method is provided, the method comprising:

[0006] Obtain a sample of a weld data set to be annotated; the sample of the weld data set to be annotated is composed of a plurality of rows of laser line scan point data, and the laser line scan point data at least includes depth information and position information of the laser line scan point;

[0007] For each row of laser line scan points, the laser line scan points exceeding the preset depth threshold range are eliminated, 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 respectively, and the first weld breakpoint is determined by a coarse positioning method along the first arrangement direction of the laser line scan points. The coarse positioning method is as follows: whether the change range between the average depth value of the current segment and the average depth value of the previous segment exceeds the preset change range, if it exceeds, the starting point of the current segment is used to determine the first weld breakpoint; the current segment is each segment after the first segment; along the second arrangement direction, the second weld breakpoint is obtained according to the same coarse positioning method, and 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;

[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 are marked with the optimal weld breakpoint position information.

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

[0011] 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 divided segments;

[0012] Calculate the total depth information of the segment based on the depth information of each laser line scan point in each 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 change range includes:

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

[0016] determining a maximum magnitude of change based on the maximum average depth value and the minimum average depth value;

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

[0018] Optionally, 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 positions, comprising:

[0019] Perform piecewise linear fitting based on the current position information of the first weld breakpoint and the second weld breakpoint to obtain a 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 residual sum of squares reaches a local minimum;

[0022] If it is reached, the positions of the first weld breakpoint and the second weld breakpoint corresponding to the local minimum residual square sum are determined as the optimal weld breakpoint positions;

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

[0024] Correct the position information of the first weld breakpoint and the second weld breakpoint based on the gradient value of the residual sum of squares at the current first weld breakpoint and the second weld breakpoint, and the position information of the first weld breakpoint and the second weld breakpoint;

[0025] The piecewise linear fitting is continued based on the corrected position information of the first weld breakpoint and the second weld breakpoint, 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 value of the residual sum of squares at the current first weld breakpoint and the second weld breakpoint, and the position information of the first weld breakpoint and the second weld breakpoint comprises:

[0027] Based on the gradient value and position information of the residual sum of squares at the current first weld breakpoint and the second weld breakpoint, the position information of the corrected weld breakpoint is calculated by a position correction calculation formula, and the position correction calculation formula is:

[0028]

[0029] in, Represents the position information of weld breakpoint j corrected in the k+1th iteration; represents the position information of weld breakpoint j corrected in the kth iteration;

[0030] j = 1 or 2, is the breakpoint number; k is the number of iterations; α is the search step length, the initial value is 1; is the gradient at weld breakpoint j after the kth 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 unit matrix, and the Hessian matrix will be updated with each iteration correction.

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

[0032] Based on the last corrected Hessian matrix, the weld breakpoint position information and depth information before and after correction, the update calculation formula is as follows:

[0033]

[0034] in, Indicates the position deviation of the weld breakpoint j before and after correction; It shows the gradient change at weld breakpoint j before and after correction.

[0035] Optionally, the search step size is dynamically adjusted according to historical gradient information and current gradient during each iterative correction.

[0036] In a second aspect, a weld breakpoint marking device is provided, the device comprising:

[0037] An acquisition unit is used to acquire a sample of a weld data set to be annotated; the sample of the weld data set to be annotated is composed of a plurality of rows of laser line scan point data, and the laser line scan point data at least includes depth information and position information of the laser line scan point;

[0038] A rejection unit is used to reject the laser line scan points exceeding 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] A determination unit is used to calculate the average depth value of each segment based on the depth information of the laser line scan points, and determine the first weld breakpoint by a coarse positioning method along the first arrangement direction of the laser line scan points. The coarse positioning method is: sequentially determine whether the change range of the average depth value of the current segment and the average depth value of the previous segment exceeds a preset change range. If it exceeds, determine the first weld breakpoint by the starting point of the current segment; the current segment is each segment after the first segment; along the second arrangement direction, obtain the second weld breakpoint according to the same coarse positioning method, and 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 through an iterative optimization algorithm to obtain the optimal weld breakpoint position, and mark the optimal weld breakpoint position information.

[0041] In a third aspect, an electronic device is provided, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;

[0042] Memory, used to store computer programs;

[0043] The processor is used to implement any method step described in the first aspect when executing a program stored in the memory.

[0044] According to a fourth aspect, a computer-readable storage medium is provided, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, any method step described in the first aspect is implemented.

[0045] The weld breakpoint marking method, device, electronic device and readable storage medium provided by the embodiment of the present invention first determine the weld breakpoint by means of coarse positioning, and for each row of laser line scan points, remove the laser line scan points that exceed the preset depth threshold range, and divide the remaining laser line scan points into several segments; calculate the average depth value of each segment based on the depth information of the laser line scan points, and judge whether the change amplitude of the average depth value of the current segment and the average depth value of the previous segment exceeds the preset change amplitude in turn along the first arrangement direction of the laser line scan points. If it exceeds, the starting point of the current segment is determined as the first weld breakpoint; along the second arrangement direction, the second weld breakpoint is obtained according to the same method; then the positions of the first weld breakpoint and the second weld breakpoint are corrected by means of fine positioning through an iterative optimization algorithm, and the corrected optimal weld breakpoint position information is used for marking. The present invention improves the efficiency of weld breakpoint marking and ensures the accuracy of weld breakpoint marking by combining coarse positioning and fine positioning.

[0046] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.

[0048] Figure 1 A flow chart of a weld breakpoint marking method provided by an embodiment of the present invention is shown;

[0049] Figure 2 A schematic diagram of a sample of a weld data set to be annotated provided by an embodiment of the present invention is shown;

[0050] Figure 3 A schematic structural diagram of a weld breakpoint marking device provided by an embodiment of the present invention is shown;

[0051] Figure 4 A schematic structural diagram of an electronic device provided by an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0052] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. The components of the embodiments of the present invention generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present invention.

[0053] Considering that traditional weld datasets are often annotated manually, which is not only inaccurate but also inefficient, an embodiment of the present invention provides a weld breakpoint annotation method and device, which will be described below through an embodiment.

[0054] The embodiment of the present invention provides a method for marking weld breakpoints. Figure 1 As shown, the method comprises the following steps:

[0055] Step S101: obtaining a sample of a weld data set to be annotated; the sample of the weld data set to be annotated is composed of a number of rows of laser line scan point data, and the laser line scan point data at least includes depth information and position information of the laser line scan point.

[0056] In this step, the weld area can be scanned by a laser line scan camera. For example, if two steel plates are welded, the scan is performed along the weld direction. The scan is performed according to the resolution of the laser line scan camera. For example, if the resolution is 1000*3200, 1000 rows of laser line scan points will be obtained each time the scan is performed. Each row has 3200 laser line scan points. These 3200 points include weld breakpoints and steel plate line scan points. The weld breakpoints need to be identified from these laser line scan points.

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

[0058] Step S102: For each row of laser line scan points, remove the laser line scan points that exceed a 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 is set, and the depth value of each laser line scan point in each row is compared with the preset depth threshold. If it is greater than the preset depth threshold, it can be identified as an abnormal point and removed, such as Figure 2 As shown in the figure, the three points between the two lines are the abnormal points to be removed.

[0060] In one example, each row of laser line scan points can be divided into several segments as evenly as possible, and the specific number of segments can be determined according to the number of laser line scan points in each row. For example, 3200 laser line scan points can be divided into 32 segments, each segment having 100 laser line scan points.

[0061] Step S103: Based on the depth information of the laser line scan points, the average depth value of each segment is calculated respectively, and the first weld breakpoint is determined by a coarse positioning method along the first arrangement direction of the laser line scan points. The coarse positioning method is as follows: whether the change amplitude of the average depth value of the current segment and the average depth value of the previous segment exceeds the preset change amplitude, if exceeded, the first weld breakpoint is determined by the starting point of the current segment; the current segment is each segment after the first segment; along the second arrangement direction, the second weld breakpoint is obtained according to the same coarse positioning method, and 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, for example, a row of laser line scan points is divided into 30 segments. The average depth value of each segment is compared with the previous segment in order from left to right. When the change range of the average depth value exceeds the preset change range, the starting point of the current segment is used as the position x of the first weld breakpoint. b1 , that is, the first weld breakpoint is P1:(x b1 ,y b1 ), and stop comparing; compare from right to left in the same way until the position x of the second weld breakpoint is determined b2 , that is, the breakpoint of the second weld is P2:(x b2 ,y b2 ).

[0063] This step is a rough positioning process. By comparing the average depth value, the approximate position of the weld breakpoint can be quickly determined. This step can improve the efficiency of marking the weld breakpoint.

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

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

[0066] The embodiment of the present invention has been verified through experiments. Taking the laser line scan points with a sample data length of 4400 points as an example, the average time for labeling the weld data sample using the traditional algorithm is about 0.267 seconds, while the average time for labeling using the method is about 0.036 seconds, and the labeling efficiency is improved by about 7.4 times.

[0067] It can be understood from the above embodiments that 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 embodiment, the average depth value of each segment is calculated based on the depth information of the laser line scan point, which 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 divided segments.

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

[0071] By adding the depth information of each laser line scan point of each segment, the total depth information of the segment can be obtained. It should be noted that if there is a common laser line scan point at the end of adjacent segments, when calculating the total depth, the common laser line scan point can be attributed to the next segment for calculation to avoid repeated calculation.

[0072] Step S103C: Calculate 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 by the following formula:

[0074]

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

[0076] The embodiment of the present invention divides each row of laser line scan points into several segments by means of 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 preliminarily and quickly determined. On the other hand, the number of iterative optimizations in subsequent fine positioning can be greatly reduced, the iteration time is shortened, and thus the annotation efficiency of the data set is improved.

[0077] Improved the efficiency of weld breakpoint marking.

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

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

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

[0081] The maximum magnitude of change is determined based on the maximum average depth value and the minimum average depth value.

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

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

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

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

[0086] Among them, D m is the maximum change range, and n is the number of divided segments.

[0087] Through this embodiment, the maximum change amplitude is evenly distributed to each small segment according to the number of divided segments and the maximum change amplitude, so that a reasonable change amplitude threshold can be obtained. Once the change amplitude threshold is exceeded, the position of the breakpoint can be determined.

[0088] Based on the above embodiment, 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, which includes the following steps:

[0089] Step S104A: performing piecewise linear fitting based on the current position information of the first weld breakpoint and the second weld breakpoint to obtain a fitting depth value of each laser line scanning point.

[0090] In one example, P1 and P2 are used as the first weld breakpoint and the second weld breakpoint, and each row of laser line scan points is divided into three sections. The middle section is generally the area where the weld is located, and the two sides are the areas where the steel plate is located. Specifically, based on the first weld breakpoint P1:(x b1 ,y b1) and the second weld breakpoint P2: (x b2 ,y b2 ) coordinates to construct a piecewise linear function, through which the fitting depth value of each laser line scan point can be obtained. The piecewise linear function can be expressed as:

[0091]

[0092] in, It indicates the fitting 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 residual sum of squares is calculated as follows:

[0095]

[0096] Among them, y i is the true depth value of the laser line scan point, is the fitting depth value.

[0097] Step S104C: Determine whether the residual sum of squares reaches a local minimum.

[0098] In this step, whether the local minimum is reached can be determined by determining the change of the residual sum of squares for a preset number of consecutive times. For example, if the residual sum of squares does not continue to decrease for three consecutive times, it means that the local minimum is reached.

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

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

[0101] In this step, by taking the derivative of the residual sum of squares, the gradient values ​​of the residual sum of squares 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] Wherein, j=1 or 2, which is the breakpoint number.

[0105] Step S104F: correcting the position information of the first weld breakpoint and the second weld breakpoint based on the gradient value of the residual sum of squares at the current first weld breakpoint and the second weld breakpoint, and the position information of the first weld breakpoint and the second weld breakpoint.

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

[0107] On the basis of the above embodiment, based on the gradient value of the residual sum of squares at the current first weld breakpoint and the second weld breakpoint, and the position information of the first weld breakpoint and the second weld breakpoint, correcting 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 the second weld breakpoint, the position information of the first weld breakpoint and the second weld breakpoint are calculated by the position correction calculation formula, and the position correction calculation formula is:

[0109]

[0110] in, Represents the position information of weld breakpoint j corrected in the k+1th iteration; represents the position information of weld breakpoint j corrected in the kth iteration;

[0111] j = 1 or 2, is the breakpoint number; k is the number of iterations; α is the search step length, the initial value is 1; is the gradient at weld breakpoint j after the kth 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 unit matrix, and the Hessian matrix will be updated with each iteration correction.

[0112] Based on the above embodiment, the updating process of the Hessian matrix includes:

[0113] Based on the last corrected Hessian matrix, the weld breakpoint position information and depth information before and after correction, the update calculation formula is as follows:

[0114]

[0115] in, Indicates the position deviation of the weld breakpoint j before and after correction; It shows the gradient change at weld breakpoint j before and after correction.

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

[0117] In the embodiment of the present invention, the search step size is an important concept in the optimization algorithm. The search step size usually refers to the amplitude of parameter update in each iteration during the optimization process.

[0118] In one example, the search step size can be adjusted by:

[0119]

[0120] in, is the sum of squares of all historical gradients at weld breakpoint j, Represents the current gradient, ∈ is a small positive number used to avoid the denominator being zero.

[0121] In the above formula, the larger the historical gradient at the weld breakpoint, the smaller the search step size, and the smaller the historical gradient, the larger the search step size.

[0122] In the embodiment of the present invention, the search step size determines the distance to move toward the gradient. Too large a step size may cause the algorithm to oscillate near the optimal solution and fail to converge, while too small a step size will result in slow convergence. Therefore, the embodiment of the present invention dynamically adjusts the search step size according to the historical gradient information and the current gradient information, which can ensure the speed and stability when correcting the weld breakpoint position.

[0123] Based on the same inventive concept, a weld breakpoint marking device is provided, such as Figure 3 As shown, the device comprises:

[0124] The acquisition unit 301 is used to acquire a sample of the weld data set to be annotated; the sample of the weld data set to be annotated is composed of several rows of laser line scan point data, and the laser line scan point data at least includes depth information and position information of the laser line scan point.

[0125] The elimination unit 302 is used to eliminate the laser line scan points exceeding a preset depth threshold range for each row of laser line scan points, and divide the remaining laser line scan points into a plurality of segments.

[0126] The determination 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 determine the first weld breakpoint by a coarse positioning method along the first arrangement direction of the laser line scan points. The coarse positioning method is as follows: determine in turn whether the change range of the average depth value of the current segment and the average depth value of the previous segment exceeds a preset change range. If it exceeds, the first weld breakpoint is determined by the starting point of the current segment; the current segment is each segment after the first segment; along the second arrangement direction, the second weld breakpoint is obtained according to the same coarse positioning method, and 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.

[0127] Among them, the method for determining the preset change 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 change range based on the maximum average depth value and the minimum average depth value; determining the preset change range based on the maximum change range and the number of divided segments.

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

[0129] The determination unit is specifically used for:

[0130] 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 divided segments;

[0131] Calculate the total depth information of the segment based on the depth information of each laser line scan point in each 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 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 scanning point.

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

[0136] Determine whether the residual sum of squares reaches a local minimum.

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

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

[0139] The position information of the first weld breakpoint and the second weld breakpoint is corrected based on the gradient value of the residual sum of squares at the current first weld breakpoint and the second weld breakpoint, 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 the second weld breakpoint, the position information of the first weld breakpoint and the second weld breakpoint are calculated by the position correction calculation formula, and the position correction calculation formula is:

[0141]

[0142] in, Represents the position information of weld breakpoint j corrected in the k+1th iteration; represents the position information of weld breakpoint j corrected in the kth iteration;

[0143] j = 1 or 2, is the breakpoint number; k is the number of iterations; α is the search step length, the initial value is 1; the search step length is dynamically adjusted according to the historical gradient information and the current gradient during each iteration; is the gradient at weld breakpoint j after the kth 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 unit matrix, and the Hessian matrix will be updated with each iteration correction.

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

[0145] Based on the last corrected Hessian matrix, the weld breakpoint position information and depth information before and after correction, the update calculation formula is as follows:

[0146]

[0147] in, Indicates the position deviation of the weld breakpoint j before and after correction; It shows the gradient change at weld breakpoint j before and after correction.

[0148] The piecewise linear fitting is continued based on the corrected position information of the first weld breakpoint and the second weld breakpoint, 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, an embodiment of the present invention further provides 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 via the communication bus 404 .

[0150] Memory 403, used for storing computer programs;

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

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

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

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

[0155] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0156] The computer program product for marking weld breakpoints provided in an embodiment of the present invention includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the method described in the previous method embodiment. The specific implementation can be found in the method embodiment, which will not be repeated here.

[0157] The device for marking weld breakpoints provided in the embodiment of the present invention may be specific hardware on the device or software or firmware installed on the device. The device provided in the embodiment of the present invention has the same implementation principle and technical effects as those in the aforementioned method embodiment. For the sake of brief description, for matters not mentioned in the device embodiment, reference may be made to the corresponding contents in the aforementioned method embodiment. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, devices and units described above can all refer to the corresponding processes in the aforementioned method embodiment, and will not be repeated here.

[0158] In the embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.

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

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

[0161] If the functions are implemented in the form of 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 the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program codes.

[0162] It should be noted that similar numbers and letters represent similar items in the following figures. 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 only used to distinguish the description and are not to be understood as indicating or implying relative importance.

[0163] Finally, it should be noted that the above-described embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above-described embodiments, those skilled in the art should understand that any person skilled in the art can still modify the technical solutions described in the above-described embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or perform equivalent replacements on some of the technical features thereof; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention. They should all be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims

1. A method for marking weld breakpoints. It is characterized in that The method comprises: Acquire a sample of a weld data set to be annotated; the sample of the weld data set to be annotated is composed of a plurality of rows of laser line scan point data, and the laser line scan point data at least includes depth information and position information of the laser line scan point; For each row of laser line scan points, the laser line scan points exceeding the preset depth threshold range are eliminated, 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 respectively, and the first weld breakpoint is determined by a coarse positioning method along the first arrangement direction of the laser line scan points. The coarse positioning method is as follows: sequentially judging whether the variation range between the average depth value of the current segment and the average depth value of the previous segment exceeds a preset variation range, and if so, determining the first weld breakpoint by the starting point of the current segment; the current segment is each segment after the first segment; along the second arrangement direction, the second weld breakpoint is obtained according to the same coarse positioning method, and 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; 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 are marked with the optimal weld breakpoint position information.

2. The method according to claim 1, It is characterized in that The method of calculating the average depth value of each segment based on the depth information of the laser line scan point comprises: 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 divided segments; Calculate the total depth information of the segment based on the depth information of each laser line scan point in each 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, It is characterized in that The method for determining the preset change range includes: After calculating the average depth value of each segment, determine the maximum average depth value and the minimum average depth value; determining a maximum amplitude of change based on the maximum average depth value and the minimum average depth value; A preset variation range is determined based on the maximum variation range and the number of divided segments.

4. The method according to claim 1, It is characterized in that 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 positions, including: Perform piecewise linear fitting based on the current position information of the first weld breakpoint and the second weld breakpoint to obtain a 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 residual sum of squares reaches a local minimum; If it is reached, the positions of the first weld breakpoint and the second weld breakpoint corresponding to the local minimum residual square sum are determined as the optimal weld breakpoint positions; If not reached, the gradient values ​​of the residual sum of squares at the current first weld breakpoint and the second weld breakpoint are calculated respectively; Correct the position information of the first weld breakpoint and the second weld breakpoint based on the gradient value of the residual sum of squares at the current first weld breakpoint and the second weld breakpoint, and the position information of the first weld breakpoint and the second weld breakpoint; The piecewise linear fitting is continued based on the corrected position information of the first weld breakpoint and the second weld breakpoint, and the residual sum of squares is recalculated until the residual sum of squares reaches a local minimum.

5. The method according to claim 4, It is characterized in that The method of correcting the position information of the first weld breakpoint and the second weld breakpoint based on the gradient value of the residual sum of squares at the current first weld breakpoint and the second weld breakpoint, and the position information of the first weld breakpoint and the second weld breakpoint comprises: Based on the gradient values ​​of the residual sum of squares at the current first weld breakpoint and the second weld breakpoint, the position information of the first weld breakpoint and the second weld breakpoint are calculated by a position correction calculation formula, and the position correction calculation formula is: Among them, P j (k+1) represents the position information of weld breakpoint j corrected in the k+1th iteration; P j (k) Represents the position information of weld breakpoint j corrected in the kth iteration; j = 1 or 2, is the breakpoint number; k is the number of iterations; α is the search step length, the initial value is 1; is the gradient at weld breakpoint j after the kth 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 unit matrix, and the Hessian matrix will be updated with each iteration correction.

6. The method according to claim 5, It is characterized in that The updating process of the Hessian matrix includes: Based on the last corrected Hessian matrix, the weld breakpoint position information and depth information before and after correction, the update calculation formula is as follows: in, Indicates the position deviation of the weld breakpoint j before and after correction; It shows the gradient change at weld breakpoint j before and after correction.

7. The method according to claim 5, It is characterized in that The search step size is dynamically adjusted according to historical gradient information and the current gradient during each iterative correction.

8. A weld breakpoint marking device, It is characterized in that The device comprises: An acquisition unit is used to acquire a sample of a weld data set to be annotated; the sample of the weld data set to be annotated is composed of a plurality of rows of laser line scan point data, and the laser line scan point data at least includes depth information and position information of the laser line scan point; A rejection unit is used to reject the laser line scan points exceeding a preset depth threshold range for each row of laser line scan points, and divide the remaining laser line scan points into several segments; A determination unit is used to calculate the average depth value of each segment based on the depth information of the laser line scan points, and determine the first weld breakpoint along the first arrangement direction of the laser line scan points by a coarse positioning method, wherein the coarse positioning method is as follows: sequentially determine whether the variation range between the average depth value of the current segment and the average depth value of the previous segment exceeds a preset variation range, and if so, determine the first weld breakpoint by the starting point of the current segment; the current segment is each segment after the first segment; along the second arrangement direction, obtain the second weld breakpoint according to 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; The correction unit is used to correct the positions of the first weld breakpoint and the second weld breakpoint through an iterative optimization algorithm to obtain the optimal weld breakpoint position, and mark the optimal weld breakpoint position information.

9. An electronic device, It is 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, for implementing the method steps described in any one of claims 1 to 7 when executing a program stored in a memory.

10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps described in any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • A PSO-BFGS neural network training algorithm

    CN109816103A

  • High-precision aluminum alloy laser self-fusion welding process

    CN111250868A

  • Step signal breakpoint detection method based on Sigmoid function

    CN112733956A

  • Curve fitting optimization method, storage medium, electronic equipment and system

    CN112836176A

  • Method for determining cycle threshold value of linear-S-shaped growth curve of PCR (polymerase chain reaction)

    CN114065120A