Multi-model cooperation-based industrial pipe material multi-parameter visual detection system and method
Patent Information
- Application Number
- CN202610702540.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-21
- Publication Date
- 2026-08-21
- Estimated Expiration
- 2046-05-21
AI Technical Summary
首先,采用传统方法检测时,其效率十分低下且自动化程度很低,很大程度上受制于操作工人的技能和责任意识,并且存在检验成本高,主观性强以及无法做到100%检出的问题,因此对提高生产节拍起到了巨大的制约
1、基于多重物理约束的智能拐点识别算法可从根本上保证物理特征提取合理,该发明重点突破了影响最大的特征提取部分,在传统拐点检测算法仅追求数学上的最优拟合基础上,创造性引入了斜率正负性约束、斜率比值约束、线段长度比例约束、平坦度要求等6重物理约束,上述约束非数学理论推导得出,而是根据行业标准并结合V型坡口钢管加工参数实际得到,可实现真正意义上的自动识别V型坡口斜边的拐点,并能区分开真实坡口拐点与由于噪声或者毛刺造成的一些假特征,从源头上保障后期所有计算的正确性以及具有实际工程意义,解决了纯数学方法在工业界“测不准”的问题。
Smart Images

Figure CN122237440B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of industrial big data technology, specifically to a multi-parameter visual inspection system and method for industrial pipes based on multi-model collaboration. Background Technology
[0002] In industries such as petroleum, chemical, and construction, steel pipes are a major basic component. The accuracy of their geometric dimensions and form and position tolerances directly affects the safety of the structure, the tightness of connections, and the service life. Traditional quality inspection methods rely on manual measurement using contact-type mechanical measuring tools or on measurement based on single-function automated testing equipment. However, these testing systems mostly have more or less defects or limitations in quality control and cannot meet the current industrial testing needs for more efficient, comprehensive, and accurate quality control. The following section elaborates on three main problems with current traditional testing methods: First, traditional testing methods are inefficient and have a low degree of automation. They are largely dependent on the skills and sense of responsibility of the operators, and also suffer from high inspection costs, strong subjectivity, and the inability to achieve 100% detection. Therefore, they greatly restrict the improvement of production cycle time.
[0003] Secondly, current technical testing methods are relatively limited, mostly measuring single parameters such as outer diameter, inner diameter, or bevel. Therefore, they cannot conduct comprehensive analysis and quality judgment of the macroscopic geometric dimensions and end face form and position tolerances of steel pipes, and thus cannot provide strong guidance for optimizing production processes.
[0004] Finally, due to the poor robustness of current feature recognition algorithms, they are prone to errors in measuring data containing noise, burrs, and anomalies in real industrial sites. They cannot reliably and accurately identify important features such as bevel inflection points, which in turn leads to errors in the calculation results of certain core parameters.
[0005] To overcome the above-mentioned technical drawbacks, this invention provides a multi-parameter visual inspection model and construction method for industrial pipes, forming a steel pipe parameter analysis and calculation system that integrates "data and model". Summary of the Invention
[0006] The purpose of this invention is to provide a multi-parameter visual inspection system and method for industrial pipes based on multi-model collaboration, so as to solve the problems raised in the prior art.
[0007] To achieve the above objectives, the present invention provides the following technical solution: A multi-parameter visual inspection method for industrial pipes based on multi-model collaboration, the method comprising the following steps: S100: A pair of line-scan laser sensors are used to simultaneously collect data from the outer surface and end face of the steel pipe and to verify the collected data. Furthermore, the specific steps for collecting data from the outer surface and end face of the steel pipe and verifying the collected data are as follows: S101. Mark a pair of line-scan laser sensors as sensor A and B respectively. Set the line laser direction of sensor A to be perpendicular to the end face of the steel pipe and coplanar with the central axis of the steel pipe, so that the bevel and blunt edge of the end face of the steel pipe are in the center of the sensor laser plane. Another sensor, B line laser, is positioned perpendicular to the outer surface of the steel pipe and coplanar with sensor A line laser, with the two not interfering with each other, so that the sensor laser plane is completely located at the position of the steel pipe generatrix. S102. Simultaneously and in the same direction, sensor A and sensor B rotate uniformly around the central axis of the steel pipe for one revolution according to the rotational angular velocity. One revolution is 360°. The time for the sensor to complete one revolution is taken as the sampling period. The operator sets the sampling period to Ts. The rotational angular velocity of the sensor is calculated using the sampling period as: ω=2π / Ts; ω represents the rotational angular velocity of the sensor. The data collected by sensors A and B respectively include the height data of the end face and outer surface of the steel pipe, the distance between the sensor and the central axis of the steel pipe, the scanning reference distance, and the corresponding angle of the measurement point. After data acquisition is completed, sensor A and sensor B output end face data and outer diameter data respectively. The outer diameter data represents the height data of the outer surface of the steel pipe, and the end face data represents the height data of the end face of the steel pipe. S103. Staff preset the data output file format and number of lines. After the data collection is completed, the data is verified to determine whether the file format and number of lines of the two data outputs from sensor A and sensor B meet the preset requirements. If they do not meet the preset requirements, the data preprocessing process is not performed.
[0008] S200. Preprocess the end face data and outer diameter data that meet the preset requirements. The preprocessing includes data conversion, data detection and data cleaning. Furthermore, the specific steps for preprocessing the outer diameter data are as follows: S201. The specific steps for converting the outer diameter data are as follows: convert the input outer diameter data into a NumPy array to unify the data format and facilitate subsequent data vectorization operations. At the same time, record the length of the outer diameter data before conversion for subsequent data checks. Use a Boolean mask to identify all non-empty and finite values in the outer diameter data as valid measurement points. This step is crucial because the data may contain invalid data due to the introduction of systematic and random errors.
[0009] The specific steps for data detection of outer diameter data are as follows: extract all valid measurement points and record the position index of the valid measurement points in the original array, where the original array represents the data group before data conversion; If the number of valid measurement points is less than the set value of 10, the original data is returned directly. This original data refers to the data before conversion, and the set value is preset by the staff. This conditional judgment ensures that subsequent outlier detection is only performed when the number of valid measurement points is sufficient. This design avoids unreliable results that may arise from statistical analysis on small samples. Z-score outlier detection is performed on the valid measurement points, calculating the standardized score for each valid measurement point. The Z-score formula is: ; In the formula, Z represents the standardized score of the valid measurement point, and X represents the original value of a single valid measurement point. The overall average value of the valid measurement points. The overall standard deviation of the valid measurement points is given; then the absolute value of the standardized score is taken to obtain the deviation of each valid measurement point; since the outer diameter of the steel pipe basically meets the production requirements, the outer diameter data conforms to the normal distribution. According to the 3σ criterion in the normal distribution, the measurement points with an absolute deviation greater than 3 are marked as outliers. The specific steps for cleaning the outer diameter data are as follows: remove all valid measurement points marked as outliers and update the corresponding location index; apply a moving average filter to the removed valid measurement points and reconstruct the data using a linear interpolation algorithm; remap the cleaned valid measurement points back to the original array structure according to the location index to maintain the spatial relationship of the data, ensuring a high standard for subsequent geometric analysis. The outer diameter data cleaning is then complete.
[0010] The specific steps for the end face data preprocessing are as follows: S202. The specific data conversion for the end face data is as follows: Each row of end face data is converted into a NumPy array. Then, a Boolean mask is created. The difference lies in the acquisition of the end face data. Because the linear laser sensor only focuses the center of the laser plane on the end face of the steel pipe, both ends of the laser plane are in the air. Therefore, the laser plane in the air will record invalid data, i.e., the value at infinity (-999.999), in the output document during scanning. Therefore, the Boolean mask creation for the end face data, in addition to identifying all non-empty and finite values in the outer diameter data, will also mark the remaining values that are not -999.999 as valid measurement points. The specific steps for data detection on the end face data are as follows: First, if there are fewer than 10 valid measurement points, the original data is returned directly. Then, the x and y coordinates of the valid measurement points are extracted row by row in the end face data group. The x coordinate is the index value of the height data in the end face data group multiplied by the scanning point interval, and the y coordinate is the height data value. This completes the conversion from a one-dimensional array to a two-dimensional Cartesian coordinate system.
[0011] Step 2: Use the outlier detection algorithm of this scheme to locate outliers in each end face profile data row by row. The outlier detection algorithm consists of Algorithm 1 and Algorithm 2, and the specific implementation process is as follows: Algorithm 1 is for global trend residual anomaly detection. Specifically, it involves: first, performing a polynomial fit on the x and y coordinates of each end-face data point using linear regression least squares and returning the fit coefficients; given the end-face measurement point set as {(x1, y1), (x2, y2), ..., (x... n y n )}, (x1, y1), (x2, y2),..., (x n y n () represents the set of measurement points 1, 2, ..., n, where linear regression yields the best-fit line: ; In the formula, a is the slope, b is the intercept, and y ^ Represents the y-value of the best-fit line; calculates the sum of squared residuals based on a univariate linear function. Substituting the formula for the best-fit line into the formula for the sum of squared residuals, we get: ; In the formula, y i Let y represent the y-value of the i-th point in the given set of end face measurement points. i ^ Let x represent the y-value of the i-th point in the best-fit line. i Let x represent the x-value of the i-th point in the given set of end face measurement points, where i ∈ [1, n]. According to the principle of least squares, the sum of squared residuals must have a minimum value. By taking the partial derivatives with respect to parameters a and b and setting them to zero, we can obtain the normal equation system: ; The solutions a and b of the normal system of equations are used as fitting parameters: ; After solving for the fitting parameters, the equation of the best-fit line is obtained, and the two-dimensional coordinates of all fitted measurement points on the best-fit line are obtained. The difference between the actual value and the fitted value is stored in the residual array. Then, a Boolean mask is created, and all measurement points whose residuals are within three times the standard deviation are identified as normal points according to the 3σ criterion. Algorithm 2 is a sliding window local anomaly detection, specifically: in the set of measurement points on the end face {(x1, y1), (x2, y2), ..., (x... n y n )}, by comparing the current measurement point (x) i y i The algorithm identifies anomalies based on the degree of deviation from adjacent measurement points; it first sets the local window size using the formula:
[0012] In the formula, len(x) represents the data length of the current measurement point, and W represents the local window size. The selection of the local window size parameter follows these principles: the minimum value is 3, ensuring at least 3 points within the window to meet the basic requirements of linear fitting; the maximum value is 7 or an adjustment value of 1 / 10 of the data length to avoid the window being too large and causing local features to be smoothed. According to Algorithm 1, global trend residual anomaly detection, the fitting coefficients can be obtained in the local window to obtain the local fitting line, and then the local absolute value and local standard deviation of the local fitting residual of the current measurement point can be calculated. The local anomaly judgment criteria are defined as the local standard deviation of the i-th measurement point being greater than 0 or the local fitting residual being greater than 2.5 times the local standard deviation. Algorithm 2 uses 2.5 times the standard deviation as the threshold, which is stricter than the global standard deviation of 3 times. The reasons are as follows: First, the local estimation has less degree of freedom and requires a stricter judgment standard. Second, the data within the local window are more correlated and outliers are easier to identify. Finally, 2.5 times the standard deviation corresponds to a confidence level of about 98.8%, which is a reasonable choice in local analysis.
[0013] The data cleaning process for the end face data involves using a combination of logical AND operators. Measurement points that pass both global trend residual anomaly detection and sliding window local anomaly detection are considered normal; otherwise, the data is marked as abnormal and removed. The fusion of the two algorithms, from global to local, improves the accuracy of detection.
[0014] S300: Calculate the outer radius of each measurement point using the preprocessed outer diameter data, the distance between the sensor and the steel pipe's central axis, and the scanning reference distance RD. Calculate the coordinate values of each outer diameter measurement point according to the Euclidean distance formula and the sine theorem, and output the outer diameter radius and outer diameter point set. Calculate the steel pipe wall thickness, and use the steel pipe wall thickness to calculate the inner radius, outputting the inner diameter coordinate point set. Construct a unified circle center fitting algorithm for inner and outer diameter circles, and use this algorithm to output the fitted circle center, fitted outer radius, and fitted inner radius. Furthermore, the specific steps for outputting the fitted circle center, fitted outer diameter, fitted inner diameter, and fitted wall thickness are as follows: S301. Input the outer diameter data after cleaning, the distance h between the sensor and the center axis of the steel pipe, the scanning reference distance RD, and the corresponding angle θ of the measurement point. i =360°×i / n; The outer radius is calculated as: distance h between the sensor and the central axis of the steel pipe - (scanning reference distance RD - outer diameter data). The center of the outer diameter measurement point set is taken as the origin, and the corresponding angle of each measurement point is used as the central angle. The coordinates C of each outer diameter measurement point are calculated using the Euclidean distance formula and the sine theorem. i Output the outer radius R of each outer diameter measurement point. i Outer diameter coordinate point set C outer ; S302. Input the number of effective measurement points on the end face (data_count) and the scanning point interval (PI). Because the light from the line-scan laser sensor A is perpendicular to the end face of the steel pipe, the data fed back by sensor A is a CSV document of end face height data. Each row of data in the document represents the height data of one section of the steel pipe end face. There is an interval between any two adjacent data in each row, and the interval is the scanning point interval (PI). Because the line-scan laser sensor rotates around the central axis of the steel pipe to scan, the data from the first row to the last row in the document constitutes the height dataset of all sections of the steel pipe end face. The method for calculating the wall thickness is the interval between the first and last acquisition points in the row of data. Because the point interval between each acquisition point is 25 micrometers, the interval between the first and last acquisition points is the number of effective measurement points - 1 multiplied by the scanning point interval (PI). Since the scanning point interval (PI) is in micrometers, the final result needs to be converted to millimeters, so it needs to be divided by 1000. The formula for calculating the wall thickness is T. i =(data_count-1)×PI / 1000; Calculate the inner radius r using the wall thickness i =R i -T i Construct the inner diameter coordinate C using the inner radius. i Output the set of inner diameter coordinate points C inter Since the length r of the i-th inner radius is known... i And the central angle θ at the i-th measuring inner diameter point i =360°×i / n. According to the relationship between the sides of a triangle and the angle, the x-coordinate of the i-th inner diameter measurement point is the cosine of the corresponding inner radius length multiplied by the corresponding central angle, and the y-coordinate of the i-th inner diameter measurement point is the sine of the corresponding inner radius length multiplied by the corresponding central angle.
[0015] S303. Group the inner and outer radii and wall thicknesses with the same central angle. Input the inner and outer radius and wall thickness parameter groups, and iterate through the maximum and minimum values of each parameter. Output the maximum and minimum outer diameters as Dmax and Dmin, the maximum and minimum inner diameters as dmax and dmin, and the maximum and minimum wall thicknesses as Tmax and Tmin and their corresponding coordinate points. S304. The algorithm for constructing a unified circle center fitting inner and outer diameter circle is as follows: Enter the outer diameter coordinates and click C. outer ={(x o1 y o1 ), (x o2 y o2 ), ..., (x on y on )} and the set of coordinate points of the inner diameter C inter ={(x j1 y j1 ), (x j2 y j2 ), ..., (x jn y jn )}, (x o1 y o1 ), (x o2 y o2 ), ..., (x on y on (x) represents the coordinates of the 1st, 2nd, ..., nth outer diameter points. j1 y j1 ), (x j2 y j2 ), ..., (x jn y jn () represents the coordinates of the 1st, 2nd, ..., nth inner diameter points; the outer and inner diameter circles have the same fitting center; according to the least squares principle, the residual reflects the deviation between the measured data and the fitting model, therefore the residual is used as a key indicator of fitting quality in the algorithm. Since the Euclidean distance from the measurement points on the inner and outer diameter circles to the fitting center can be calculated, the residual between the actual distance from the measurement points on the inner and outer diameter circles to the fitting center and the ideal radii of the inner and outer diameter circles can be expressed as: ; In the formula, ε oi and ε ji Let Q(x) represent the outer diameter circle residual and the inner diameter circle residual, respectively, and let Q(x) represent the fitted circle center coordinates. c y c ), d oi and d jiLet R and r represent the distances from the measurement points of the outer and inner diameter circles to the center of the fitted circle, respectively. Let R and r be the fitted outer and inner radii, respectively. Point (x...) oi y oi ) and (x ji y ji Let J represent any point on the outer and inner diameter circles, respectively. The objective of the algorithm for fitting the inner and outer diameter circles with a unified center is to minimize the sum of squares of all residuals. Therefore, the objective function J can be listed as: ; In the formula, the objective function J consists of two parts: the sum of squares of the outer diameter circle residuals. Sum of the squares of the inner diameter circles The algorithm for fitting inner and outer diameter circles with a unified center uses the sum of the two as the total residual error when calculating the return value, and this result needs to be optimized and solved using the L-BFGS-B quasi-Newton optimization algorithm. The quasi-Newton optimization algorithm is as follows: Based on the expression of the objective function J, it is easy to see that there are only four core parameters, namely x... c y c R and r; however, the amount of data involved in the computation is enormous, reaching tens of millions. Under the premise of limited memory and simple boundary constraints (R>0 and r>0), the L-BFGS-B algorithm is chosen. Compared to the standard BFGS algorithm, it does not require calculating and storing the Hessian matrix, which can lead to an excessively large Hessian matrix when there are many parameters. Instead, it approximates the Hessian matrix by storing the most recent m updates. Furthermore, it exhibits superlinear convergence, faster than gradient descent, and is easier to implement than the standard BFGS algorithm. The following is the implementation process of the algorithm, where the objective function is rewritten to facilitate gradient calculation, and the parameters are in matrix-vector form: ; For each of the four parameters x of the objective function c y c Taking the partial derivatives of R and r, we can obtain: ; The complete gradient vector can be obtained by rearranging the vector. : ; After obtaining the gradient vector, the optimal parameters are output. The L-BFGS-B quasi-Newton optimization algorithm iteratively updates the parameters based on the gradient and parameter change convergence criteria until the convergence condition is met, finally obtaining the optimal output result, which is the x-coordinate of the center of the circle fitted by the four parameters. c Fit the ordinate of the center of the circle y c , fit the outer radius R and the inner radius r.
[0016] S400: Reconstruct coordinates for the height data sequence. Input a single-line height sequence and sampling interval, and output a set of coordinate points on the steel pipe end face. Preprocess the end face coordinate point set using the standard deviation threshold principle, and fit the preprocessed end face coordinate point set using the Savitzky-Golay smoothing algorithm to output an optimized end face coordinate point set. Use the optimal inflection point search algorithm to output the optimal inflection point and linear regression model. Use the linear regression model to output the bevel angle, blunt edge width, and end face unevenness of the end face measurement points, and calculate the bevel angle and blunt edge width RF by iterating through all parameters. s End face unevenness V s And the extreme values of the end face bevel.
[0017] Furthermore, the set of coordinate points on the end face of the output steel pipe is specifically as follows: S401. During the end-face data reading and verification process, input the end-face height data CSV file and output the original end-face height sequence line by line. Reconstruct the coordinates of the height data sequence. Utilize the valid measurement points in the pre-processed end-face data, input the single-line height sequence and sampling interval. Because the light from the line-scan laser sensor A is perpendicular to the steel pipe end-face direction, the data fed back by the line-scan laser sensor A is a CSV document of end-face height direction data. Each line of data in the document represents the height data of one section of the steel pipe end face. There is an interval between any two adjacent data in each line, and the interval is the scanning point interval PI. Because the line-scan laser sensor rotates around the central axis of the steel pipe to scan, the data from the first line to the last line in the document constitutes the height dataset of all sections of the steel pipe end face. For the i-th line of the height sequence, convert the line height data into a NumPy array. After removing invalid data, the x-coordinate of each data point can be calculated by multiplying the array index value by the scanning point interval. Since the height data of each data point is its y-coordinate, the coordinate point set {(x-y)} of the single-line height sequence can be obtained. k y k )}, and so on, to obtain the set of end face coordinate points for all rows.
[0018] The standard deviation threshold principle is as follows: calculate the standard deviation and average value of the height data of all measurement points in the end face coordinate point set, set the standard deviation multiple threshold to L, and construct the normal range by using the average value + L × standard deviation = upper limit of the normal range and the average value - L × standard deviation = lower limit of the normal range; end face coordinate points outside the normal range are judged as outliers and removed. The S402 and Savitzky-Golay smoothing algorithms work as follows: For each end-face coordinate point, a polynomial is fitted using neighboring points within a window. The value of the fitted polynomial at each point is then used as the smoothed value for each data point. This smoothing algorithm effectively suppresses random noise while preserving the geometric characteristics of the original data. For the center point of the window, an nth-degree polynomial is used to fit the data within the window. ; In the formula, s is the position index within the window, ranging from -m to m, where m represents the half-width of the window. Setting the window center point to 0, the positive half-width is m, and the negative half-width is -m; y s Let a be the observation value of the s-th data point. n ε is the polynomial coefficient. s This is the error term; to ensure the window has a center point, the window size N is set to an odd number. Based on window symmetry, the window size can be set to N = 2m + 1. Given a window size of N, a system of (n + 1) linear equations can be formed: ; In the formula, the observation vector y -m This represents the y-coordinate of the point in the reverse direction (-m) within the window. -(m-1) This represents the y-coordinate of the point in the reverse direction (m-1) within the window. m Let y0 represent the ordinate of point m in the positive direction within the window, and y0 represent the ordinate of the center point of the window. The coefficient vector is... a0, a -(m-1) ... a s ... a n ε represents the coefficients of the reverse-m, reverse-(m-1), window center point, and forward-m point within the window. -m ε -(m-1) ε0, ε m Let these represent the error terms at the reverse -m, reverse -(m-1), window center point, and forward m point, respectively. The least squares solution to the linear equation system is a = (X... T X) - 1 X T y and X represent the design matrix, and the design matrix is: ; The smoothed center point value is Where h is the first row of the convolution kernel: h = (X T X) -1 X T In summary, the y-value data processed by the Savitzky-Golay smoothing algorithm effectively aided in the subsequent search for inflection points on the polyline.
[0019] S403. The optimal inflection point search algorithm is applicable to determining the location of a trend change when an inflection point occurs in a univariate sequence. The underlying assumption is that the linear models followed before and after the inflection point are different. Specifically, the optimal inflection point search algorithm obtains the optimal segmentation point by examining all possible segmentation points of the entire sequence and combining constraint optimization and model selection methods. The optimal inflection point search algorithm is as follows: First, it checks if the sample size is greater than 10. If it is less than 10, subsequent calculations are stopped to avoid overfitting caused by small samples. Then, the core grid search stage begins: using a boundary of 5 points before and 5 points after the boundary, samples between the boundaries are used as candidate split points. A grid search is performed among all candidate points to ensure sufficient degrees of freedom for piecewise regression. For each candidate point position index s, the algorithm divides the end-face coordinate point set into a first segment subsequence S1 = {(x...} k y k )|k=1,...,s1} and the subsequent subsequence S2={(x k y k )|k=1,...,s2}, and construct linear regression models for each; After constructing the linear regression model, the model parameter estimation stage begins. For the segmented model, the least squares method is used to solve for the linear coefficients of each segment according to Algorithm 1 of the outlier detection algorithm. To ensure the physical meaning of the inflection point discrimination method, the optimal inflection point search algorithm adds six structural constraints: ① The slope of the first segment subsequence must satisfy slope1>0 to ensure the initial assumption of an upward trend; ② The slope ratio |slope2 / slope1|>0.3, limiting the trend strength of the subsequent segment subsequence to within 30% of the previous segment; ③ The span constraint L1>0.8L2, where the span of the first segment L1=x s -x1, the span of the latter part L 2= x n -x s To prevent asymmetric segmentation; ④ The absolute slope of the latter segment |slope2|>0.2 ensures a gentle trend; ⑤ The sample size constraint |s1|≥5 and |s2|≥5 satisfies the basic statistical estimates; ⑥ The relative slope condition |slope2|<|slope1| ensures that the trend strength must strictly decrease from the former segment to the latter segment.
[0020] Candidate points that pass through structural constraints enter the optimality evaluation stage, which specifically involves constructing the objective function using a composite form: The first item The sum of squared residuals of the two linear regression models, with the second term being... The L1 regularization term for the slope of the latter segment is given by the hyperparameter λ, which is set to 0.1. In inflection point detection algorithms, the problem of selecting the optimal inflection point arises. Therefore, an objective function, Score(s), is introduced as a scoring criterion to measure the quality of inflection points on the curve. Since Score(s) is a composite function of fitting error and slope, theoretically, the smaller the fitting error and slope, the smaller the Score(s). The algorithm identifies the optimal inflection point by iterating through the curves to find the minimum score. If the objective function Score(s) only contains the first term... This could lead to a situation where the total error of the piecewise linear fitting is minimized. For example, if the steepest part of the two curves lies on the first curve, the algorithm might misclassify this part as the search region for the optimal inflection point because it only cares about minimizing the total fitting error, not the actual dividing point that causes the slope of the two lines to change. Therefore, the objective function containing only the first term is insufficient, hence the need to add a second term. As a penalty, the algorithm, while searching for the minimum Score(s), also favors terms that increase the slope of the second segment. Minimize the score (Score(s)) by using the smallest possible split points. Hyperparameters Its function is to balance the algorithm by selecting or favoring the optimal inflection point between the first and second curve segments. Empirical optimization shows that setting the parameter λ to 0.1 yields better results. In the objective function Score(s), the variable 's' physically represents a specific index position in the height data sequence; Score(s) represents the 's'-th data point. (First term) middle y k The measured value represents the altitude data. Indicates y k The difference between the corresponding model predictions and the two values represents the residual error.
[0021] This design achieves a balance between goodness of fit and trend smoothness, based on the theoretical assumption that the segment after the inflection point should simultaneously satisfy the linearity assumption and low volatility characteristics. The algorithm returns a complete set of parameters, including the segmentation index, regression coefficients, geometric features, and error metrics, providing sufficient evidence for subsequent statistical analysis.
[0022] The inputs are the slopes (slope1, slope2) and spans (L1, L2) of the linear regression models constructed from S1 and S2, respectively. The slope angle β of each row of data is calculated using the Euclidean distance formula and the trigonometric tangent theorem. s RF (blunt edge width) s End face unevenness V s In addition to the four parameters of end face chamfer, the extreme values of the three parameters are calculated by iterating through all parameters.
[0023] The bevel angle β of each row of data s The calculation is as follows: Extract the slopes slope1 and slope2 of the first and second fitted line segments from each row of height data. 2, Based on the relationship between slope and slope angle, the slope angle of the first segment = arctan(slope1), and the slope angle of the second segment = arctan(slope2). Taking the difference between the two and the absolute value yields the bevel angle of the profile, i.e., β. s =|arctan(slope1)-arctan(slope2)|.
[0024] The blunt edge width RF of each row of data s The calculation is as follows: Extract the lengths of the first and second fitted line segments from each row of height data. The length is calculated as the straight-line distance between the two endpoints of the line segment. Extract the coordinates of the two endpoints of the second fitted line segment and calculate its length using the distance formula between two points. Define the length of the second fitted line segment as the blunt edge width RF of the steel pipe profile. s .
[0025] The end face unevenness V of each row of data s The calculation is as follows: Compare the original data curves and fitted line segments of the first and second height data segments. Extract coordinate points with the same x-coordinate from both the original and fitted line segments. Subtract the y-coordinates of these points from each other, and find the maximum difference in y-coordinates, which represents the end face unevenness V. s .
[0026] The calculation of the end face chamfer is as follows: First, based on the number of measurement points n, assign a theoretical central angle θ to each measurement point. i =360°×i / n represents the equal division of the measurement points on the circumference of the steel pipe end face. Next, iterate through all point pairs, calculate the angle difference between the two points, and take the smallest included angle. If it is greater than 180 degrees, subtract 360 degrees. Only retain point pairs with an angle difference between 150 and 210 degrees, and find the one with the largest absolute value of the y-coordinate difference, denoted as max_y_diff. Finally, calculate the ratio of the maximum absolute value of the coordinate difference to the fitted outer diameter, i.e., the tangent α = arctan(max_y_diff / D_fitted), where D_fitted represents the fitted outer diameter. The arctangent is then converted to degrees to obtain the tangent α of the steel pipe. If no point pair meeting the conditions can be found or the maximum absolute value of the coordinate difference is zero, return 0 degrees.
[0027] S500 allows staff to preset the upper and lower limits of extreme parameters such as the fitting circle center, fitting outer radius, fitting inner radius, bevel angle, blunt edge width, and end face unevenness, perform over-limit detection, and output the judgment results and over-limit values of each parameter.
[0028] The over-limit detection specifically involves: staff setting upper and lower limits for extreme parameters of the fitting circle center, fitting outer radius, fitting inner radius, bevel angle, blunt edge width, end face unevenness, and end face chamfer. The optimal output result is compared with the preset upper and lower limits. If it is between the upper and lower limits, it is judged as normal; if it is outside the upper and lower limits, it is judged as over-limit. The judgment result of each parameter and the over-limit value are output. The over-limit value is the value exceeding the upper and lower limits of the tolerance.
[0029] The industrial pipe multi-parameter vision inspection system based on multi-model collaboration includes a data acquisition module, a preprocessing module, an outer diameter data analysis module, and an end face data analysis module. The data acquisition module is used to simultaneously acquire data from the outer surface and end face of the steel pipe using a pair of line-scan laser sensors and to verify the acquired data. The preprocessing module is used to preprocess the end face data and outer diameter data that meet the preset requirements. The preprocessing includes data conversion, data detection and data cleaning. The outer diameter data analysis module is used to calculate the outer radius of each measurement point using preprocessed outer diameter data, the distance between the sensor and the center axis of the steel pipe, and the scanning reference distance RD. It calculates the coordinate values of each outer diameter measurement point according to the Euclidean distance formula and the sine theorem, and outputs the outer diameter radius and the set of outer diameter points. It also calculates the steel pipe wall thickness, uses the steel pipe wall thickness to calculate the inner radius, and outputs the set of inner diameter coordinate points. Finally, it constructs a unified circle center fitting algorithm for inner and outer diameter circles, and uses this algorithm to output the fitted circle center, fitted outer radius, and fitted inner radius. The end-face data analysis module is used to reconstruct coordinates for height data sequences. It takes a single-line height sequence and sampling interval as input and outputs a set of coordinate points on the steel pipe end face. The end-face coordinate point set is preprocessed using the standard deviation threshold principle, and the Savitzky-Golay smoothing algorithm is used to fit the preprocessed end-face coordinate point set to output an optimized end-face coordinate point set. The optimal inflection point search algorithm is used to output the optimal inflection point and linear regression model. The linear regression model is used to output the bevel angle, blunt edge width, and end-face unevenness of the end-face measurement points. The extreme values of the bevel angle, blunt edge width, end-face unevenness, and end-face chamfer are calculated by traversing all parameters.
[0030] Compared with the prior art, the beneficial effects of the present invention are: 1. The intelligent inflection point recognition algorithm based on multiple physical constraints can fundamentally ensure the rationality of physical feature extraction. This invention focuses on the feature extraction part, which has the greatest impact. On the basis of the traditional inflection point detection algorithm, which only pursues the optimal mathematical fit, it creatively introduces six physical constraints, including slope positive and negative constraints, slope ratio constraints, line segment length ratio constraints, and flatness requirements. The above constraints are not derived from mathematical theory, but are obtained according to industry standards and combined with the actual processing parameters of V-bevel steel pipes. It can realize the true automatic recognition of the inflection point of the V-bevel slope and can distinguish the real bevel inflection point from some false features caused by noise or burrs. It ensures the correctness of all subsequent calculations from the source and has practical engineering significance, solving the problem of "inaccuracy" of pure mathematical methods in the industry.
[0031] 2. By employing a unified center-fitting algorithm for inner and outer diameter circles and a multi-standard data quality assessment system, a quantitative benchmark for geometric consistency and reliability is formed. After completing the basic feature extraction, this invention innovatively proposes a unified center-fitting inner and outer diameter circle model at the geometric model level. This ensures that the inner and outer diameter contours share a common center, specifies strict fitting standards, and fundamentally eliminates the problem of systematic errors in wall thickness and roundness parameters caused by different center points.
[0032] 3. An anti-interference method for accurately calculating spatial attitude based on an automatic diametrical point search algorithm. Addressing the crucial geometric tolerance of steel pipe end face diametrical measurement, this method abandons the approach of using a global plane fitting scheme, which is easily affected by the bevel slope. Instead, it employs a calculation method based on automatic diametrical point search and the principle of maximum elevation difference. This algorithm locates measurement points in a radial direction approximately 180° and calculates the inclination angle using the maximum elevation difference in the Y-coordinate. This transforms spatial attitude measurement into coordinate difference calculation, effectively eliminating the influence of the macroscopic structure of the bevel on end face attitude measurement. It exhibits strong anti-interference capability, good physical meaning, and high measurement reliability.
[0033] 4. A segmented benchmark unevenness evaluation method is proposed for bevel morphology, establishing a professional evaluation standard for end face quality and combining the results of precise inflection point discrimination. Unlike previous single benchmark evaluation methods, which only consider the quality of the bevel's inclined or blunt edge, this invention, while ensuring the correctness of the definition, uses a segmented fitting line to replace the benchmark surface. It calculates the local deviation of each measurement point relative to its fitting line, i.e., the unevenness on the entire end face, to distinguish between "macroscopic shape" and "microscopic defects." This achieves evaluation results that accurately reflect actual machining defects such as cutting vibration marks and burrs, rather than the bevel design shape, providing a new basis for process improvement.
[0034] 5. Full-process multi-parameter over-limit automated detection and early warning, enabling quality judgment of core parameters. By applying the aforementioned innovative calculation methods to the research work of this invention, an automatic over-limit detection and early warning system encompassing multiple important parameters has been established. This system can perform real-time detection of multiple important parameters in steel pipe processing, such as dimensional tolerances, shape tolerances, and positional tolerances, acquire corresponding data values, and output them. This reduces the manual inspection operation, which previously took tens of hours, to within minutes, achieving high-precision detection and efficient inspection of products. Attached Figure Description
[0035] Figure 1 This is a scatter plot of the inner and outer diameter circle measurement data of the multi-parameter visual inspection method for industrial pipes based on multi-model collaboration of the present invention. Figure 2 This is a fitting diagram of the inner and outer diameter circle measurement data of the multi-parameter visual inspection method for industrial pipes based on multi-model collaboration according to the present invention; Figure 3 This is the first set of random bevel blunt edge data fitting diagrams for the multi-parameter visual inspection method for industrial pipes based on multi-model collaboration of the present invention; Figure 4 This is the second set of random bevel blunt edge data fitting diagrams for the multi-parameter visual inspection method for industrial pipes based on multi-model collaboration of the present invention; Figure 5 This is the third set of random bevel blunt edge data fitting diagrams for the multi-parameter visual inspection method for industrial pipes based on multi-model collaboration in this invention; Figure 6 This is the fourth set of random bevel blunt edge data fitting diagram for the multi-parameter visual inspection method for industrial pipes based on multi-model collaboration of the present invention; Figure 7 This is the fifth set of random bevel blunt edge data fitting diagrams for the multi-parameter visual inspection method for industrial pipes based on multi-model collaboration of the present invention; Figure 8 This is the sixth set of random bevel blunt edge data fitting diagram for the multi-parameter visual inspection method for industrial pipes based on multi-model collaboration of the present invention; Figure 9 This is the seventh set of random bevel blunt edge data fitting diagram for the multi-parameter visual inspection method for industrial pipes based on multi-model collaboration of the present invention; Figure 10 This is the eighth set of random bevel blunt edge data fitting diagram for the multi-parameter visual inspection method for industrial pipes based on multi-model collaboration of the present invention; Figure 11 This is the ninth set of random bevel blunt edge data fitting diagram for the multi-parameter visual inspection method for industrial pipes based on multi-model collaboration of the present invention; Figure 12This is the fitting diagram of the tenth set of random bevel blunt edge data for the multi-parameter visual inspection method for industrial pipes based on multi-model collaboration of the present invention. Detailed Implementation
[0036] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0037] Example: Figures 1-2 As shown, the present invention provides a technical solution. This case study focuses on testing a seamless steel pipe with a V-bevel from a steel pipe factory. The pipe's parameters are: outer diameter OD = 114.33 mm, inner diameter ID = 104.26 mm, and wall thickness WT = 5.035 mm.
[0038] The basic input in the program is: CSV files containing end face measurement data and outer diameter measurement data; scanning point interval PI=25μm; scanning reference distance RD=245mm; distance between sensor and steel pipe center axis h=293.375mm; steel pipe outer diameter OD=114.33mm, steel pipe inner diameter ID=104.26mm, steel pipe wall thickness WT=5.035mm; A multi-parameter visual inspection method for industrial pipes based on multi-model collaboration, the method comprising the following steps: S100: A pair of line-scan laser sensors are used to simultaneously collect data from the outer surface and end face of the steel pipe and to verify the collected data. Furthermore, the specific steps for collecting data from the outer surface and end face of the steel pipe and verifying the collected data are as follows: S101. Mark a pair of line-scan laser sensors as sensor A and B respectively. Set the line laser direction of sensor A to be perpendicular to the end face of the steel pipe and coplanar with the central axis of the steel pipe, so that the bevel and blunt edge of the end face of the steel pipe are in the center of the sensor laser plane. Another sensor, B line laser, is positioned perpendicular to the outer surface of the steel pipe and coplanar with sensor A line laser, with the two not interfering with each other, so that the sensor laser plane is completely located at the position of the steel pipe generatrix. S102. Simultaneously and in the same direction, sensor A and sensor B rotate uniformly around the central axis of the steel pipe for one revolution according to the rotational angular velocity. One revolution is 360°. The time for the sensor to complete one revolution is taken as the sampling period. The operator sets the sampling period to Ts. The rotational angular velocity of the sensor is calculated using the sampling period as: ω=2π / Ts; ω represents the rotational angular velocity of the sensor. The data collected by sensors A and B respectively include the height data of the end face and outer surface of the steel pipe, the distance between the sensor and the central axis of the steel pipe, the scanning reference distance, and the corresponding angle of the measurement point. After data acquisition is completed, sensor A and sensor B output end face data and outer diameter data respectively. The outer diameter data represents the height data of the outer surface of the steel pipe, and the end face data represents the height data of the end face of the steel pipe. S103. Staff preset the data output file format and number of lines. After the data collection is completed, the data is verified to determine whether the file format and number of lines of the two data outputs from sensor A and sensor B meet the preset requirements. If they do not meet the preset requirements, the data preprocessing process is not performed.
[0039] S200. Preprocess the end face data and outer diameter data that meet the preset requirements. The preprocessing includes data conversion, data detection and data cleaning. Furthermore, the specific steps for preprocessing the outer diameter data are as follows: S201. The specific steps for converting the outer diameter data are as follows: convert the input outer diameter data into a NumPy array to unify the data format and facilitate subsequent data vectorization operations. At the same time, record the length of the outer diameter data before conversion for subsequent data checks. Use a Boolean mask to identify all non-empty and finite values in the outer diameter data as valid measurement points. This step is crucial because the data may contain invalid data due to the introduction of systematic and random errors.
[0040] The specific steps for data detection of outer diameter data are as follows: extract all valid measurement points and record the position index of the valid measurement points in the original array, where the original array represents the data group before data conversion; If the number of valid measurement points is less than the set value of 10, the original data is returned directly. This original data refers to the data before conversion, and the set value is preset by the staff. This conditional judgment ensures that subsequent outlier detection is only performed when the number of valid measurement points is sufficient. This design avoids unreliable results that may arise from statistical analysis on small samples. Z-score outlier detection is performed on the valid measurement points, calculating the standardized score for each valid measurement point. The Z-score formula is: ; In the formula, Z represents the standardized score of the valid measurement point, and X represents the original value of a single valid measurement point. The overall average value of the valid measurement points. The overall standard deviation of the valid measurement points is given; then the absolute value of the standardized score is taken to obtain the deviation of each valid measurement point; since the outer diameter of the steel pipe basically meets the production requirements, the outer diameter data conforms to the normal distribution. According to the 3σ criterion in the normal distribution, the measurement points with an absolute deviation greater than 3 are marked as outliers. The specific steps for cleaning the outer diameter data are as follows: remove all valid measurement points marked as outliers and update the corresponding location index; apply a moving average filter to the removed valid measurement points and reconstruct the data using a linear interpolation algorithm; remap the cleaned valid measurement points back to the original array structure according to the location index to maintain the spatial relationship of the data, ensuring a high standard for subsequent geometric analysis. The outer diameter data cleaning is then complete.
[0041] The specific steps for the end face data preprocessing are as follows: S202. The specific data conversion for the end face data is as follows: Each row of end face data is converted into a NumPy array. Then, a Boolean mask is created. The difference lies in the acquisition of the end face data. Because the linear laser sensor only focuses the center of the laser plane on the end face of the steel pipe, both ends of the laser plane are in the air. Therefore, the laser plane in the air will record invalid data, i.e., the value at infinity (-999.999), in the output document during scanning. Therefore, the Boolean mask creation for the end face data, in addition to identifying all non-empty and finite values in the outer diameter data, will also mark the remaining values that are not -999.999 as valid measurement points. The specific steps for data detection on the end face data are as follows: First, if there are fewer than 10 valid measurement points, the original data is returned directly. Then, the x and y coordinates of the valid measurement points are extracted row by row in the end face data group. The x coordinate is the index value of the height data in the end face data group multiplied by the scanning point interval, and the y coordinate is the height data value. This completes the conversion from a one-dimensional array to a two-dimensional Cartesian coordinate system.
[0042] Step 2: Use the outlier detection algorithm of this scheme to locate outliers in each end face profile data row by row. The outlier detection algorithm consists of Algorithm 1 and Algorithm 2, and the specific implementation process is as follows: Algorithm 1 is for global trend residual anomaly detection. Specifically, it involves: first, performing a polynomial fit on the x and y coordinates of each end-face data point using linear regression least squares and returning the fit coefficients; given the end-face measurement point set as {(x1, y1), (x2, y2), ..., (x... n y n )}, (x1, y1), (x2, y2),..., (x n y n () represents the set of measurement points 1, 2, ..., n, where linear regression yields the best-fit line: ; In the formula, a is the slope, b is the intercept, and y ^ Represents the y-value of the best-fit line; calculates the sum of squared residuals based on a univariate linear function. Substituting the formula for the best-fit line into the formula for the sum of squared residuals, we get: ; In the formula, y i Let y represent the y-value of the i-th point in the given set of end face measurement points. i ^ Let x represent the y-value of the i-th point in the best-fit line. i Let x represent the x-value of the i-th point in the given set of end face measurement points, where i ∈ [1, n]. According to the principle of least squares, the sum of squared residuals must have a minimum value. By taking the partial derivatives with respect to parameters a and b and setting them to zero, we can obtain the normal equation system: ; The solutions a and b of the normal system of equations are used as fitting parameters: ; After solving for the fitting parameters, the equation of the best-fit line is obtained, and the two-dimensional coordinates of all fitted measurement points on the best-fit line are obtained. The difference between the actual value and the fitted value is stored in the residual array. Then, a Boolean mask is created, and all measurement points whose residuals are within three times the standard deviation are identified as normal points according to the 3σ criterion. Algorithm 2 is a sliding window local anomaly detection, specifically: in the set of measurement points on the end face {(x1, y1), (x2, y2), ..., (x... n y n )}, by comparing the current measurement point (x) i y i The algorithm identifies anomalies based on the degree of deviation from adjacent measurement points; it first sets the local window size using the formula: ; In the formula, len(x) represents the data length of the current measurement point, and W represents the local window size. The selection of the local window size parameter follows these principles: the minimum value is 3, ensuring at least 3 points within the window to meet the basic requirements of linear fitting; the maximum value is 7 or an adjustment value of 1 / 10 of the data length to avoid the window being too large and causing local features to be smoothed. According to Algorithm 1, global trend residual anomaly detection, the fitting coefficients can be obtained in the local window to obtain the local fitting line, and then the local absolute value and local standard deviation of the local fitting residual of the current measurement point can be calculated. The local anomaly judgment criteria are defined as the local standard deviation of the i-th measurement point being greater than 0 or the local fitting residual being greater than 2.5 times the local standard deviation. Algorithm 2 uses 2.5 times the standard deviation as the threshold, which is stricter than the global standard deviation of 3 times. The reasons are as follows: First, the local estimation has less degree of freedom and requires a stricter judgment standard. Second, the data within the local window are more correlated and outliers are easier to identify. Finally, 2.5 times the standard deviation corresponds to a confidence level of about 98.8%, which is a reasonable choice in local analysis.
[0043] The data cleaning process for the end face data involves using a combination of logical AND operators. Measurement points that pass both global trend residual anomaly detection and sliding window local anomaly detection are considered normal; otherwise, the data is marked as abnormal and removed. The fusion of the two algorithms, from global to local, improves the accuracy of detection.
[0044] S300: Calculate the outer radius of each measurement point using the preprocessed outer diameter data, the distance between the sensor and the steel pipe's central axis, and the scanning reference distance RD. Calculate the coordinate values of each outer diameter measurement point according to the Euclidean distance formula and the sine theorem, and output the outer diameter radius and outer diameter point set. Calculate the steel pipe wall thickness, and use the steel pipe wall thickness to calculate the inner radius, outputting the inner diameter coordinate point set. Construct a unified circle center fitting algorithm for inner and outer diameter circles, and use this algorithm to output the fitted circle center, fitted outer radius, and fitted inner radius. Furthermore, the specific steps for outputting the fitted circle center, fitted outer diameter, fitted inner diameter, and fitted wall thickness are as follows: S301. Input the outer diameter data after cleaning, the distance h between the sensor and the central axis of the steel pipe, the scanning reference distance RD, and the corresponding angle θ of the measurement point. i =360°×i / n; The outer radius is calculated as: distance h between the sensor and the central axis of the steel pipe - (scanning reference distance RD - outer diameter data). The center of the outer diameter measurement point set is taken as the origin, and the corresponding angle of each measurement point is used as the central angle. The coordinates C of each outer diameter measurement point are calculated using the Euclidean distance formula and the sine theorem. i Output the outer radius R of each outer diameter measurement point. i Outer diameter coordinate point set C outer ; S302. Input the number of effective measurement points on the end face (data_count) and the scanning point interval (PI). Because the light from the line-scan laser sensor A is perpendicular to the end face of the steel pipe, the data fed back by sensor A is a CSV document of end face height data. Each row of data in the document represents the height data of one section of the steel pipe end face. There is an interval between any two adjacent data in each row, and the interval is the scanning point interval (PI). Because the line-scan laser sensor rotates around the central axis of the steel pipe to scan, the data from the first row to the last row in the document constitutes the height dataset of all sections of the steel pipe end face. The method for calculating the wall thickness is the interval between the first and last acquisition points in the row of data. Because the point interval between each acquisition point is 25 micrometers, the interval between the first and last acquisition points is the number of effective measurement points - 1 multiplied by the scanning point interval (PI). Since the scanning point interval (PI) is in micrometers, the final result needs to be converted to millimeters, so it needs to be divided by 1000. The formula for calculating the wall thickness is T. i =(data_count-1)×PI / 1000; Calculate the inner radius r using the wall thickness i =R i -T i Construct the inner diameter coordinate C using the inner radius. i Output the set of inner diameter coordinate points C inter Since the length r of the i-th inner radius is known... i And the central angle θ at the i-th inner diameter measurement point i =360°×i / n. According to the relationship between the sides of a triangle and the angle, the x-coordinate of the i-th inner diameter measurement point is the cosine of the corresponding inner radius length multiplied by the corresponding central angle, and the y-coordinate of the i-th inner diameter measurement point is the sine of the corresponding inner radius length multiplied by the corresponding central angle.
[0045] S303. Group the inner and outer radii and wall thicknesses with the same central angle. Input the inner and outer radius and wall thickness parameter groups, and iterate through the maximum and minimum values of each parameter. Output the maximum and minimum outer diameters as Dmax and Dmin, the maximum and minimum inner diameters as dmax and dmin, and the maximum and minimum wall thicknesses as Tmax and Tmin and their corresponding coordinate points. Example 1: Inner and outer radii and wall thicknesses with the same central angle are grouped together. Input the inner and outer radius and wall thickness parameter groups, and iterate through the maximum and minimum values of each parameter. Output the maximum outer diameter Dmax = 112.267523 mm, the minimum outer diameter Dmin = 112.215263 mm, the maximum inner diameter dmax = 100.864986 mm, the minimum inner diameter dmin = 100.624611 mm, the maximum wall thickness Tmax = 5.825000 mm, the minimum wall thickness Tmin = 5.650000 mm, and their corresponding endpoint coordinates. Coordinates of the endpoint of the maximum outer diameter measurement: A1:(-56.006236,3.523614), A2:(56.039753,-3.525722) Coordinates of the endpoint for measuring the minimum outer diameter: B1:(56.096830,0.000000), B2:(-56.118433, 0.000000) Coordinates of the endpoint of the maximum inner diameter measurement: C1:(-6.323352,50.054483), C2:(6.318383,-50.015153) Coordinates of the endpoint of the minimum inner diameter measurement: D1:(38.735085,32.044449), D2:(-38.797510,-32.096092) Coordinates of the endpoint of the measured maximum wall thickness: E1:(38.401393, 40.893330), E2:(34.413906,36.647088) Coordinates of the endpoint for measuring the minimum wall thickness: F1:(-54.349972,13.954701), F2:(-48.877477,12.549603); S304. The algorithm for constructing a unified circle center fitting inner and outer diameter circle is as follows: Enter the outer diameter coordinates and click C. outer ={(x o1 y o1 ), (x o2 y o2 ), ..., (x on y on )} and the set of coordinate points of the inner diameter C inter ={(x j1 y j1 ), (x j2 y j2 ), ..., (x jn y jn )}, (x o1 y o1 ), (x o2 y o2 ), ..., (x on y on (x) represents the coordinates of the 1st, 2nd, ..., nth outer diameter points. j1 y j1 ), (x j2 yj2 ), ..., (x jn y jn () represents the coordinates of the 1st, 2nd, ..., nth inner diameter points; the outer and inner diameter circles have the same fitting center; according to the least squares principle, the residual reflects the deviation between the measured data and the fitting model, therefore the residual is used as a key indicator of fitting quality in the algorithm. Since the Euclidean distance from the measurement points on the inner and outer diameter circles to the fitting center can be calculated, the residual between the actual distance from the measurement points on the inner and outer diameter circles to the fitting center and the ideal radii of the inner and outer diameter circles can be expressed as: ; In the formula, ε oi and ε ji Let Q(x) represent the outer diameter circle residual and the inner diameter circle residual, respectively, and let Q(x) represent the fitted circle center coordinates. c y c ), d oi and d ji Let R and r represent the distances from the measurement points of the outer and inner diameter circles to the center of the fitted circle, respectively. Let R and r be the fitted outer and inner radii, respectively. Point (x...) oi y oi ) and (x ji y ji Let J represent any point on the outer and inner diameter circles, respectively. The objective of the algorithm for fitting the inner and outer diameter circles with a unified center is to minimize the sum of squares of all residuals. Therefore, the objective function J can be listed as: ; In the formula, the objective function J consists of two parts: the sum of squares of the outer diameter circle residuals. Sum of the squares of the inner diameter circles The algorithm for fitting inner and outer diameter circles with a unified center uses the sum of the two as the total residual error when calculating the return value, and this result needs to be optimized and solved using the L-BFGS-B quasi-Newton optimization algorithm. The quasi-Newton optimization algorithm is as follows: Based on the expression of the objective function J, it is easy to see that there are only four core parameters, namely x... c y cR and r; however, the amount of data involved in the computation is enormous, reaching tens of millions. Under the premise of limited memory and simple boundary constraints (R>0 and r>0), the L-BFGS-B algorithm is chosen. Compared to the standard BFGS algorithm, it does not require calculating and storing the Hessian matrix, which can lead to an excessively large Hessian matrix when there are many parameters. Instead, it approximates the Hessian matrix by storing the most recent m updates. Furthermore, it exhibits superlinear convergence, faster than gradient descent, and is easier to implement than the standard BFGS algorithm. The following is the implementation process of the algorithm, where the objective function is rewritten to facilitate gradient calculation, and the parameters are in matrix-vector form: ; For each of the four parameters x of the objective function c y c Taking the partial derivatives of R and r, we can obtain: ; The complete gradient vector can be obtained by rearranging the vector. : ; After obtaining the gradient vector, the optimal parameters are output. The L-BFGS-B quasi-Newton optimization algorithm iteratively updates the parameters based on the gradient and parameter change convergence criteria until the convergence condition is met, finally obtaining the optimal output result, which is the x-coordinate of the center of the circle fitted by the four parameters. c Fit the ordinate of the center of the circle y c , fit the outer radius R and the inner radius r.
[0046] Example 2: The center coordinates of the fitted circle are Q(-0.013441, -0.018994), the fitted outer diameter D_fitted=2×fitted outer radius R=112.239414 mm, and the fitted inner diameter d_fitted=2×fitted inner radius r=100.744415 mm.
[0047] S400: Reconstruct coordinates for the height data sequence. Input a single-line height sequence and sampling interval, and output a set of coordinate points on the steel pipe end face. Preprocess the end face coordinate point set using the standard deviation threshold principle, and fit the preprocessed end face coordinate point set using the Savitzky-Golay smoothing algorithm to output an optimized end face coordinate point set. Use the best inflection point search algorithm to output the best inflection point and linear regression model. Use the linear regression model to output the bevel angle, blunt edge width, and end face unevenness of the end face measurement points, and calculate the extreme values of bevel angle, blunt edge width, end face unevenness, and end face chamfer by traversing all parameters.
[0048] Furthermore, the set of coordinate points on the end face of the output steel pipe is specifically as follows: S401. During the end-face data reading and verification process, input the end-face height data CSV file and output the original end-face height sequence line by line. Reconstruct the coordinates of the height data sequence. Utilize the valid measurement points in the pre-processed end-face data, input the single-line height sequence and sampling interval. Because the light from the line-scan laser sensor A is perpendicular to the steel pipe end-face direction, the data fed back by the line-scan laser sensor A is a CSV document of end-face height direction data. Each line of data in the document represents the height data of one section of the steel pipe end face. There is an interval between any two adjacent data in each line, and the interval is the scanning point interval PI. Because the line-scan laser sensor rotates around the central axis of the steel pipe to scan, the data from the first line to the last line in the document constitutes the height dataset of all sections of the steel pipe end face. For the i-th line of the height sequence, convert the line height data into a NumPy array. After removing invalid data, the x-coordinate of each data point can be calculated by multiplying the array index value by the scanning point interval. Since the height data of each data point is its y-coordinate, the coordinate point set {(x-y)} of the single-line height sequence can be obtained. k y k )}, and so on, to obtain the set of end face coordinate points for all rows.
[0049] The standard deviation threshold principle is as follows: calculate the standard deviation and average value of the height data of all measurement points in the end face coordinate point set, set the standard deviation multiple threshold to L, and construct the normal range by using the average value + L × standard deviation = upper limit of the normal range and the average value - L × standard deviation = lower limit of the normal range; end face coordinate points outside the normal range are judged as outliers and removed. The S402 and Savitzky-Golay smoothing algorithms work as follows: For each end-face coordinate point, a polynomial is fitted using neighboring points within a window. The value of the fitted polynomial at each point is then used as the smoothed value for each data point. This smoothing algorithm effectively suppresses random noise while preserving the geometric characteristics of the original data. For the center point of the window, an nth-degree polynomial is used to fit the data within the window. ; In the formula, s is the position index within the window, ranging from -m to m, where m represents the half-width of the window. Setting the window center point to 0, the positive half-width is m, and the negative half-width is -m; y s Let a be the observation value of the s-th data point. n ε is the polynomial coefficient. s This is the error term; to ensure the window has a center point, the window size N is set to an odd number. Based on window symmetry, the window size can be set to N = 2m + 1. Given a window size of N, a system of (n + 1) linear equations can be formed: ; In the formula, the observation vector y -m This represents the y-coordinate of the point in the reverse direction (-m) within the window. -(m-1) This represents the y-coordinate of the point in the reverse direction (m-1) within the window. m Let y0 represent the ordinate of point m in the positive direction within the window, and y0 represent the ordinate of the center point of the window. The coefficient vector is... a0, a -(m-1) ... a s ... a n ε represents the coefficients of the reverse-m, reverse-(m-1), window center point, and forward-m point within the window. -m ε -(m-1) ε0, ε m Let these represent the error terms at the reverse -m, reverse -(m-1), window center point, and forward m point, respectively. The least squares solution to the linear equation system is a = (X... T X) - 1 X T y and X represent the design matrix, and the design matrix is: ; The smoothed center point value is Where h is the first row of the convolution kernel: h = (X T X) -1 X T In summary, the y-value data processed by the Savitzky-Golay smoothing algorithm effectively aided in the subsequent search for inflection points on the polyline.
[0050] S403. The optimal inflection point search algorithm is applicable to determining the location of a trend change when an inflection point occurs in a univariate sequence. The underlying assumption is that the linear models followed before and after the inflection point are different. Specifically, the optimal inflection point search algorithm obtains the optimal segmentation point by examining all possible segmentation points of the entire sequence and combining constraint optimization and model selection methods. The optimal inflection point search algorithm is as follows: First, it checks if the sample size is greater than 10. If it is less than 10, subsequent calculations are stopped to avoid overfitting caused by small samples. Then, the core grid search stage begins: using a boundary of 5 points before and 5 points after the boundary, samples between the boundaries are used as candidate split points. A grid search is performed among all candidate points to ensure sufficient degrees of freedom for piecewise regression. For each candidate point position index s, the algorithm divides the end-face coordinate point set into a first segment subsequence S1 = {(x...} k y k )|k=1,...,s1} and the subsequent subsequence S2={(x k y k )|k=1,...,s2}, and construct linear regression models for each; After constructing the linear regression model, the model parameter estimation stage begins. For the segmented model, the least squares method is used to solve for the linear coefficients of each segment according to Algorithm 1 of the outlier detection algorithm. To ensure the physical meaning of the inflection point discrimination method, the optimal inflection point search algorithm adds six structural constraints: ① The slope of the first segment subsequence must satisfy slope1>0 to ensure the initial assumption of an upward trend; ② The slope ratio |slope2 / slope1|>0.3, limiting the trend strength of the subsequent segment subsequence to within 30% of the previous segment; ③ The span constraint L1>0.8L2, where the span of the first segment L1=x s -x1, the span of the latter part L 2= x n -x s To prevent asymmetric segmentation; ④ The absolute slope of the latter segment |slope2|>0.2 ensures a gentle trend; ⑤ The sample size constraint |s1|≥5 and |s2|≥5 satisfies the basic statistical estimates; ⑥ The relative slope condition |slope2|<|slope1| ensures that the trend strength must strictly decrease from the former segment to the latter segment.
[0051] Candidate points that pass through structural constraints enter the optimality evaluation stage, which specifically involves constructing the objective function using a composite form: The first item The sum of squared residuals of the two linear regression models, with the second term being... The L1 regularization term for the slope of the latter segment is given by the hyperparameter λ, which is set to 0.1. In inflection point detection algorithms, the problem of selecting the optimal inflection point arises. Therefore, an objective function, Score(s), is introduced as a scoring criterion to measure the quality of inflection points on the curve. Since Score(s) is a composite function of fitting error and slope, theoretically, the smaller the fitting error and slope, the smaller the Score(s). The algorithm identifies the optimal inflection point by iterating through the curves to find the minimum score. If the objective function Score(s) only contains the first term... This could lead to a situation where the total error of the piecewise linear fitting is minimized. For example, if the steepest part of the two curves lies on the first curve, the algorithm might misclassify this part as the search region for the optimal inflection point because it only cares about minimizing the total fitting error, not the actual dividing point that causes the slope of the two lines to change. Therefore, the objective function containing only the first term is insufficient, hence the need to add a second term. As a penalty, the algorithm, while searching for the minimum Score(s), also favors terms that increase the slope of the second segment. Minimize the score (Score(s)) by using the smallest possible split points. Hyperparameters Its function is to balance the algorithm by selecting or favoring the optimal inflection point between the first and second curve segments. Empirical optimization shows that setting the parameter λ to 0.1 yields better results. In the objective function Score(s), the variable 's' physically represents a specific index position in the height data sequence; Score(s) represents the 's'-th data point. (First term) middle y k The measured value represents the altitude data. Indicates y k The difference between the corresponding model predictions and the two values represents the residual error.
[0052] This design achieves a balance between goodness of fit and trend smoothness, based on the theoretical assumption that the segment after the inflection point should simultaneously satisfy the linearity assumption and low volatility characteristics. The algorithm returns a complete set of parameters, including the segmentation index, regression coefficients, geometric features, and error metrics, providing sufficient evidence for subsequent statistical analysis.
[0053] The inputs are the slopes (slope1, slope2) and spans (L1, L2) of the linear regression models constructed from S1 and S2, respectively. The slope angle β of each row of data is calculated using the Euclidean distance formula and the trigonometric tangent theorem. s RF (blunt edge width) s End face unevenness V s In addition to the four parameters of end face chamfer, the extreme values of the three parameters are calculated by iterating through all parameters.
[0054] The bevel angle β of each row of data s The calculation is as follows: Extract the slopes slope1 and slope2 of the first and second fitted line segments from each row of height data. 2, Based on the relationship between slope and slope angle, the slope angle of the first segment = arctan(slope1), and the slope angle of the second segment = arctan(slope2). Taking the difference between the two and the absolute value yields the bevel angle of the profile, i.e., β. s =|arctan(slope1)-arctan(slope2)|. By iterating through and converting to angles, we can obtain the maximum slope angle = 29.876744 degrees and the minimum slope angle = 21.321374 degrees.
[0055] The blunt edge width RF of each row of data s The calculation is as follows: Extract the lengths of the first and second fitted line segments from each row of height data. The length is calculated as the straight-line distance between the two endpoints of the line segment. Extract the coordinates of the two endpoints of the second fitted line segment and calculate its length using the distance formula between two points. Define the length of the second fitted line segment as the blunt edge width RF of the steel pipe profile. s By traversing the data, we can obtain the maximum blunt edge width as 0.925000 mm and the minimum blunt edge width as 0.425000 mm.
[0056] The end face unevenness V of each row of data s The calculation is as follows: Compare the original data curves and fitted line segments of the first and second height data segments. Extract coordinate points with the same x-coordinate from both the original and fitted line segments. Subtract the y-coordinates of these points from each other, and find the maximum difference in y-coordinates, which represents the end face unevenness V. s By traversing the data, we can obtain the maximum value of the end face unevenness as 0.351573 mm and the minimum value as 0.075365 mm.
[0057] The calculation of the end face chamfer is as follows: First, based on the number of measurement points n and the total number of measurement rows m, assign a theoretical central angle θ to each measurement point. i =360°×i / n, representing the equal division of the measurement points on the circumference of the steel pipe end face. Next, iterate through all point pairs, calculate the angle difference between the two points, and take the smallest included angle. If it is greater than 180 degrees, subtract 360 degrees. Only retain point pairs with an angle difference between 150 and 210 degrees, and find the one with the largest absolute value of the y-coordinate difference, denoted as max_y_diff. Finally, calculate the ratio of the absolute value of the maximum coordinate difference to the fitted outer diameter, i.e., the tangent α = arctan(max_y_diff / D_fitted), where D_fitted represents the fitted outer diameter. The arctangent is then used to convert it to degrees, resulting in the tangent α = 0.341921 degrees for the steel pipe. If no matching point pair is found or the absolute value of the maximum coordinate difference is zero, return 0 degrees.
[0058] S500 allows staff to preset the upper and lower limits of the extreme parameters tolerance for the fitting circle center, fitting outer radius, fitting inner radius, bevel angle, blunt edge width, and end face unevenness, perform over-limit detection, and output the judgment results and over-limit values for each parameter.
[0059] The over-limit detection specifically involves: staff preset the upper and lower limits of the extreme parameters tolerance for the fitted circle center, fitted outer radius, fitted inner radius, bevel angle, blunt edge width, and end face unevenness; input the optimal output result and compare it with the preset upper and lower limits tolerance; if it is between the upper and lower limits tolerance, it is judged as normal; if it is outside the upper and lower limits tolerance, it is judged as over-limit; output the judgment result of each parameter and the over-limit value, where the over-limit value is the value exceeding the upper and lower limits tolerance.
[0060] Finally, the program allows input of upper and lower limits or tolerances for outer diameter, inner diameter, wall thickness, roundness, ellipticity, end face unevenness, blunt edge width, bevel angle, and chamfer, which are used to automatically determine whether the limits are exceeded.
[0061] For example, in this case implementation, the tolerance values for each physical quantity are set according to the following parameters: steel pipe end face unevenness threshold 0.5 mm; outer diameter upper limit 115.0 mm; outer diameter lower limit 110.0 mm; inner diameter upper limit 105.0 mm; inner diameter lower limit 100.0 mm; steel pipe roundness tolerance 0.1 mm; steel pipe ellipticity tolerance 0.2 mm; steel pipe wall thickness upper limit 6.0 mm; steel pipe wall thickness lower limit 4.5 mm; steel pipe end face unevenness tolerance 0.3 mm; blunt edge width upper limit 1.2 mm; blunt edge width lower limit 0.3 mm; bevel angle upper limit 35.0 degrees; bevel angle lower limit 20.0 degrees; cut bevel tolerance 1.0 degree.
[0062] In the statistics of the results of exceeding the limit, the unevenness of the steel pipe end face exceeded the limit by 0.051573 mm, while other physical quantities were within the tolerance range.
[0063] The industrial pipe multi-parameter vision inspection system based on multi-model collaboration includes a data acquisition module, a preprocessing module, an outer diameter data analysis module, and an end face data analysis module. The data acquisition module is used to simultaneously acquire data from the outer surface and end face of the steel pipe using a pair of line-scan laser sensors and to verify the acquired data. The preprocessing module is used to preprocess the end face data and outer diameter data that meet the preset requirements. The preprocessing includes data conversion, data detection and data cleaning. The outer diameter data analysis module is used to calculate the outer radius of each measurement point using preprocessed outer diameter data, the distance between the sensor and the center axis of the steel pipe, and the scanning reference distance RD. It calculates the coordinate values of each outer diameter measurement point according to the Euclidean distance formula and the sine theorem, and outputs the outer diameter radius and the set of outer diameter points. It also calculates the steel pipe wall thickness, uses the steel pipe wall thickness to calculate the inner radius, and outputs the set of inner diameter coordinate points. Finally, it constructs a unified circle center fitting algorithm for inner and outer diameter circles, and uses this algorithm to output the fitted circle center, fitted outer radius, and fitted inner radius. The end-face data analysis module is used to reconstruct coordinates for height data sequences. It takes a single-line height sequence and sampling interval as input and outputs a set of coordinate points on the steel pipe end face. The end-face coordinate point set is preprocessed using the standard deviation threshold principle, and the Savitzky-Golay smoothing algorithm is used to fit the preprocessed end-face coordinate point set to output an optimized end-face coordinate point set. The optimal inflection point search algorithm is used to output the optimal inflection point and linear regression model. The linear regression model is used to output the bevel angle, blunt edge width, and end-face unevenness of the end-face measurement points. The extreme values of the bevel angle, blunt edge width, end-face unevenness, and end-face chamfer are calculated by traversing all parameters.
[0064] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the invention can be implemented in other specific forms without departing from its spirit or essential characteristics. Therefore, the embodiments should be considered in all respects as exemplary and non-limiting, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be included within the present invention. No reference numerals in the claims should be construed as limiting the scope of the claims.
Claims
1. A multi-parameter visual inspection method for industrial pipes based on multi-model collaboration, characterized in that: The method includes the following steps: S100: A pair of line-scan laser sensors are used to simultaneously collect data from the outer surface and end face of the steel pipe and to verify the collected data. S200. Preprocess the end face data and outer diameter data that meet the preset requirements. The preprocessing includes data conversion, data detection and data cleaning. S300: Calculate the outer radius of each measurement point using the preprocessed outer diameter data, the distance between the sensor and the steel pipe's central axis, and the scanning reference distance RD. Calculate the coordinate values of each outer diameter measurement point according to the Euclidean distance formula and the sine theorem, and output the outer diameter radius and outer diameter point set. Calculate the steel pipe wall thickness, and use the steel pipe wall thickness to calculate the inner radius, outputting the inner diameter coordinate point set. Construct a unified circle center fitting algorithm for inner and outer diameter circles, and use this algorithm to output the fitted circle center, fitted outer radius, and fitted inner radius. The algorithm for fitting inner and outer diameter circles using a unified center specifically outputs the fitted circle center, fitted outer radius, and fitted inner radius as follows: Enter the outer diameter coordinates and click C. outer ={(x o1 y o1 ), (x o2 y o2 ), ..., (x on y on )} and the set of coordinate points of the inner diameter C inter ={(x j1 y j1 ), (x j2 y j2 ), ..., (x jn y jn )}, (x o1 y o1 ), (x o2 y o2 ), ..., (x on y on (x) represents the coordinates of the 1st, 2nd, ..., nth outer diameter points. j1 y j1 ), (x j2 y j2 ), ..., (x jn y jn Let J represent the coordinates of the 1st, 2nd, ..., nth inner diameter points; the outer diameter circle and the inner diameter circle have the same fitting center; the residual between the actual distance from the measurement point of the outer diameter circle to the fitting center and the ideal inner and outer diameter circle radii is represented, and the objective function J is set. The objective function J consists of two parts: the sum of squares of the residuals of the outer diameter circle and the sum of squares of the inner diameter circle. When calculating the return value, the algorithm for fitting the inner and outer diameter circles with the unified circle center uses the sum of the two as the total residual error. The total residual error is optimized and solved using the L-BFGS-B quasi-Newton optimization algorithm. The L-BFGS-B quasi-Newton optimization algorithm iteratively updates the parameters based on gradient and parameter change convergence criteria until the convergence condition is met, ultimately obtaining the optimal output result, which is the x-coordinate of the center of the circle fitted by the four parameters. c Fit the ordinate of the center of the circle y c Fit the outer radius R and the inner radius r; S400: Reconstruct coordinates for the height data sequence. Input a single-line height sequence and sampling interval, and output a set of coordinate points on the steel pipe end face. Preprocess the end face coordinate point set using the standard deviation threshold principle, and fit the preprocessed end face coordinate point set using the Savitzky-Golay smoothing algorithm to output an optimized end face coordinate point set. Use the optimal inflection point search algorithm to output the optimal inflection point and linear regression model. Use the linear regression model to output the bevel angle, blunt edge width, and end face unevenness of the end face measurement points, and calculate the bevel angle and blunt edge width RF by iterating through all parameters. s End face unevenness V s And the extreme values of the end face chamfer; S500 allows staff to preset the upper and lower limits of the extreme parameter tolerances for the fitting circle center, fitting outer radius, fitting inner radius, bevel angle, blunt edge width, end face unevenness, and end face chamfer, and to perform over-limit detection, outputting the judgment results and over-limit values for each parameter.
2. The multi-parameter visual inspection method for industrial pipes based on multi-model collaboration according to claim 1, characterized in that: The data collection process in S100 specifically involves: S101. Mark a pair of line-scan laser sensors as sensor A and B respectively. Set the line laser direction of sensor A to be perpendicular to the end face of the steel pipe and coplanar with the central axis of the steel pipe, so that the bevel and blunt edge of the end face of the steel pipe are in the center of the sensor laser plane. Another sensor, B line laser, is positioned perpendicular to the outer surface of the steel pipe and coplanar with sensor A line laser, with the two not interfering with each other, so that the sensor laser plane is completely located at the position of the steel pipe generatrix. S102. Simultaneously and in the same direction, sensor A and sensor B rotate uniformly around the central axis of the steel pipe for one revolution according to the rotational angular velocity. One revolution is 360°. The time for the sensor to complete one revolution is taken as the sampling period. The operator sets the sampling period to Ts. The rotational angular velocity of the sensor is calculated using the sampling period as: ω=2π / Ts; ω represents the rotational angular velocity of the sensor. The data collected by sensors A and B respectively include the height data of the end face and outer surface of the steel pipe, the distance between the sensor and the central axis of the steel pipe, the scanning reference distance, and the corresponding angle of the measurement point. After the data acquisition is completed, sensor A and sensor B output end face data and outer diameter data respectively. The outer diameter data represents the height data of the outer surface of the steel pipe, and the end face data represents the height data of the end face of the steel pipe.
3. The multi-parameter visual inspection method for industrial pipes based on multi-model collaboration according to claim 1, characterized in that: The preprocessing of the outer diameter data that verifies compliance with preset requirements in S200 specifically involves: The specific steps for transforming the outer diameter data are as follows: convert the input outer diameter data into a NumPy array, and record the length of the outer diameter data before transformation for subsequent data checks; identify all non-empty and finite values in the outer diameter data as valid measurement points by creating a Boolean mask; The specific steps for data detection of outer diameter data are as follows: extract all valid measurement points and record the position index of the valid measurement points in the original array, where the original array represents the data group before data conversion; If the number of valid measurement points is less than 10 (the set value), the original data is returned directly. The original data refers to the data before conversion. The set value is preset by the staff. Z-score outlier detection is performed on the valid measurement points. The standardized score of each valid measurement point is calculated. The absolute value of the standardized score is then used to determine the deviation of each valid measurement point. According to the 3σ criterion in the normal distribution, measurement points with an absolute deviation greater than 3 are marked as outliers. The specific steps for cleaning the outer diameter data are as follows: remove all valid measurement points marked as outliers and update the corresponding location index; apply a moving average filter to the removed valid measurement points and reconstruct the data using a linear interpolation algorithm; and remap the cleaned valid measurement points back to the original array structure based on the location index.
4. The multi-parameter visual inspection method for industrial pipes based on multi-model collaboration according to claim 1, characterized in that: The preprocessing of the end face data in S200 to verify that it meets the preset requirements is specifically as follows: The specific data transformation of the end face data is as follows: each row of end face data is converted into a NumPy array. Then, a Boolean mask is created. In addition to identifying all non-empty and finite values in the outer diameter data, the Boolean mask creation of the end face data will also mark the remaining values that are not -999.999 as valid measurement points. The specific steps for data detection of the end face data are as follows: First step: If there are fewer than 10 valid measurement points, return the original data directly; second, extract the x and y coordinates of the valid measurement points line by line in the end face data group, where the x coordinate is the index value of the height data in the end face data group multiplied by the scanning point interval, and the y coordinate is the height data value. Step 2: Use the outlier detection algorithm of this scheme to locate outliers in each end face profile data row by row. The outlier detection algorithm consists of Algorithm 1 and Algorithm 2. Algorithm 1 is for global trend residual anomaly detection; Algorithm 2 is for sliding window local anomaly detection. The specific process for cleaning end-face data involves using a combination of logical AND operators. Measurement points that pass both global trend residual anomaly detection and sliding window local anomaly detection are considered normal; otherwise, the data is identified as abnormal and removed.
5. The multi-parameter visual inspection method for industrial pipes based on multi-model collaboration according to claim 1, characterized in that: The output outer radius and outer diameter point set in S300 are specifically as follows: Input the outer diameter data after cleaning, the distance h between the sensor and the central axis of the steel pipe, the scanning reference distance RD, and the corresponding angle θ of the measurement point. i =360°×i / n; The outer radius is calculated as: distance h between the sensor and the central axis of the steel pipe - (scanning reference distance RD - outer diameter data). The center of the outer diameter measurement point set is taken as the origin, and the corresponding angle of each measurement point is used as the central angle. The coordinates C of each outer diameter measurement point are calculated using the Euclidean distance formula and the sine theorem. i Output the outer radius R of each outer diameter measurement point. i Outer diameter coordinate point set C outer ; The output inner diameter coordinate point set specifically comprises: the number of valid measurement points on the input end face (data_count) and the scanning point interval (PI); based on T... i The wall thickness is obtained by calculating (data_count-1)×PI / 1000, and the inner radius r is then calculated using the wall thickness. i =R i -T i Construct the inner diameter coordinate C using the inner radius. i Output the set of inner diameter coordinate points C inter .
6. The multi-parameter visual inspection method for industrial pipes based on multi-model collaboration according to claim 1, characterized in that: The output steel pipe end face coordinate point set in S400 is specifically as follows: During the end-face data reading and verification process, an end-face height data CSV file is input, and a line-by-line original end-face height sequence is output. Coordinate reconstruction is performed on the height data sequence. Utilizing the valid measurement points in the preprocessed end-face data, a single-line height sequence and sampling interval are input, and the steel pipe end-face coordinate point set {(x... k y k )}; The standard deviation threshold principle is as follows: calculate the standard deviation and average value of the height data of all measurement points in the end face coordinate point set, set the standard deviation multiple threshold to L, and construct the normal range by using average value + L × standard deviation = upper limit of normal range and average value - L × standard deviation = lower limit of normal range. End face coordinate points outside the normal range are identified as outliers and removed.
7. The multi-parameter visual inspection method for industrial pipes based on multi-model collaboration according to claim 1, characterized in that: The optimal inflection point search algorithm in S400 is as follows: First, check if the sample size is greater than 10. If it is less than 10, stop the subsequent calculation. Then, enter the core grid search stage: take 5 points before and 5 points after as boundaries, and use the samples between the boundaries as candidate split points. Perform a grid search among all candidate points. For each candidate point position index s, the algorithm divides the end face coordinate point set into the first segment subsequence S1 = {(x k y k )|k=1,...,s1} and the subsequent subsequence S2={(x k y k )|k=1,...,s2}, and construct linear regression models for each; After constructing the linear regression model, the model parameter estimation stage begins. The piecewise model uses the least squares method to solve the linear coefficients of each segment according to the outlier detection algorithm. The optimal inflection point search algorithm adds six structural constraints. Candidate points that pass through structural constraints enter the optimality evaluation stage, which specifically involves constructing an objective function using a composite form.
8. The multi-parameter visual inspection method for industrial pipes based on multi-model collaboration according to claim 7, characterized in that: The six structural constraints in S400 are specifically as follows: ① The slope of the first subsequence must satisfy slope1>0; ② The slope ratio |slope2 / slope1|>0.3; ③ The span constraint L1>0.8L2, where the span of the first subsequence L1=x s -x1, the span of the latter part L 2= x n -x s ④ Absolute slope of the latter segment |slope2|>0.2; ⑤ Sample size constraint |s1|≥5 and |s2|≥5; ⑥ Relative slope condition |slope2|<|slope1|; slope1 represents the slope of the first subsequence, and slope2 represents the slope of the second subsequence; The over-limit detection specifically involves: staff setting upper and lower limits for extreme parameters of the fitting circle center, fitting outer radius, fitting inner radius, bevel angle, blunt edge width, end face unevenness, and end face chamfer. The optimal output result is compared with the preset upper and lower limits. If it is between the upper and lower limits, it is judged as normal; if it is outside the upper and lower limits, it is judged as over-limit. The judgment result of each parameter and the over-limit value are output. The over-limit value is the value exceeding the upper and lower limits of the tolerance.
9. A multi-parameter visual inspection system for industrial pipes based on multi-model collaboration, applying the multi-model collaborative multi-parameter visual inspection method for industrial pipes as described in any one of claims 1-8, characterized in that: The multi-parameter visual inspection system for industrial pipes includes a data acquisition module, a preprocessing module, an outer diameter data analysis module, and an end face data analysis module. The data acquisition module is used to simultaneously acquire data from the outer surface and end face of the steel pipe using a pair of line-scan laser sensors and to verify the acquired data. The preprocessing module is used to preprocess the end face data and outer diameter data that meet the preset requirements. The preprocessing includes data conversion, data detection and data cleaning. The outer diameter data analysis module is used to calculate the outer radius of each measurement point using preprocessed outer diameter data, the distance between the sensor and the center axis of the steel pipe, and the scanning reference distance RD. It calculates the coordinate values of each outer diameter measurement point according to the Euclidean distance formula and the sine theorem, and outputs the outer diameter radius and the set of outer diameter points. It also calculates the steel pipe wall thickness, uses the steel pipe wall thickness to calculate the inner radius, and outputs the set of inner diameter coordinate points. Finally, it constructs a unified circle center fitting algorithm for inner and outer diameter circles, and uses this algorithm to output the fitted circle center, fitted outer radius, and fitted inner radius. The end-face data analysis module is used to reconstruct coordinates from height data sequences. It takes a single-line height sequence and sampling interval as input and outputs a set of steel pipe end-face coordinate points. The module preprocesses the end-face coordinate point set using a standard deviation threshold principle, and then uses a Savitzky-Golay smoothing algorithm to fit the preprocessed set, outputting an optimized set. An optimal inflection point search algorithm is used to output the optimal inflection point and a linear regression model. The linear regression model outputs the bevel angle, blunt edge width, and end-face unevenness of the end-face measurement points. The bevel angle and blunt edge width RF are calculated by iterating through all parameters. s End face unevenness V s And the extreme values of the end face chamfer.
Citation Information
Patent Citations
Test method of pipe body caliber laser scanning detector
CN115711583A
High-precision small-caliber pipe groove detection method and device based on three-dimensional imaging
CN118225794A