Pipe online defect detection method and system

By using dark box environment and three-dimensional image reconstruction technology in pipe detection, the problem of rapid screening and accurate re-inspection balance of traditional methods when detecting warping defects is solved, and high-precision and low-cost online detection is achieved to adapt to material changes and production fluctuations.

CN120142324AActive Publication Date: 2025-06-13XIAN ZHONGCAI SECTIONAL MATERIAL CO LTD

Patent Information

Application Number
CN202510631006.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-16
Publication Date
2025-06-13
Estimated Expiration
2045-05-16

AI Technical Summary

Technical Problem

When detecting warping defects on the surface of plastic pipe fittings, it is difficult to balance rapid screening and accurate re-inspection. In addition, traditional methods rely on two-dimensional images or single-view detection, making it difficult to distinguish between continuous defects and point-like defects, resulting in a high misjudgment rate.

Method used

By placing the pipe to be detected in a dark box environment, using a light source to illuminate the pipe in the rotating state, the pipe projection is generated, and the detection line and the reference line are compared in real time to mark the suspected warping area. Then, a three-dimensional image reconstruction is carried out on the suspected warping area, a simulated three-dimensional point cloud model is generated, and the point cloud clusters are clustered through the DBSCAN algorithm to determine the continuity or point-like defects, and the defect severity is judged through the dynamic screening threshold.

Benefits of technology

The balance between rapid screening and accurate re-inspection is achieved, the hardware cost and energy consumption is reduced, the detection accuracy of tiny warping defects is improved, the misjudgment rate is reduced, and the material batch changes and production fluctuations are adapted.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120142324A_ABST
    Figure CN120142324A_ABST
Patent Text Reader

Abstract

The invention discloses a pipe online defect detection method and system, and relates to the technical field of image detection. The detection method comprises the following steps: placing a to-be-detected pipe in a dark box environment, irradiating the to-be-detected pipe in a rotating state through a light source, displaying a pipe projection on a projection surface, and setting a detection line at the upper end of the projection surface; comparing the detection line with a set reference line in real time, and marking a suspected warping area according to the local offset; performing three-dimensional image reconstruction on the suspected warping area to generate a simulation three-dimensional point cloud model; the method is technically characterized in that preliminary judgment passes through a grading strategy of'rapid screening-precise reinspection ', and the detection speed and precision are balanced; by means of the optical path principle and threshold value comparison, positioning operation of the whole-surface suspected warping area can be rapidly completed, only data of a local area (suspected warping area operation) is analyzed, the hardware cost and energy consumption are greatly reduced, and the high-speed online detection requirement is met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image detection, and particularly to an on-line defect detection method and system for pipes. Background Art

[0002] On-line defect image detection of pipes is an automated detection method based on vision technology. The surface images of pipes are collected in real time by industrial cameras, and defects are identified by combining algorithm analysis; Its process mainly includes: 1) Image acquisition. High-resolution line array or area array cameras are used, and combined with LED light sources to eliminate reflection, to obtain high-definition images of the pipe surface; 2) Image preprocessing. The image quality is optimized through technologies such as filtering, enhancement, and denoising; 3) Feature extraction and defect recognition. Traditional algorithms (such as edge detection, threshold segmentation) or deep learning models (such as convolutional neural networks) are used to locate defects such as cracks, pits, and scratches, and analyze their size and shape features; 4) Real-time sorting. The detection results are transmitted to the control system to link the production line to reject unqualified products; it is widely used in continuous production lines of pipes such as metal and plastic, which can significantly improve the quality control level and reduce the manual missed inspection rate; the key technical challenges lie in complex surface reflection suppression, ensuring the clarity of high-speed moving images, and accurate identification of tiny defects; The existing application with the publication number of CN118429333A and the name of a visual detection method and device for surface defects of pipes points out that: The detection method includes: obtaining a grayscale image of the pipe surface and calculating the first probability of the target pixel point; obtaining a texture image of the pipe surface and calculating the second probability of the target pixel point; determining the correction factor of the target pixel point; using the product of the correction factor and the preset threshold as the correction threshold of the edge detection algorithm to perform pipe defect detection; through the technical solution of the present invention, the accuracy of pipe defect detection can be improved, the risk of pipeline breakage can be reduced, and guarantee for the safe operation of the pipeline can be provided; although it corrects the threshold, the factors it considers are not directionally corrected through result feedback, and at the same time, the detection of the image still needs to act on the entire surface of the pipe, thereby increasing the computing power consumption for image analysis; Combined with the above document and the prior art: When detecting the surface warping defects of plastic pipe fittings: First, there is a balance problem between rapid screening and precise re-inspection: Traditional pipe defect detection often uses global three-dimensional scanning or full-surface image analysis, resulting in slow detection speed and high computing power consumption; for example, using a laser scanner to perform full-surface modeling takes several minutes per pipe, which cannot meet the requirements of high-speed production lines; Second, traditional methods rely on two-dimensional images or single-view detection, making it difficult to distinguish continuous defects (such as linear warping) from punctiform defects (such as warping with a single-point depression), resulting in a misjudgment rate as high as 15%-20%; Finally, when judging whether a pipe with a punctiform defect is a minor defect, the traditional method is to calculate the curvature of the punctiform defect and compare it with a fixed set threshold, using a fixed curvature threshold (such as k = 1.0 mm -1 ), when the material batch changes or the environment fluctuates, the misjudgment rate increases significantly; for example, the misjudgment rate soars from 5% to 25% after the material is replaced. Summary of the Invention

[0003] (I) Technical problems to be solved In view of the deficiencies of the prior art, the present invention provides a method and system for online defect detection of pipes. By adopting this detection method, the problems raised in the background art are effectively solved.

[0004] (II) Technical solutions To achieve the above objectives, the present invention is realized through the following technical solutions: A method for online defect detection of pipes, comprising the following steps: Place the pipe to be detected in a dark box environment, irradiate the pipe to be detected in a rotating state through a light source, display the projection of the pipe on the projection plane, and set the upper end of the projection plane as the detection line; Compare the detection line with the set reference line in real time, and mark the suspected warping area according to the local offset; Perform three-dimensional image reconstruction on the suspected warping area to generate a simulated three-dimensional point cloud model; After clustering the point cloud, merge the continuously existing local offsets into the same defect, and run the rule engine. If the continuously existing length S exceeds the set value, it is determined as a continuous defect; otherwise, it is determined as a punctiform defect; When there is a continuous defect in the pipe to be detected, it is determined that the pipe is unqualified and a warning signal is issued; When there is a punctiform defect in the pipe to be detected, the derivative curvature detection mechanism is executed to generate and extract the maximum curvature in the curvature dataset, and the state of the pipe is determined according to the dynamic screening threshold; Among them, the acquisition method of the dynamic screening threshold is as follows: Obtain the average maximum curvature and variance in historical data, perform weighted calculation to obtain the initial dynamic screening threshold, and regularly trigger the spot-check and model calibration strategies to obtain the corrected dynamic screening threshold.

[0005] Further, in a dark box environment, the light source irradiates along the direction perpendicular to the axis of the pipe to be detected, and the rotation center of the pipe to be detected coincides with its axis; when the surface of the pipe to be detected is flat, the detection line is the preset reference line.

[0006] Further, the process of marking the suspected warping area according to the local offset is as follows: Point-by-point comparison: Calculate the local offset Δd(x) for each coordinate point along the X-axis direction: ; In the formula, y_ac(x) is the height value of the detection line in the corresponding x interval, y_base(x) is the height value of the reference line in the corresponding x interval, and x corresponds to the length interval of the pipe to be detected; among them, the reference line is used as the X-axis along. Warping determination: When the local offset Δd(x) ≠ 0, it is determined as a suspected warping area and marked.

[0007] Further, the process of generating the simulation three-dimensional point cloud model is as follows: Multi-angle image data acquisition: When dealing with the suspected warping area, rotate the pipe to be detected around its axis and take images of the detection line from several perspectives; Triangulation modeling: Based on the parallax principle, calculate the surface height difference z(x); Point cloud generation: Integrate the height data of each perspective to generate a three-dimensional point cloud; Among them, the height data is the surface height difference z(x).

[0008] Further, use the DBSCAN algorithm to cluster the point cloud to form independent clusters, and the length of the independent cluster is the length S.

[0009] Further, the process of executing the derivative curvature detection mechanism is as follows: Path slicing: Extract the height data along the detection line direction; Derivative calculation: Calculate the first derivative and the second derivative ; Curvature model: Substitute , traverse all points to calculate the curvature k, and obtain the curvature data set.

[0010] Further, according to the dynamic screening threshold, the process of determining the state of the pipe is as follows: When k_max > the dynamic screening threshold, determine that the state of the pipe belongs to: serious defect; When k_max ≤ the dynamic screening threshold, the determined state of the pipe is: minor defect.

[0011] Furthermore, calculate the initial dynamic screening threshold k 0 using the following formula: ; where α and β are both weight coefficients, k avg , k vac are the average maximum curvature and variance of historical data respectively.

[0012] Furthermore, the triggered spot check and model calibration strategy are as follows: Sampling determination: After every Q detections, randomly select Q / 20 samples for re-inspection, and calculate the determination accuracy rate: Accuracy rate = (Number of correct determinations) / (Q / 20) × 100%; Calibration logic: When the accuracy rate is not less than 95%, maintain α and β in the calculation of the initial dynamic screening threshold; when the accuracy rate is lower than 95%, optimize α and β through gradient descent iteration to minimize L.

[0013] The on-line pipe defect detection system includes: An environmental debugging module places the pipe to be detected in a dark box environment, irradiates the pipe to be detected in a rotating state through a light source, displays the projection of the pipe on the projection plane, and sets the upper end of the projection plane as the detection line; A preliminary marking module compares the detection line with the set reference line in real time, and marks the suspected warping area according to the local offset; A three-dimensional construction module performs three-dimensional image reconstruction on the suspected warping area to generate a simulated three-dimensional point cloud model; A defect determination module clusters the point cloud, combines the continuously existing local offsets into the same defect, and runs a rule engine. If the continuously existing length S exceeds the set value, it is determined as a continuous defect; otherwise, it is determined as a point defect; An adjustment and correction module determines that the pipe is unqualified and issues a warning signal when there is a continuous defect in the pipe to be detected; when there is a point defect in the pipe to be detected, it executes a derivative curvature detection mechanism, generates and extracts the maximum curvature in the curvature dataset, and determines the state of the pipe according to the dynamic screening threshold; Among them, the acquisition method of the dynamic screening threshold is as follows: Obtain the average maximum curvature and variance in historical data, perform weighted calculation to obtain the initial dynamic screening threshold, and regularly trigger spot checks and model calibration strategies to obtain the corrected dynamic screening threshold.

[0014] (III) Beneficial effects The present invention provides an on-line defect detection method and system for pipes, having the following beneficial effects: (1) Through the grading strategy of "quick screening → precise re-inspection", the detection speed and accuracy are balanced; by using the optical path principle and threshold comparison, the positioning operation of the suspected warping area on the entire surface can be completed extremely quickly, and only the data of the local area (operation in the suspected warping area) is analyzed, greatly reducing the hardware cost and energy consumption, meeting the requirements of high-speed on-line detection, and at the same time providing reliable coordinate guidance for re-inspection; (2) Three-dimensional defect precise modeling is adopted: by collecting multi-angle images and triangulation for the suspected warping area to generate a three-dimensional point cloud model, avoiding global three-dimensional construction of the pipe; multi-view data fusion: data is obtained from different perspectives, avoiding the detection blind area of a single perspective, and accurately realizing the detection of minute warping defects on the product surface; (3) On the one hand, this solution can calculate the curvature through the first-order / second-order derivative to quantify the local bending degree. On the basis of determining the suspected warping area, it can more precisely distinguish between minor defects and serious defects in a targeted manner, solving the problem that traditional methods rely on fixed thresholds and cannot adapt to material batch differences or long-term production fluctuations; on the other hand, based on historical data, the dynamic screening threshold is calculated dynamically and the model is calibrated regularly to improve robustness, solving the problem that the existing technology lacks quantitative evaluation of minute defects (such as dot-like warping), resulting in over-rejection or missed detection; (4) Dynamic adaptability: the dynamic screening threshold can be automatically adjusted according to production batches or material changes, avoiding misjudgment caused by fixed thresholds; efficient calibration: the weight coefficient is optimized through gradient descent to improve the robustness of the model; low-cost maintenance: only a small amount of cost (labor) is required for re-inspection by regular spot checks, greatly reducing the quality inspection cost; In summary, this solution realizes a closed-loop of high-precision and low-cost on-line detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 It is a schematic diagram showing the actual scene principle of S1 in the present invention; Figure 2 It is the overall step flow chart of the on-line defect detection method for pipes in the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0016] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0017] Embodiment 1: Please refer to Figures 1 to 2, this embodiment provides an on-line defect detection method for pipes, including the following specific steps: S1. Place the pipe to be detected in a dark box environment. Along the direction perpendicular to the axis of the pipe to be detected, irradiate the pipe to be detected in a rotating state with a light source, and display the projection of the pipe on the projection plane. The upper end of the projection plane is set as the detection line; It should be noted that: Dark box environment: A closed box (with the inner wall painted black) is used to avoid interference from ambient light, and its size is adapted to the length of the pipe (such as 2m×0.5m×0.5m); Light source: A highly collimated LED linear light source (blue light with a wavelength of 450nm) is used to irradiate the surface of the pipe; Projection plane: A high-contrast diffuser (such as frosted glass) is set on the other side of the dark box to display the projection of the pipe; Industrial camera: It is installed corresponding to the projection plane and captures the projection image in real time (resolution ≥ 12 million pixels), aiming at the detection line; By clamping the pipe to be detected, it rotates at a constant speed around its axis to facilitate a comprehensive defect detection of the surface of the pipe to be detected; Imaging principle: When the surface of the pipe is flat, the detection line at the upper end of the projection plane is a uniform line; If there is a warping deformation on the surface of the pipe to be detected, some areas of the detection line will be distorted due to the height difference, and at this time, the position of the warping defect can be detected; In this embodiment, the defect type to be detected is warping; The pipe to be detected is also a plastic pipe; Among them, warping is commonly known as: deformation, bending, twisting; Since the shrinkage rate in the flow direction during plastic molding is larger than that in the vertical direction, the shrinkage rates of each part of the part are different, resulting in warping. Also, due to the inevitable large internal stress remaining in the part during injection molding and filling, warping is caused. These are all manifestations of the deformation caused by high-stress orientation.

[0018] S2. Compare the detection line with the reference line in real time, and mark the suspected warping area according to the local offset; Among them, the reference line is pre-generated and belongs to the calibration stage; Standard pipe fitting calibration: Select a pipe of the same model without defects (such as a Φ50mm PVC pipe), fix and clamp it for subsequent rotation, and project the detection line onto the surface by the light source as the reference line; S2 also includes synchronous acquisition: The pipe to be detected rotates at the same speed. Every time the encoder rotates 1°, the industrial camera is triggered to take a picture of the detection line image, and the set of actual detection line coordinate points is extracted; Taking the reference line as the X-axis, any end of the reference line as the origin, and setting the axis perpendicular to the X-axis as the Y-axis, a two-dimensional coordinate system is constructed; The process of marking the suspected warping area according to the local offset is as follows: Point - by - point comparison: Calculate the local offset Δd(x) along the X - axis coordinate points (pixels) one by one: ; In the formula, y_ac(x) is the height value of the detection line within the corresponding x interval, and y_base(x) is the height value of the reference line within the corresponding x interval; for example, within a continuous 50 mm (x = 100~150 mm, there is only a rough area range, and due to the errors of light and material in real - time, the area range needs to be expanded), Δd(x)=0.5 mm; x corresponds to the length interval of the pipe to be detected; Warpage determination: When the local offset Δd(x)≠0, it is determined as a suspected warpage area and marked; Among them, it should be noted that: When Δd>0: The detection line bulges outwards (local bulge - type warpage); When Δd<0: The detection line sinks inwards (local depression - type warpage); The above - mentioned method using the optical path principle can quickly and effectively locate the position or area with suspected warpage, which is convenient for subsequent targeted detailed detection. Due to the inevitable influence of pipe material and ambient light, the edge of the detection line is blurred. The accuracy of the detection line edge can be improved by the Canny algorithm to distinguish minor warpage during subsequent modeling; Therefore, the preliminary determination adopts a hierarchical strategy of "quick screening (S1 to S2) → precise re - inspection (S3 and subsequent steps)", which balances the detection speed and accuracy; quick positioning: Using the optical path principle and threshold comparison, the positioning operation of the suspected warpage area on the entire surface can be completed extremely quickly; computing power optimization: Only analyze the data of the local area (operation in the suspected warpage area), and the hardware cost and energy consumption are greatly reduced; production line adaptation: It meets the requirements of high - speed online detection and provides reliable coordinate guidance for re - inspection at the same time.

[0019] S3. Perform three - dimensional image reconstruction on the suspected warpage area to generate a simulated three - dimensional point cloud model; Among them, the process of generating the simulated three - dimensional point cloud model is as follows: Multi - angle image data acquisition: For the marked suspected warpage area (such as x = 100~150 mm), drive the pipe to be detected to rotate around the axis, and take images of the detection line from three perspectives of 0°, 45°, and 90°; Triangulation modeling: Based on the principle of parallax, calculate the surface height difference z(x): ; When θ = 45°, for example: when Δd(x)=0.8 mm, z(x)=0.8 / tan45° = 0.8 mm; Point cloud generation: Integrate the height data of each perspective to generate a three - dimensional point cloud, with the coordinate format (x, y, z) and an accuracy of ±0.05 mm; Here is an example: Scenario: Detect suspected warping areas of Φ50mm PVC pipes (x=100~150mm).

[0020] Data: 0° viewing angle: Δd=0.8mm → z=0.8mm; 45° viewing angle: Δd=1.2mm → z=1.2mm; 90° viewing angle: Δd=0.6mm → z=0.6mm; Output: Generate 50 point cloud coordinates to map the surface concave (warping) morphology.

[0021] In summary, precise three-dimensional defect modeling is adopted: a three-dimensional point cloud model is generated by multi-angle image acquisition and triangulation of suspected warping areas to avoid global three-dimensional construction of the pipe; multi-view data fusion: data is acquired from different viewpoints to avoid blind spots in single-view detection and accurately realize the detection of tiny warping defects on the product surface.

[0022] S4. Use the DBSCAN algorithm to cluster the point cloud, merge the continuous local offsets into the same defect, and run the rule engine. If the length S of the continuous existence exceeds the set value, it is determined to be a continuity (line / surface) defect; if the length S of the continuous existence does not exceed the set value, it is determined to be a point defect; Among them, DBSCAN clustering: For example, parameter settings: neighborhood radius ϵ=2mm, minimum number of points minPts=5; Algorithm execution: Merge points with a spacing < 2 mm to form independent clusters; Rule engine judgment: Continuity defect: cluster length S = max(x) − min(x) > set value; Point defect: cluster length S ≤ set value; Here is an example: Scenario: A cluster of point clouds accurately covers x=120~135mm, with a total of 15 points; Calculation: S=135−120=15mm>5mm (set value) → determined as a continuity defect; Comparison: Another cluster x=140~143mm, S=3mm ≤5mm (set value) → determined as point defect; In summary, the core operation of S3 is multi-view triangulation, with a point cloud density ≥ 50 points / mm² and a time consumption of 200 ms / area; the core operation of S4 is density clustering + length threshold determination, and the classification accuracy is improved compared to only comparing with the reference line, reaching > 98%, with a time consumption of 50 ms / area; this solution realizes the accurate identification of defect types through 3D modeling → intelligent classification and is applicable to the requirements of multiple scenarios.

[0023] S5. When there are continuous defects in the pipe to be detected, it is determined that the pipe is unqualified and a warning signal is issued; When there are point defects in the pipe to be detected, the derivative curvature detection mechanism is executed to generate and extract the maximum curvature in the curvature dataset, and the state of the pipe is determined according to the dynamic screening threshold; Among them, the method for obtaining the dynamic screening threshold is as follows: Obtain the average maximum curvature and variance in the historical data, perform weighted calculation to obtain the initial dynamic screening threshold, and regularly trigger the spot check and model calibration strategy to obtain the corrected dynamic screening threshold; The process of executing the derivative curvature detection mechanism is as follows: Path slicing: Extract the height data y(x) along the detection line direction (X-axis); Derivative calculation: First derivative: ; In this formula, y: the height data in the detection line direction (unit: mm), representing the vertical offset of the pipe surface relative to the reference line; x: the position coordinate in the detection line direction (unit: mm); i: the data point index, corresponding to the serial number of the discretized sampling point (such as i = 1, 2,..., N); Δx: the sampling interval, that is, the distance between adjacent data points (such as Δx = 0.1); y i+1 , y i−1 : The height values of adjacent data points, used to calculate the central difference derivative; The first derivative represents the slope of the height along the detection line direction (unit: dimensionless); Second derivative: ; In this formula, y i : The height value of the current data point (unit: mm); The second derivative represents the change rate of the slope (unit: mm⁻¹); Curvature model: Substitute , traverse all points to calculate the curvature, and the curvature dataset can be obtained; It should be noted that the curvature k describes the local bending degree of the surface of the pipe to be detected; the numerator part: reflects the "acceleration" of bending, and the larger the value, the more severe the bending; the denominator part: a correction factor to eliminate the influence of the slope on the curvature calculation; when the surface is flat (y'→0), the curvature is approximately equal to the absolute value of the second derivative; An example of the process of generating and extracting the maximum curvature in the curvature dataset is as follows: The curvature distribution in a certain point area is 0.2, 0.5, 1.3mm −1 → k_max = 1.3mm −1 ; When determining the state of the pipe according to the dynamic screening threshold; Judgment rules: When k_max > the dynamic screening threshold, the state of the pipe is determined as: serious defect (alarm and rejection required); When k_max ≤ the dynamic screening threshold, the state of the pipe is determined as: minor defect (allowed to enter the secondary product warehouse); Specifically, on the one hand, the curvature is calculated through the first-order / second-order derivative to quantify the local bending degree. On the basis of determining the suspected warping area, a more refined distinction between minor defects and serious defects is achieved in a targeted manner, solving the problem that the traditional method relies on a fixed threshold and cannot adapt to material batch differences or long-term production fluctuations; on the other hand, the threshold (dynamic screening threshold) is calculated dynamically based on historical data, and the model is calibrated regularly to improve robustness, solving the problem that the existing technology lacks quantitative evaluation of minor defects (such as point warping), resulting in over-rejection or missed detection; The process of obtaining the average maximum curvature and variance in the historical data and performing weighted calculation to obtain the initial dynamic screening threshold is as follows: The average maximum curvature of the historical data: ; In the formula, N is the number of historical data samples, k avg is the average curvature of the historical data, reflecting the overall defect level, k_max i is the maximum curvature of the i-th detection; The variance of the historical data: ; In the formula, k vac is the variance of the historical data, reflecting the defect volatility; The initial dynamic screening threshold: ; In the formula, both α and β are weight coefficients, and α + β = 1; It is recommended to set the initial values as α = 0.7 and β = 0.3 (empirical values, can be calibrated); It should be noted that the weight coefficients are determined by the coefficient of variation method. The coefficient of variation method is a method of weighting each index according to the degree of variation between the current value and the target value of each evaluation index. If the numerical difference of a certain index is large and can clearly distinguish each evaluated object, it indicates that the resolution information of this index is rich, so a larger weight should be given to this index. On the contrary, if the numerical differences of each evaluated object on a certain index are small, then the ability of this index to distinguish each evaluation object is weak, so a smaller weight should be given to this index. This method directly utilizes the information contained in each index and calculates the weights of the indexes, so it has objectivity. Example: Historical data: k avg =0.8mm -1 , k vac =0.2; Initial threshold: k 0 =0.7×0.8 + 0.3×0.2 = 0.62mm -1 ; The triggered sampling and model calibration strategies are as follows: Sampling determination: After every Q detections are completed, randomly select Q / 20 samples for re-inspection, and calculate the determination accuracy rate: Accuracy rate = number of correct determinations / (Q / 20) × 100%; Among them, the value range of Q is a positive integer greater than 0. In this embodiment, Q = 1000, so the number of samples is 1000 / 20 = 50; Example: Among the 50 sampled samples, 48 are determined correctly → accuracy rate 96%. Combining the following calibration logic, it is determined to meet the standard and no adjustment is required; Calibration logic: When the accuracy rate is not lower than 95%, maintain the weight coefficients (α, β) in the initially calculated dynamic screening threshold; when the accuracy rate is lower than 95%, optimize α and β through gradient descent iteration to minimize L; Among them, the specific process of optimizing the weight coefficients is as follows: Define the loss function (mean square error): ; In the formula, M is the number of wrong samples, k id,j is the reasonable threshold for re-inspection. The meaning of j is the same as that of i in the formula for calculating the average maximum curvature of historical data, so it will not be elaborated here; Calculate the gradient and update the coefficients: ; In the formula, η is the learning rate, and its value range is from 0 to 1 (such as 0.01); Example: When the number of wrong samples M = 5 and the reasonable threshold for determination is 0.7 mm⁻¹ (it can be selected to be determined manually): L = 1 / 5∑(k 0 −0.7)2 Through gradient descent iteration, optimize α and β to minimize L; Specifically, the effects embodied by the technical solution given in S5 include: Dynamic adaptability: The dynamic screening threshold can be automatically adjusted according to production batches and materials, avoiding misjudgment caused by a fixed threshold; High-efficiency calibration: Optimize the weight coefficients through gradient descent to improve the robustness of the model; Low-cost maintenance: Regular spot checks only require a small amount of cost (labor) for re-inspection, significantly reducing the quality inspection cost; This solution realizes a high-precision and low-cost online detection closed-loop; In summary, S1 - S2 + S3 (rapid screening + three-dimensional reconstruction) realizes a hierarchical strategy of "rapid positioning → precise re-inspection", balancing the detection speed and accuracy, and solving the problems of slow speed and high computing power consumption in traditional full-surface three-dimensional detection, which cannot meet the requirements of online detection; S3 + S4 (three-dimensional modeling + clustering classification), through three-dimensional point clouds and intelligent classification, accurately identify the types of defects (such as linear / point-like), reducing the misjudgment rate, and solving the problem that existing two-dimensional detection cannot distinguish complex defect morphologies, resulting in mismatched subsequent processing strategies; S5 dynamic threshold + regular calibration, dynamically adapts to production fluctuations, reduces manual intervention, and reduces the quality inspection cost, solving the problem that traditional fixed thresholds require frequent manual adjustment, with high maintenance costs and prone to introducing subjective errors; Embodiment 2: Based on Embodiment 1, this embodiment also provides an online defect detection system for pipes, including: An environmental debugging module places the pipe to be detected in a dark box environment, irradiates the pipe to be detected in a rotating state through a light source, and displays the projection of the pipe on the projection plane, and the upper end of the projection plane is set as the detection line; A preliminary marking module compares the detection line with the set reference line in real time, and marks the suspected warping area according to the local offset; A three-dimensional construction module performs three-dimensional image reconstruction on the suspected warping area to generate a simulated three-dimensional point cloud model; A defect determination module clusters the point clouds and combines those with continuous local offsets into the same defect, and runs a rule engine. If the continuous length S exceeds the set value, it is determined as a continuous defect; otherwise, it is determined as a point-like defect; An adjustment and correction module determines that the pipe is unqualified and issues a warning signal when there is a continuous defect in the pipe to be detected; when there is a point-like defect in the pipe to be detected, it executes a derivative curvature detection mechanism, generates and extracts the maximum curvature in the curvature dataset, and determines the state of the pipe according to the dynamic screening threshold; Among them, the acquisition method of the dynamic screening threshold is as follows: Obtain the average maximum curvature and variance in the historical data, perform weighted calculation to obtain the initial dynamic screening threshold, and regularly trigger spot checks and model calibration strategies to obtain the corrected dynamic screening threshold.

[0024] The overall technical advantages are as follows: 1. Efficiency improvement: The online detection speed reaches second-level response, meeting the requirements of high-speed production lines; 2. Precision guarantee: 3D modeling and curvature quantization enable the defect recognition precision to reach ±0.05 mm; 3. Adaptive ability: Dynamic threshold and model calibration achieve long-term stable detection, adapting to material changes in multiple batches; 4. Cost optimization: The hierarchical detection strategy reduces computing power consumption, and the spot-check calibration mechanism reduces labor costs.

[0025] The above embodiments can be implemented in whole or in part by software, hardware, firmware, or any other combination. When implemented using software, the above embodiments can be implemented in whole or in part in the form of a computer program product. Those of ordinary skill in the art can realize that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or in the combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution.

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

[0027] As mentioned above, the above are only the specific implementation manners of this application, but the protection scope of this application is not limited thereto. Any person skilled in the art within the technical scope disclosed in this application can easily think of changes or substitutions, which should all be covered within the protection scope of this application.

Claims

1. A method for online defect detection of pipes, characterized in that: The steps include: Place the pipe to be inspected in a dark box environment, illuminate the rotating pipe with a light source, display the projection of the pipe on the projection surface, and set the upper end of the projection surface as the inspection line; Compare the detection line with the set baseline in real time, and mark the suspected warping area according to the local offset; Perform 3D image reconstruction on the suspected warping area to generate a simulated 3D point cloud model; After clustering the point cloud, the continuous local offsets are merged into the same defect, and the rule engine is run. If the length S of the continuous existence exceeds the set value, it is determined to be a continuous defect; otherwise, it is determined to be a point defect; When there are continuous defects in the pipe to be tested, the pipe is judged as unqualified and an early warning signal is issued; When there are point defects in the pipe to be inspected, the derivative curvature detection mechanism is executed to generate and extract the maximum curvature in the curvature data set, and the state of the pipe is determined based on the dynamic screening threshold; The dynamic screening threshold is obtained as follows: The average maximum curvature and variance in the historical data are obtained, and the initial dynamic screening threshold is obtained after weighted calculation. The spot check and model calibration strategy are triggered regularly to obtain the corrected dynamic screening threshold.

2. The method for online defect detection of pipes according to claim 1, characterized in that: In a dark box environment, the light source is irradiated in a direction perpendicular to the axis of the tube to be inspected, and the rotation center of the tube to be inspected coincides with its axis; when the surface of the tube to be inspected is flat, the inspection line is the preset reference line.

3. The method for online defect detection of pipes according to claim 1, characterized in that: The process of marking suspected warpage areas based on local offset is as follows: Point-by-point comparison: Calculate the local offset Δd(x) along the X-axis point by point: ; Where y_ac(x) is the height value of the detection line in the corresponding x interval, y_base(x) is the height value of the reference line in the corresponding x interval, and x corresponds to the length interval of the pipe to be tested; the reference line is taken as the X axis; Warping judgment: When the local offset Δd(x)≠0, it is judged as a suspected warping area and marked.

4. The method for online defect detection of pipes according to claim 1, characterized in that: The process of generating a simulated 3D point cloud model is as follows: Multi-angle image data acquisition: When dealing with suspected warping areas, the pipe to be inspected is rotated around the axis and the inspection line images are taken from several viewing angles; Triangulation modeling: Based on the parallax principle, calculate the surface height difference z(x); Point cloud generation: Fuse the height data from each perspective to generate a three-dimensional point cloud; The height data is the surface height difference z(x).

5. The method for online defect detection of pipes according to claim 1, characterized in that: The DBSCAN algorithm is used to cluster the point cloud to form independent clusters, and the cluster length of the independent cluster is the length S.

6. The method for online defect detection of pipes according to claim 4, characterized in that: The process of implementing the derivative curvature detection mechanism is as follows: Path slicing: extract height data along the detection line direction; Derivative calculation: Calculate the first-order derivative point by point along the detection line and the second derivative ; Curvature model: Substitute , traverse all points to calculate the curvature k, and get the curvature data set.

7. The method for online defect detection of pipes according to claim 1, characterized in that: Based on the dynamic screening threshold, the process of determining the state of the pipe is as follows: When k_max>dynamic screening threshold, the state of the pipe is determined as: severe defect; When k_max ≤ dynamic screening threshold, the state of the pipe is determined to be: slight defect.

8. The method for online defect detection of pipes according to claim 1, characterized in that: The formula used to calculate the initial dynamic screening threshold k0 is as follows: ; In the formula, α and β are weight coefficients, k avg , k vac are the average maximum curvature and variance of historical data respectively.

9. The method for online defect detection of pipes according to claim 8, characterized in that: The triggered spot check and model calibration strategies are as follows: Sampling judgment: After completing Q tests, randomly select Q / 20 samples for re-inspection and calculate the judgment accuracy: Accuracy = number of correct judgments / (Q / 20)×100%; Calibration logic: When the accuracy is not less than 95%, the α and β in the initial dynamic screening threshold are maintained; when the accuracy is less than 95%, α and β are optimized through gradient descent iteration to minimize L.

10. The online defect detection system for pipes is characterized by: include: The environment debugging module places the pipe to be inspected in a dark box environment, illuminates the rotating pipe to be inspected through a light source, displays the projection of the pipe on the projection surface, and the upper end of the projection surface is set as the inspection line; The preliminary marking module compares the detection line with the set baseline in real time and marks the suspected warping area according to the local offset; The 3D construction module reconstructs the 3D image of the suspected warping area and generates a simulated 3D point cloud model; The defect judgment module clusters the point cloud and merges the continuous local offsets into the same defect. It then runs the rule engine. If the length S of the continuous local offsets exceeds the set value, it is judged as a continuous defect. Otherwise, it is judged as a point defect. Adjust the correction module. When there are continuous defects in the pipe to be tested, the pipe is judged as unqualified and an early warning signal is issued. When there are point defects in the pipe to be tested, the derivative curvature detection mechanism is executed to generate and extract the maximum curvature in the curvature data set, and the state of the pipe is determined based on the dynamic screening threshold. The dynamic screening threshold is obtained as follows: The average maximum curvature and variance in the historical data are obtained, and the initial dynamic screening threshold is obtained after weighted calculation. The spot check and model calibration strategy are triggered regularly to obtain the corrected dynamic screening threshold.

Citation Information

Patent Citations

  • New non-destructive detection method for morphology and distribution of pores in welding seam

    CN103234990A

  • Automobile headlamp detection method and device

    CN107702898A

  • Optical measurement system for abrasive machining and application method

    CN110480510A

  • Pipeline defect identification method and device, terminal equipment and storage medium

    CN113284109A

  • Pipeline three-dimensional reconstruction method and equipment based on fringe projection measurement

    CN118334239A

Cited By

  • Cable accessory process quality detection method and system based on machine vision

    CN120672754A

  • A Machine Vision-Based Method and System for Quality Inspection of Cable Accessories

    CN120672754B

  • Part defect detection method and system based on image model

    CN120976169A

  • Deformation detection method for integrally formed photovoltaic inverter box body

    CN121048522A

  • Intelligent plastic pipe manufacturing whole process digital management system and method

    CN121168997A