Steel pipe curved surface defect detection method and system based on three-dimensional data fitting
Through the three-dimensional data fitting method, the distance matrix and iterative closest point alignment profile are used, and the fitting curve is optimized by combining the weighted average and gradient descent method, the detection error caused by uneven light and production line vibration is solved, and the steel pipe surface defect identification is achieved with higher accuracy.
Patent Information
- Application Number
- CN202510586626.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-08
- Publication Date
- 2025-07-25
AI Technical Summary
The existing steel pipe curved surface detection technology is difficult to accurately identify defects under the influence of factors such as uneven lighting and production line vibration, resulting in misjudgment and misjudgment. The traditional three-dimensional curve fitting method cannot accurately capture the data characteristics of complex shapes, affecting the detection accuracy and reliability.
By calculating the distance matrix between the two contours and constructing the cumulative distance matrix, the reference contour and the contour to be detected are aligned using the iterative closest point method, the fitting curve is optimized by combining the weighted average distance minimization method and the gradient descent method, the adjustment threshold is set to adjust the translation vector to compensate for data offset, and a local feature descriptor is introduced to identify defects.
It improves the accuracy and reliability of steel pipe curved defect detection, reduces misjudgment and misjudgment, and can more accurately reflect the true shape and characteristics of the steel pipe surface, ensuring the integrity and accuracy of the detection results.
Smart Images

Figure CN120369912A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of defect detection, and in particular to a steel pipe curved surface defect detection method and system based on three-dimensional data fitting. Background Art
[0002] In the field of steel pipe production and manufacturing, the detection of steel pipe curved surface defects is crucial, and its detection accuracy is directly related to the quality and use safety of steel pipes. However, the existing detection technologies face many challenges. First of all, the curved surface of the steel pipe has complex geometric shapes and textures. When using two-dimensional image acquisition, the problem of uneven illumination is more prominent, which makes the collected images difficult to accurately reflect the true condition of the steel pipe surface, greatly increasing the difficulty of correctly identifying defects. In actual production, the situation of misjudging and missing defects due to illumination interference often occurs, seriously affecting the accuracy and reliability of steel pipe quality detection. Secondly, traditional three-dimensional curve fitting often relies on pi and the least squares method. However, when facing complex and irregular-shaped data, this method has obvious defects. It cannot accurately capture the true form of the data, easily causing the loss or distortion of information of key feature points. Taking a steel pipe with complex deformation or special texture as an example, the curve obtained by the traditional fitting method has a large deviation from the actual contour, making it difficult to effectively identify defect features, thus affecting the detection accuracy and effect.
[0003] Finally, in the process of steel pipe production, factors such as production line vibration are inevitable, which will cause displacement deviation of the collected data. However, traditional three-dimensional data processing methods usually ignore this problem. When performing contour matching and defect detection, due to the offset of the data, inaccurate results will be generated, further reducing the fitting accuracy and greatly discounting the effectiveness of defect identification. A small displacement deviation may misjudge a normal area as a defect area or miss a real defect. Its data processing method often only focuses on the analysis of a single contour or a local area, and fails to fully recognize the close feature correlation between different contours. At present, a steel pipe curved surface defect detection method and system based on three-dimensional data fitting are needed. Summary of the Invention
[0004] In order to solve the problems of the drawbacks of two-dimensional image detection, traditional three-dimensional curve fitting and the negative impact of displacement deviation on the detection results in the above background art, the present invention provides a steel pipe curved surface defect detection method and system based on three-dimensional data fitting. By calculating the distance matrix between two contours and constructing an accumulated distance matrix, the best matching path between the contour to be corrected and the reference contour is found, and the iterative closest point method is used to gradually adjust and align the two to obtain accurate contour data, improving the matching degree between the fitting curve and the actual contour and reducing the error caused by data offset.
[0005] In a first aspect, a method for detecting steel pipe surface defects based on three-dimensional data fitting provided by the present invention adopts the following technical solutions: A method for detecting steel pipe surface defects based on three-dimensional data fitting includes: Obtain the three-dimensional contour data of the steel pipe and number the obtained three-dimensional contour data; Set a reference contour based on the obtained three-dimensional contour data, including obtaining the final reference contour fitting curve by using the weighted average distance minimization method; Locate the single contour defect positions according to the reference contour fitting curve, including calculating the contour correction data by using the reference contour and comparing the contour defect data according to the contour correction data; Count the number of recognized multi-contour defect positions by using the single contour defect positions, including calculating the same defect according to the set of initial defect points of the single contour; Statistically analyze all the contour data in the entire detection area to obtain the final statistical result of the defects; Output the defect position information by using the final statistical result of the defects, including searching for the corresponding coordinate information in the original defect contour to output the defect position information.
[0006] Further, the numbering of the obtained three-dimensional contour data includes setting that N line contours are collected as a defect detection area, numbering each collected contour line respectively, and defining the entire area formed by the N defect contours as , defining the data set of points on a single contour line, where the information of each point in the data set includes the coordinate position index and the height information.
[0007] Further, the obtaining of the final reference contour fitting curve by using the weighted average distance minimization method includes collecting multiple three-dimensional contours without surface defects for data initialization, calculating the average of all points at each contour position to obtain the initial average contour line, introducing a distance-based weight function, calculating the weight of each point according to the distance from the point to the curve and the weight function, and obtaining the best-fitting contour points by weighted average, and the weighted average is expressed as: , where is the vertical distance from the point to the current standard position curve , represents the distance-based weight function, which is used to measure the distance relationship between a certain point and the currently estimated standard position curve, represents the points at the same position on multiple contours.
[0008] Further, the method of obtaining the final reference contour fitting curve by using the weighted average distance minimization method further includes defining a weight function to assign weights to different optimally fitted contour points, constructing an objective function of curve fitting error by using the weight function, iteratively updating the objective function by the gradient descent method to obtain a set of optimized control points, and obtaining the final reference contour fitting curve through a fitting equation, where the fitting equation is expressed as: , wherein, is a non-uniform B-spline basis function, are the optimized control points in the z direction, is the corresponding weight value, u is a parameterization variable used to define the position of points on the curve, and n is the total number of control points.
[0009] Further, the method of calculating the contour correction data by using the reference contour includes using dynamic programming to find the best matching path between the contour line to be corrected and the reference contour, calculating the initial translation vector according to the best matching path, aligning the reference contour and the contour to be detected by the iterative closest point method, setting an adjustment threshold and adjusting the translation vector to update the contour position, and obtaining the contour correction data when the change is less than the adjustment threshold. The calculation formula of the initial translation vector is: , where k is the number of point pairs in the matching path, is the height value of the point in the reference contour, is the height value of the point in the contour to be corrected.
[0010] Further, the method of comparing the contour defect data according to the contour correction data includes comparing the z values at the corresponding coordinate positions of the contour correction data and the reference contour data, setting a height difference threshold, and taking the point indexes and z values with the comparison difference greater than the height difference threshold as the defect set , introducing a local feature descriptor, setting a window and a step size to calculate the local features around each point, calculating the average slope of k points for each value in the region, and putting the indexes and z values of the points in the current two regions into the defect set when the product of the slopes of adjacent window regions is negative , and using and to determine the initial defect point set.
[0011] Further, the same defect calculation based on the set of initial defect points of a single contour includes dividing the set of initial defect points into several parts according to the continuity of the index and putting them into a segmentation set, obtaining partial segmentation sets for the same defect judgment, setting a coincidence threshold and calculating the degree of coincidence, and using the degree of coincidence and the coincidence threshold for the same defect judgment. The formula for calculating the degree of coincidence is: , where represents the overlapping area, and respectively represent the starting and ending index positions of the k-th consecutive part, and respectively represent the ending index position and the starting index position of the -th consecutive segmentation part of the set of initial defect points of the adjacent contour for calculating the degree of coincidence with the k-th consecutive part.
[0012] In a second aspect, a steel pipe curved surface defect detection system based on three-dimensional data fitting includes: A data acquisition module configured to: acquire three-dimensional contour data of a steel pipe and number the acquired three-dimensional contour data; A reference module configured to: set a reference contour based on the acquired three-dimensional contour data, including obtaining a final reference contour fitting curve by using the weighted average distance minimization method; A comparison module configured to: find the position of a single contour defect according to the reference contour fitting curve, including calculating contour correction data by using the reference contour and comparing the contour defect data according to the contour correction data; A defect module configured to: count the number of identified multi-contour defect positions by using the single contour defect position, including performing the same defect calculation according to the set of initial defect points of a single contour; A statistics module configured to: perform statistics on all contour data in the entire detection area to obtain the final statistical result of the defect; An output module configured to: output defect position information by using the final statistical result of the defect, including finding the corresponding coordinate information in the original defect contour for outputting the defect position information.
[0013] In a third aspect, the present invention provides a computer-readable storage medium storing multiple instructions, which are suitable for being loaded and executed by a processor of a terminal device to perform the steel pipe curved surface defect detection method based on three-dimensional data fitting.
[0014] Fourthly, the present invention provides a terminal device, including a processor and a computer-readable storage medium. The processor is configured to implement each instruction, and the computer-readable storage medium is configured to store multiple instructions, and the instructions are adapted to be loaded and executed by the processor to perform the method for detecting steel pipe surface defects based on three-dimensional data fitting.
[0015] In summary, the present invention has the following beneficial technical effects: 1. The present invention collects multiple three-dimensional profiles without surface defects for data initialization, calculates the initial average profile line by averaging the points at each profile position, then introduces a distance-based weight function to calculate the weights of the points, and obtains the best-fitting profile points in a weighted average manner. It can adaptively adjust the contribution degree of each point to the fitting result according to the distance difference between the point and the standard position curve, highlight the influence of the key feature area, and more accurately reflect the true shape of the steel pipe surface compared with the traditional fitting method, effectively improving the accuracy of the reference profile fitting curve.
[0016] 2. The present invention defines an additional weight function to assign weights according to different best-fitting profile points, constructs a curve fitting error objective function, and iteratively updates to obtain optimized control points by means of the gradient descent method. Finally, the reference profile fitting curve is obtained through the fitting equation, further optimizing the curve fitting effect, making the fitting curve more conform to the actual steel pipe surface profile, providing a more accurate reference standard for subsequent defect detection, and significantly improving the accuracy of defect judgment.
[0017] 3. The present invention uses dynamic programming to find the best matching path, calculates the initial translation vector based on this, aligns the reference profile and the profile to be detected by the iterative closest point method, and sets an adjustment threshold to adjust the translation vector to update the profile position to obtain profile correction data, which can effectively compensate for the data acquisition displacement deviation caused by factors such as production line vibration, ensure the accuracy of the data used for subsequent defect detection, reduce the false judgment and missed judgment of defects caused by data offset, and improve the reliability of the detection result.
[0018] 4. The present invention compares the z values of the profile correction data and the reference profile data, sets a height difference threshold to determine the defect set, and at the same time introduces a local feature descriptor. By calculating the average slope and judging the product of the slopes of adjacent windows to determine the defect set, and combines the two to determine the initial defect point set, which combines the overall height difference and local feature change information, can more comprehensively and accurately identify various defects on the steel pipe surface, and effectively avoids the problem of defect omission that may be caused by a single judgment standard.
[0019] 5. The present invention divides the initial defect point set based on index continuity, obtains partial segmentation sets for the same defect judgment, and determines whether the defects on different contours belong to the same defect by setting a coincidence threshold and calculating the coincidence degree. It can accurately identify the areas belonging to the same defect on adjacent contours, precisely define the scope of the defect, avoid misjudging the parts of the same defect on different contours as multiple defects, and improve the accuracy and integrity of defect detection. Description of the Drawings
[0020] Figure 1 is the overall flow schematic diagram of a steel pipe curved surface defect detection method based on three-dimensional data fitting in Embodiment 1 of the present invention.
[0021] Figure 2 is the schematic diagram of the construction process of the reference contour fitting curve in Embodiment 1 of the present invention.
[0022] Figure 3 is the schematic diagram of the contour correction process based on nearest point dynamic regularization in Embodiment 1 of the present invention.
[0023] Figure 4 is the schematic diagram of the single contour defect position search and judgment logic in Embodiment 1 of the present invention.
[0024] Figure 5 is the schematic diagram of the multi-contour defect position recognition and number statistics analysis in Embodiment 1 of the present invention. Detailed Embodiment
[0025] The present invention will be further described in detail below with reference to the drawings.
[0026] Embodiment 1 Referring to Figure 1 , a steel pipe curved surface defect detection method based on three-dimensional data fitting in this embodiment includes: Obtain the three-dimensional contour data of the steel pipe and number the obtained three-dimensional contour data; Set a reference contour based on the obtained three-dimensional contour data, including obtaining the final reference contour fitting curve by using the weighted average distance minimization method; Search for the single contour defect position according to the reference contour fitting curve, including calculating the contour correction data by using the reference contour and comparing the contour defect data according to the contour correction data; Use the single contour defect position for multi-contour defect position recognition and number statistics, including performing the same defect calculation according to the single contour initial defect point set; Statistically analyze all the contour data in the entire detection area to obtain the final statistical result of the defect; Output the defect position information by using the final statistical result of the defect, including searching for the corresponding coordinate information in the original defect contour for defect position information output.
[0027] Specifically, it includes the following steps: As Figure 1 shown, S1, obtain the three-dimensional contour data of the steel pipe, and number the obtained three-dimensional contour data; Obtain the three-dimensional contour data of the steel pipe. The data is obtained by real-time scanning with a line laser scanner. Each acquisition is a line contour data. Set 2000 line contours as a defect detection area. Number each contour line collected , where i i = 1, 2,..., 2000. Define the entire area formed by 2000 defect contours as . The data set of a single contour line point is , i i = 1, 2,..., 2000. The information of each point includes , where is the coordinate position index of the point, is the height information, , represent the position information on .
[0028] S2. Find the defect position of a single contour according to the reference contour fitting curve, including calculating the contour correction data using the reference contour and comparing the contour defect data according to the contour correction data; As Figure 2 shown, set the reference contour selection standard steel pipe production part, collect the surface contour of the defect-free steel pipe, collect 20 contours, and use the weighted average distance minimization method. First, initialize the data. For the points at the same position on the 20 contours, record them as , where i represents the i-th contour line, i i = 1, 2,..., n. j represents the j -th contour position point. j i = 1, 2,..., n. Calculate the initial average contour, and perform an average calculation on all points at each position j to obtain the initial average contour line : , where, represents the points at the same position on multiple contours. Define the weight function and introduce a distance-based weight function W(d) to measure the distance relationship between a certain point and the currently estimated standard position curve.
[0029] , Among them, d is the distance from the point to the current standard position curve, and σ controls the speed of weight decay to optimize the iterative process. For each iteration, the current standard position curve is used Calculate the distances from all points to this curve, and calculate the weight of each point according to these distances and the above weight function. Recalculate the best point at each position j , in the way of weighted average: , Among them, is the point to the current standard position curve vertical distance of represents the weight function based on distance, which is used to measure the distance relationship between a certain point and the currently estimated standard position curve represents the points at the same position on multiple contours. Take as the new standard position curve, repeat the iteration until convergence or reach the predetermined number of iterations to obtain the best-fitting contour points . Different weights are assigned according to the importance of points to enhance the fitting effect of the key feature area, and the weight function is defined as: , Among them, is the distance between adjacent points, is the speed that controls the weight to decrease as the distance increases. Define the curve fitting error objective function E(C, f), where C represents the set of control points, C = , f represents the set of weights, is the contour point, is obtained by non-uniform B-spline interpolation, corresponding to height value on the fitting curve of , Among them, represents the contour point, represents the height value on the fitting curve corresponding to . The objective function is iteratively updated by the gradient descent method to obtain a set of optimized control points and weights , and the final reference contour fitting curve is obtained through the fitting equation Q。
[0030] , Among them, It is a non-uniform B-spline basis function, is the optimized control point value in the z direction, is the corresponding weight value, u is a parameterization variable used to define the position of points on the curve, and n is the total number of control points.
[0031] S3. Finding the position of single-profile defects by fitting a curve based on the reference profile, including calculating profile correction data using the reference profile and comparing profile defect data based on the profile correction data; Mainly by correcting 2000 profile data, comparing the corresponding position data with the set reference profile, and using the set threshold to screen the initial defect points.
[0032] Specifically, it is divided into profile correction and profile defect data comparison.
[0033] Step 1: Regarding profile correction, as Figure 3 shown, due to the vibration problem of the production line during data acquisition, the position of the acquired data may be shifted. To prevent errors in subsequent comparison, it is necessary to first correct the profile data. This goal is achieved by using the dynamic time warping algorithm based on the nearest point. First, use dynamic time warping to find the best matching path between the profile line to be corrected Q and the reference profile; secondly, use the nearest point query to gradually adjust it to align with the reference profile through multiple iterations; finally, fine-tune the result to ensure accuracy. Specifically as follows: Calculate the distance matrix between the two profiles, and each element in the distance matrix represents the absolute value of the height difference between the j-th position in the reference profile data Q and the j-th position in the profile data to be corrected : , where is the j-th element in the distance matrix , is the height information of the j-th position point in the profile data to be corrected , is the height information of the j-th position point in the reference profile data Q, and construct the cumulative distance matrix , where each element in represents the minimum cumulative distance between the i-th point in the reference profile Q and the j-th point in the profile to be corrected .
[0034] , Among them, is the minimum cumulative distance from the reference contour to the (i - 1)-th point and from the contour to be corrected to the j-th point, is the minimum cumulative distance from the reference contour to the i-th point and from the contour to be corrected to the (j - 1)-th point, is the minimum cumulative distance from the reference contour to the (i - 1)-th point and from the contour to be corrected to the (j - 1)-th point, = , that is, the cumulative distance of the starting point is equal to its own distance, and the initial condition is , are respectively initialized as the cumulative distance from the starting point to this point. By backtracking, the best path P from the starting point to the ending point is found, and the ending point of the best path is determined, that is, the last element in the cumulative distance matrix. The ending point coordinates are (m, n), where m and n are the numbers of points of the reference contour and the corrected contour respectively. The path P is initialized as an empty list, and the ending point coordinates (m, n) are added to the path. Starting from the current point, check the three possible predecessor points (i - 1, j), (i, j - 1), (i - 1, j - 1), and find the point with the minimum cumulative distance among these three points as the next backtracking point. Add this point to the path P, update the current position to this point, and continue the above process until reaching the starting point (0, 0) to obtain the best path P: , Among them, is a position index in the reference contour, is a position index in the contour to be corrected, and k is the number of point pairs in the matching path. According to the best path P, the initial translation vector can be calculated, which represents the average height difference between the two contours in the z direction.
[0035] , Among them, k is the number of point pairs in the matching path, is the height value of the point in the reference contour, is the height value of the point in the contour to be corrected. The reference contour and the contour to be detected are aligned using the iterative closest point method.
[0036] The single contour data is preliminarily adjusted according to to obtain : , Among them, represents the initial translation vector, and find the corresponding point of the point in the contour to be corrected in the reference contour Q , select the corresponding point with the minimum distance as the subsequent updated translation vector, and calculate it as: , where, is the z-value of the midpoint of the contour to be corrected after adjustment, is the z-value of the midpoint of the reference contour, helps to establish the best matching relationship between each pair of points and update the translation vector , with the initial value of , to minimize the error: , where, is the translation vector, and its value is continuously adjusted to optimize the contour matching effect. By taking the derivative of the formula and setting it to 0, the new translation vector can be obtained.
[0037] , Update 's position : , where, represents the contour to be corrected after being adjusted by the updated translation vector , and repeat the above steps. When the change is less than the preset threshold or the maximum number of iterations is reached, stop the iteration and obtain the contour correction data . .
[0038] Step 2: Compare the contour defect data. As Figure 4 shown, first compare the z-values of the corresponding coordinate positions of the obtained with the reference contour data, and set the height difference threshold . When the difference is greater than , put the qualified point indices and z-values into the defect set . Secondly, for the obtained data, introduce a local feature descriptor, select an appropriate window size k, and the step size is k, which is used to calculate the local features around each point. For each value in the region, calculate the average slope of k points: , where, and respectively represent the height values at the positions of k points to the right and k points to the left centered on the i-th point. Compare the slope values of two adjacent windows , , and judge and Whether the product of the regional slopes is negative. If it is negative, it proves that there are defects in the curve, and the indexes of the current two regional points and the z value are put into the defect set Traverse the whole contour curve and put the information of all qualified points into the defect set .
[0039] S4. Use the single contour defect positions to count the number of recognized multi - contour defect positions, including calculating the same defect according to the set of single - contour initial defect points; For and the defect data, for the points with the same index in the two sets, judge whether the number of consecutive indexes is greater than the set coincidence threshold , define the function as Retain the qualified regions, and the specific calculation formula is: , where L is the length of continuous coincidence, i is the starting index position of the coincidence sequence in the set, and j is the index offset for traversing the continuous coincidence part belongs to , indicating the element that moves j positions backward from index i belongs to, indicating the element that moves j positions backward from index i, and put the qualified index points into the initial defect point set , for and the index points that do not meet in, respectively judge whether there is a region with a continuous number greater than . If it exists, put this region into the point .
[0040] In actual detection, due to the complexity of the steel pipe surface defects, some defects may not be accurately identified under a single judgment condition. Therefore, for these index points that fail the initial screening, further analysis is required. For example, there may be some defects with insufficiently obvious features in a local area, resulting in being missed in the initial coincidence degree judgment, but in fact they are continuous within a certain range and may also represent real defects. So, by checking again whether there is a region with a continuous number greater than for these index points. If it exists, put this region into the point . After completing the preliminary integration of the defect points on the single contour, next, calculate the same defect based on the set of single - contour initial defect points, and the specific calculation is as shown in S5
[0041] S5. Statistically analyze all the contour data in the entire detection area to obtain the final statistical result of the defects; Statistical count of the number of multi-profile defect location identifications, such as Figure 5 As shown, the set of initial defect points of the single profile obtained and the set of initial defect points of the next profile adjacent to the profile number are used to calculate whether the defect data index points are the same defect. Define the set , and based on the continuity of the index, the set is divided into several parts and placed into the set .
[0042] , Among them, represents , represents the k-th consecutive part, and represent the starting and ending index positions of the k-th consecutive part respectively, and represent the starting and ending index values of the k-th consecutive part respectively, means that within a consecutive part, the difference between any two adjacent indices is 1, indicating that they are consecutive. indicates that when the difference between two indices is greater than 1, it means the current consecutive part ends. then indicates that the current consecutive part directly reaches the end of the entire set, and there are no more indices to compare. For the obtained partially segmented set , for and in each part, determine whether they are the same defect, and initialize three new sets A (used to store the merged parts), B (used to store the defect data to be matched), and C (used to store the complete defect data). represents the defect area, represents the number of adjacent profiles. For each part in and each part in , calculate the overlapping area . Set the overlap threshold , let represent the k-th consecutive part in represent the l -th consecutive part in , Among them, represents the k-th consecutive part in denote the l nth consecutive part and denote the end indices of different regions. Overlap calculation: , wherein denotes the overlapping region. If , then merge with to form a new region : , Establish a new set in set C according to the newly emerged partial data , add ( , ) and ( , ) to , and record the corresponding contour numbers of and respectively. Here, j represents the jth contour and j + 1 represents the (j + 1)th contour. Add to A, and set the recorded occurrence times as , currently 1. If , then add to set B and delete . Delete
[0043] Calculate the overlap degree between the data in A and each part of the next adjacent contour . Taking as an example, if there is a part in the adjacent contour , and the overlap degree calculation shows that , then increment the occurrence times by 1, add ( ) to , and record the contour number and . At the same time, merge with , covering in A. If and is less than 8, then delete the data in A, calculate the overlap degree between and the data in set B. If , then increment the occurrence times , record the corresponding number of the contour. At the same time, merge the two parts of data, put them into set A, and delete the corresponding data in set B. If , and is less than 3, then delete the data in B, and put the into set B.
[0044] S6. Output the defect location information using the final statistical result of the defect, including finding the corresponding coordinate information in the original defect contour for defect location information output.
[0045] Complete the comparison of 2000 contour data in sequence, and count the number of the final part in set A, which is the number of all defects that appear in the current detection area. At the same time, in set C , , , represents the complete defect data index information corresponding to set A. According to the index information and the contour number information, find the corresponding coordinate information in it, and then the defect location information can be output.
[0046] The specific method is that for the data set of points on a single contour line is , i = 1, 2,..., 2000. The information of each point includes , where is the coordinate position index of the point, is the height information, , represent the position information on . For any defect , i = 1, 2, 3,..., k; i represents the defect number. By querying the stored complete defect data set C, find the set in C with the corresponding set number i . Traverse the set subset, where each subset contains the contour index and the start and end indexes of the defect area. Through the contour index, that is , combined with the start and end indexes of the defect area, find all the coordinate point indexes within the area, that is, the indexes corresponding to each point within the area . At the same time, according to find the corresponding , return , ) that is the position information of the point, and the corresponding , that is, the z-axis height information of the point, to find the defect location information on a contour. Traverse all subsets in the same in the above way, and return the corresponding defect positions , then the defect on 2000 contours All position point information. Similarly, the position point information of all defects on 2000 contours can be obtained.
[0047] Embodiment 2 The difference between this embodiment and Embodiment 1 is that this embodiment provides a steel pipe curved surface defect detection system based on three-dimensional data fitting, including: A data acquisition module, configured to: acquire three-dimensional contour data of a steel pipe and number the acquired three-dimensional contour data; A reference module, configured to: set a reference contour based on the acquired three-dimensional contour data, including obtaining a final reference contour fitting curve by using the weighted average distance minimization method; A comparison module, configured to: find the positions of defects on a single contour according to the reference contour fitting curve, including calculating contour correction data by using the reference contour and comparing the contour defect data according to the contour correction data; A defect module, configured to: count the number of identified positions of multi-contour defects by using the positions of single-contour defects, including calculating the same defect according to the set of initial defect points on a single contour; A statistics module, configured to: perform statistics on all contour data in the entire detection area to obtain the final statistical result of the defects; An output module, configured to: output defect position information by using the final statistical result of the defects, including finding the corresponding coordinate information in the original defect contour for outputting the defect position information.
[0048] A computer-readable storage medium, in which multiple instructions are stored, and the instructions are suitable for being loaded and executed by a processor of a terminal device to perform the described steel pipe curved surface defect detection method based on three-dimensional data fitting.
[0049] A terminal device, including a processor and a computer-readable storage medium, where the processor is used to implement each instruction; the computer-readable storage medium is used to store multiple instructions, and the instructions are suitable for being loaded and executed by the processor to perform the described steel pipe curved surface defect detection method based on three-dimensional data fitting.
[0050] The above are all preferred embodiments of the present invention. The protection scope of the present invention is not limited thereby. Therefore, all equivalent changes made according to the structure, shape, and principle of the present invention should be covered within the protection scope of the present invention.
Claims
1. A steel pipe surface defect detection method based on three-dimensional data fitting, characterized in that Including: Obtain the three-dimensional contour data of the steel pipe and number the obtained three-dimensional contour data; Set a reference contour based on the obtained three-dimensional contour data, including obtaining the final reference contour fitting curve by using the weighted average distance minimization method; Locate the single contour defect position according to the reference contour fitting curve, including calculating the contour correction data by using the reference contour and comparing the contour defect data according to the contour correction data; Use the single contour defect position to count the number of identified multi-contour defect positions, including calculating the same defect according to the set of single contour initial defect points; Statistically analyze all the contour data in the entire detection area to obtain the final statistical result of the defect; Output the defect position information by using the final statistical result of the defect, including searching for the corresponding coordinate information in the original defect contour to output the defect position information.
2. The method for detecting steel pipe surface defects based on three-dimensional data fitting according to claim 1, wherein, Numbering the acquired three-dimensional contour data includes setting that N contour lines are collected as a defect detection area, numbering each of the collected contour lines respectively, and defining the entire area formed by the N defect contours as , defining the data set of points on a single contour line. Among them, the information of each point in the data set includes the coordinate position index and the height information.
3. A steel pipe curved surface defect detection method based on three-dimensional data fitting according to claim 1, characterized in that, The step of obtaining the final reference contour fitting curve by using the weighted average distance minimization method includes collecting multiple three-dimensional contours without surface defects for data initialization, calculating the average of all points at each contour position to obtain the initial average contour line, introducing a distance-based weight function, calculating the weight of each point according to the distance from the point to the curve and the weight function, and obtaining the best-fitting contour points by weighted average. The weighted average is expressed as: , Among them, is the point to the current standard position curve vertical distance, expressed as a distance-based weight function, used to measure the distance relationship between a certain point and the currently estimated standard position curve, represents points at the same position on multiple contours.
4. A steel pipe curved surface defect detection method based on three-dimensional data fitting according to claim 3, characterized in that, The step of obtaining the final reference contour fitting curve by using the weighted average distance minimization method further includes defining a weight function to assign weights according to different best-fitting contour points, constructing a curve fitting error objective function by using the weight function, iteratively updating the objective function by using the gradient descent method to obtain a set of optimized control points, and obtaining the final reference contour fitting curve through a fitting equation. The fitting equation is expressed as: , Among them, is a non-uniform B-spline basis function, is the value of the optimized control point in the z direction, is the corresponding weight value, u is a parameterization variable used to define the position of points on the curve, and n is the total number of control points.
5. A method for detecting steel pipe surface defects based on three-dimensional data fitting according to claim 1, characterized in that The step of calculating the contour correction data by using the reference contour includes using dynamic programming to find the best matching path between the contour line to be corrected and the reference contour, calculating the initial translation vector according to the best matching path, aligning the reference contour and the contour to be detected by using the iterative closest point method, setting an adjustment threshold and adjusting the translation vector to update the contour position, and obtaining the contour correction data when the change is less than the adjustment threshold. The calculation formula for the initial translation vector is: , where k is the number of point pairs in the matching path, is the height value of the point in the reference contour, and is the height value of the point in the contour to be corrected.
6. The steel pipe curved surface defect detection method based on three-dimensional data fitting according to claim 1, characterized in that The comparison of profile defect data according to the profile correction data includes comparing the z-values at the corresponding coordinate positions of the profile correction data with the reference profile data, setting a height difference threshold, and taking the point indices and z-values with a comparison difference greater than the height difference threshold as the defect set. , introducing a local feature descriptor, setting a window and a step size to calculate the local features around each point, calculating the average slope of k points for each value in the region, and putting the indices and z-values of the points in the current two regions into the defect set when the product of the slopes in adjacent window regions is negative. , using and to determine the initial defect point set.
7. A steel pipe curved surface defect detection method based on three-dimensional data fitting according to claim 1, characterized in that, The step of calculating the same defect according to the set of single contour initial defect points includes dividing the set of initial defect points into several parts according to the continuity of the index and putting them into the segmentation set, obtaining partial segmentation sets for the same defect judgment, setting a coincidence threshold and calculating the coincidence degree, and performing the same defect judgment by using the coincidence degree and the coincidence threshold. The calculation formula for the coincidence degree is: , Among them, is represented as the overlapping region, and respectively represent the starting and ending index positions of the k-th consecutive part, and respectively represent the ending index position and the starting index position of the -th consecutive segmentation part from the set of initial defect points of the adjacent contour for calculating the overlapping degree with the k-th consecutive part.
8. A steel pipe surface defect detection system based on three-dimensional data fitting, which executes the method described in claim 1, characterized in that Including: A data acquisition module configured to: obtain the three-dimensional contour data of the steel pipe and number the obtained three-dimensional contour data; A reference module configured to: set a reference contour based on the obtained three-dimensional contour data, including obtaining the final reference contour fitting curve by using the weighted average distance minimization method; A comparison module configured to: locate the single contour defect position according to the reference contour fitting curve, including calculating the contour correction data by using the reference contour and comparing the contour defect data according to the contour correction data; The defect module is configured to: use the single-profile defect positions to count the number of recognized multi-profile defect positions, including performing the same defect calculation based on the set of single-profile initial defect points; The statistics module is configured to: perform statistics on all the profile data of the entire detection area to obtain the final statistical result of the defects; The output module is configured to: output the defect position information by using the final statistical result of the defects, including searching for the corresponding coordinate information in the original defect profile to output the defect position information.
9. A computer-readable storage medium storing multiple instructions, characterized in that, The instructions are adapted to be loaded and executed by a processor of a terminal device for a steel pipe surface defect detection method based on three-dimensional data fitting as claimed in claim 1.
10. A terminal device, comprising a processor and a computer-readable storage medium, where the processor is configured to implement each instruction; the computer-readable storage medium is configured to store multiple instructions, characterized in that, The instructions are adapted to be loaded and executed by a processor for a steel pipe surface defect detection method based on three-dimensional data fitting as claimed in claim 1.
Citation Information
Cited By
Multi-target detection system and method based on neural network
CN121169903A
Three-dimensional curved surface two-stage reconstruction measurement method, measurement system and processing and manufacturing system
CN121452958A