A tube bar geometry and surface defect detection system and method
By integrating a laser diameter gauge, a CCD linear array camera, and a vibration damping device into a detection system, and combining it with a specialized calculation model, the system enables simultaneous online detection of the shape parameters and surface defects of pipes and bars. This solves the problem of low detection efficiency in existing technologies and improves detection accuracy and production efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- TAIYUAN UNIVERSITY OF SCIENCE AND TECHNOLOGY
- Filing Date
- 2025-12-15
- Publication Date
- 2026-04-24
AI Technical Summary
Existing technologies cannot simultaneously achieve micron-level measurement of the surface parameters of tubes and bars and sub-pixel-level identification of surface defects under high-speed rolling conditions. This results in functional fragmentation, poor anti-interference capability, and low efficiency, failing to meet the stringent "zero-defect" standards of high-end manufacturing.
A detection system consisting of three sets of laser diameter gauges, three sets of CCD line array cameras, a ring coaxial light source, and a vibration damping device, combined with an elliptical cross-section model, an optimized three-point method, and a cascaded model, enables synchronous online detection of surface parameters and surface defects.
It realizes integrated online detection of tube and bar shape features and surface defects, eliminates functional separation, improves detection accuracy and efficiency, and meets the quality control standards of high-end manufacturing industry.
Smart Images

Figure CN121323508B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of measurement equipment technology, specifically relating to a system and method for detecting the geometric dimensions and surface defects of tubes and bars. Background Technology
[0002] As key structural components in aerospace, nuclear power, and precision equipment, tubular and bar materials directly affect the service safety and lifespan of components due to their surface features (such as diameter, ellipticity, and straightness) and surface defects (such as cracks, scabs, and scratches). Current industrial inspection faces severe challenges: traditional inspection methods suffer from significant functional fragmentation. Surface parameter measurement relies on contact equipment or specialized instruments, which, while achieving high accuracy, cannot simultaneously identify micro-defects. While machine vision-based surface defect detection systems can capture microscopic flaws, they struggle to reconstruct three-dimensional surface features. This step-by-step inspection mode not only significantly reduces production line efficiency but also creates blind spots due to asynchronous data generation caused by separate equipment. Especially for long-axis tubular and bar materials, existing roundness testers and other equipment are limited by physical specifications, allowing only offline sampling inspection of cut sections, failing to meet the rigid requirements of continuous production for full-length quality monitoring. High-speed rolling further amplifies these technical bottlenecks: mechanical vibration causes data distortion from laser displacement sensors, motion blur drastically reduces the defect recognition rate of vision systems, and the strong reflective properties of metal surfaces further interfere with optical measurement accuracy. While industry attempts have focused on improvements through multi-sensor parallel operation or structured light scanning, fundamental shortcomings remain, including large spatiotemporal matching errors, high reconstruction failure rates, and insufficient real-time performance. Therefore, there is an urgent need to develop an integrated online inspection system that combines multimodal sensing and intelligent algorithms. This system should be able to simultaneously achieve micron-level measurement of surface parameters and sub-pixel-level identification of surface defects under high-speed operation, overcoming the three major technical barriers of functional fragmentation, poor anti-interference capability, and low efficiency. This would meet the stringent "zero-defect" standards for tubes and bars in high-end manufacturing. Summary of the Invention
[0003] To address the problems existing in the prior art, this invention provides a system and method for detecting the geometric dimensions and surface defects of tubes and bars, offering a full-process quality monitoring solution for high-end manufacturing, and significantly improving production efficiency and product reliability under the "zero-defect" quality control standard.
[0004] To achieve the above objectives, the present invention provides the following solution:
[0005] A system for detecting the geometric dimensions and surface defects of tubes and bars, the system comprising: three sets of laser diameter gauges, three sets of CCD line array cameras, a computer and a monitor, an audible and visual alarm, two sets of vibration damping devices, a ring coaxial light source, a control cabinet, a motor, a V-shaped roller conveyor, two sets of ring frames and three sets of supports.
[0006] The computer and monitor are used to process, calculate, and display the shape features and surface defects of the tubes and bars.
[0007] The audible and visual alarm is used to trigger an alarm when any parameter of the straightness, ellipticity, diameter, or identified defect level of the tube or rod exceeds a set threshold.
[0008] The control cabinet is used to control the start, stop and speed of the motor;
[0009] The motor is used to drive the V-shaped roller conveyor to rotate, thereby conveying the tubes and bars;
[0010] The ring frame is used to fix and mount the CCD line scan camera and the ring coaxial light source;
[0011] The bracket is used to fix and install the laser diameter measuring instrument;
[0012] The vibration damping device is used to eliminate mechanical vibration;
[0013] The annular coaxial light source uses diffuse illumination, and its illumination direction is consistent with the axial direction of the tube or rod, so as to obtain a uniform brightness distribution on the surface of the tube or rod.
[0014] The laser diameter measuring instrument is used to collect the center coordinates and orthogonal diameters of the pipe and rod, and take the average of the orthogonal diameters as the cross-sectional diameter of the pipe and rod; the true ellipticity of the pipe and rod is calculated based on the elliptical cross-section model by introducing a correction parameter M; and the straightness of the pipe and rod at different positions is calculated by combining the optimized three-point method.
[0015] The CCD linear array camera is used to acquire circumferential images of the tubes and bars, and through multi-level processing, locate the defect areas of the tubes and bars, extract the features of the tubes and bars, and classify the defects using a cascaded model.
[0016] Preferably, the three sets of laser diameter gauges are arranged adjacent to each other along the axial direction of the pipe or rod at a fixed interval of L / 2, and their centers are located on the same straight line. Each set of laser diameter gauges is used to obtain the position of the center of the pipe or rod at its axial position relative to the origin of the coordinate system of the set of laser diameter gauges. The three sets of laser diameter gauges work together to obtain the positions of the center of the pipe or rod at three different axial positions relative to the origin of their respective coordinate systems.
[0017] Each laser diameter measuring instrument is equipped with two photoelectric probes arranged at 90° to form a two-dimensional measurement system. The origin O is the intersection of the optical axes of this two-dimensional measurement system, and the measurement directions of the two photoelectric probes are defined as the X-axis and Y-axis, respectively, to establish an OXY coordinate system. Each photoelectric probe includes a laser emitting end and a laser receiving end. During the detection process, the photoelectric probe captures the edge position of the tube or rod in real time and simultaneously calculates the diameter of the tube or rod in the X-axis and Y-axis directions and the position of its center relative to the coordinate origin O.
[0018] Preferably, three sets of CCD line array cameras are evenly distributed along the circumference of the tube or bar on a ring frame to acquire circumferential images of the tube or bar.
[0019] This invention also provides a method for detecting the geometric dimensions and surface defects of tubes and bars, the method being implemented using the aforementioned system, the method comprising:
[0020] Collect the center coordinates and orthogonal diameters of the tube / rod, and take the average of the orthogonal diameters as the cross-sectional diameter of the tube / rod; calculate the true ellipticity of the tube / rod based on the elliptical cross-section model by introducing a correction parameter M; and calculate the straightness of the tube / rod at different positions by combining the optimized three-point method.
[0021] The system acquires circumferential images of pipes and bars, performs multi-level processing to locate defect areas, extracts features, and classifies defects using a cascaded model.
[0022] Preferably, the method for calculating the true ellipticity of tubes and bars based on the elliptical section model and introducing a correction parameter M includes:
[0023] ;
[0024] Wherein, D1 and D2 are the maximum and minimum diameters of the pipe and rod measured by the laser diameter gauge, respectively.
[0025] Preferably, the method for calculating the straightness of pipes and bars at different positions using the optimized three-point method includes:
[0026] Let the length of the pipe / rod be L. t And move in the set direction:
[0027] Head straightness calculation: When the head of the pipe or rod is fully inside the laser diameter measuring instrument three, the pipe head straightness calculation is started. Based on the center position data of the pipe or rod collected by laser diameter measuring instrument one and laser diameter measuring instrument two, a straight line is fitted. The vertical distance from the center position of the pipe or rod collected by laser diameter measuring instrument three to the fitted straight line is the straightness of the pipe head. This is completed during the process of the pipe or rod head moving a distance of L / 2 after entering laser diameter measuring instrument three.
[0028] Tail straightness calculation: After the pipe / rod has completely passed the laser diameter gauge and continues to move a distance L t When the tube tail is at -3L / 2, start the calculation of tube tail straightness; fit a straight line based on the center position data of the bar collected by laser diameter gauge 2 and laser diameter gauge 3, and the vertical distance from the center position of the bar collected by laser diameter gauge 1 to the fitted straight line is the straightness of the tube tail; the calculation is completed after the tube tail has completely passed through laser diameter gauge 1.
[0029] Preferably, the method of acquiring circumferential images of pipes and bars, locating defect areas of the pipes and bars through multi-level processing, extracting features of the pipes and bars, and classifying defects using a cascaded model includes:
[0030] Step 1: Perform non-subsampled shear wave transform (NSST) decomposition on the circumferential images of the tube / rod acquired by three sets of CCD linear array cameras to obtain low-frequency and high-frequency subbands; perform Gaussian filtering on the low-frequency subbands to suppress illumination unevenness noise; perform anisotropic diffusion denoising on the high-frequency subbands while preserving edges, and supplement with gamma correction to enhance the contrast of weak defects; reconstruct the processed low-frequency and high-frequency subbands using inverse NSST transform.
[0031] Step 2: Morphological optimization of the reconstructed image: Opening operation is used to eliminate white noise, and closing operation is used to fill holes; the structuring element size is 13×13 pixels;
[0032] Step 3: Based on the optimized reconstructed image, extract edge gradients using the Sobel operator; use Hough transform to identify and exclude marked areas on the end face of the tube or rod; locate candidate defect areas based on Otsu adaptive threshold segmentation combined with connected component analysis.
[0033] Step 4: Apply a closing operation to the candidate defects to connect the fracture regions; extract the skeleton to analyze slender defects; calculate geometric features, texture features and depth features based on 3D point cloud reconstruction. Among them, geometric features include: area, aspect ratio and roundness, and texture features include: Local Binary Pattern (LBP) and Gray-Level Co-occurrence Matrix (GLCM).
[0034] Step 5: Load the offline trained MobileNetV3-RF cascade classification model; classify the defect region in real time and output the type and location information.
[0035] Preferably, the MobileNetV3-RF cascaded classification model structure includes: a front-end feature extraction layer, namely MobileNetV3, and a back-end classification decision layer, namely Random Forest (RF).
[0036] The front-end feature extraction layer employs MobileNetV3 as its backbone network, with the input size adjusted to 512×512×3. It extracts deep semantic features while maintaining real-time performance through depthwise separable convolutions and a Squeeze-and-Excitation module. The output is a 128-dimensional feature vector F obtained after global average pooling (GAP) in the final layer. cnn Used to represent the depth semantic information extracted from the image; the F extracted by MobileNetV3 cnn Concatenated with extracted multimodal handcrafted features: Handcrafted feature vector: F handcrafted =[A,AR,C,F lpb T ,E,Con,Ent,D3d] TUsed to describe the geometric, textural, and 3D morphological features of defective regions in an image, where A is the area, AR is the aspect ratio, C is the roundness, and F is the area. lpb T It is a local binary mode histogram feature vector, where E, Con, and Ent are the energy, contrast, and entropy of the gray-level co-occurrence matrix features, respectively, and D3d is the defect concavity and convexity. The dimensional composition is: geometry (3) + LBP (59) + GLCM (3) + depth (1) = 66 dimensions; the mixed feature vector is: F fused =[F cnn T F handcrafted T ] T Dimensional composition: MobileNetV3 features (128) + handcrafted features (66) = 194 dimensions; concatenation operation: F cnn With F handcrafted Concatenate along the column vector direction;
[0037] Backend classification decision layer: Input: Mixed features F fused Parameter Design: Number of Trees: Let N be the number of decision trees in the random forest. trees =200, to balance classification accuracy and inference speed; Maximum depth: A dynamic adjustment strategy is adopted, and pruning is performed according to feature importance. Let D be the maximum depth of the t-th tree. t It satisfies: D min I is the minimum depth threshold. t The weighted sum of the feature importance of the t-th tree, Scaling factor; Splitting criterion: adopting the Gini impurity minimization principle; for the feature subset S at node q q Select feature j and splitting threshold v to minimize Gini impurity: ,in, For the feature subset Sq at node q, the sum of Gini impurities when selecting feature j and splitting threshold v is used to evaluate the splitting effect; S L and S R These are the left and right subsets after the split; , These are the Gini impurities of the left and right subsets after the split, respectively. S is the sample set, p n The proportion of category n in set S; feature importance weighting: Let the feature importance weight vector W∈R194, where the first 128 dimensions correspond to F cnn The weight is set to W. deep >1, the weights corresponding to the last 66 dimensions are set to W. handcrafted =1, and in actual splitting, the weighted importance of feature j is: , where I j W is a traditional feature importance score. j The weights are for the corresponding features.
[0038] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0039] This invention achieves integrated online detection of the surface features (diameter / ellipticity / straightness) and surface defects of tubes and bars, eliminating the problem of functional fragmentation. A vibration suppression device overcomes the effects of vibration and timing fluctuations, while a ring-shaped coaxial light source provides diffuse illumination to suppress metal reflections, ensuring data reliability under high-speed conditions. An ellipticity correction algorithm ensures the accuracy of surface parameters. An optimized three-point calculation model addresses the detection blind spots at the tube head and tail, enabling continuous detection of the entire length of tubes and bars. NSST image enhancement and the MobileNetV3-RF classification model improve the defect recognition rate. The system has a compact structure, can be installed on existing rolling production lines without cutting tubes and bars, and meets the requirements for online, rapid, and zero-contact detection.
[0040] This invention provides an integrated online inspection technology for long-axis tubes and bars, which effectively supports the whole-process quality monitoring of such materials and significantly improves production efficiency and product reliability under the "zero-defect" quality control standard. Attached Figure Description
[0041] To more clearly illustrate the technical solution of the present invention, the drawings used in the embodiments are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0042] Figure 1 This is a schematic diagram of the detection system layout in an embodiment of the present invention;
[0043] Figure 2 This is a schematic diagram of the installation of three sets of laser diameter measuring instruments in an embodiment of the present invention;
[0044] Figure 3 This is a schematic diagram showing the configuration of the laser emitter and laser receiver inside the laser diameter measuring instrument in this embodiment of the invention;
[0045] Figure 4 This is a schematic diagram of the installation of three sets of CCD line scan cameras in an embodiment of the present invention;
[0046] Figure 5 This is a schematic diagram of an idealized model of the elliptical cross-section of the tube or rod in an embodiment of the present invention.
[0047] Explanation of reference numerals in the attached figures:
[0048] 1. Control cabinet; 2. Vibration damping device; 3. Audible and visual alarm; 4. Laser diameter gauge; 5. Circular frame one; 6. CCD line scan camera; 7. Circular coaxial light source; 8. Circular frame two; 9. Tubes and bars; 10. Motor; 11. V-shaped roller conveyor; 12. Computer; 13. Monitor; 14. Support; 15. Laser emitter; 16. Laser receiver; 4-1. Laser diameter gauge one; 4-2. Laser diameter gauge two; 4-3. Laser diameter gauge three. Detailed Implementation
[0049] 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.
[0050] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0051] Example 1
[0052] like Figure 1 As shown, the present invention provides a system for detecting the geometric dimensions and surface defects of tubes and bars. The system includes: a control cabinet 1, vibration damping devices 2 (two sets), an audible and visual alarm 3, a laser diameter gauge 4 (including three sets of laser diameter gauges: laser diameter gauge 1 4-1, laser diameter gauge 2 4-2, and laser diameter gauge 3 4-3), a ring frame 1 5, a ring frame 2 8, CCD line array cameras 6 (three sets), a ring coaxial light source 7, tubes and bars 9, a motor 10, a V-shaped roller conveyor 11, a computer 12, a display 13, and a support 14 (three sets).
[0053] Computer 12 and display 13 are used to process and display the shape features and surface defects of tube 9;
[0054] The audible and visual alarm 3 is used to trigger an alarm when any parameter of the straightness, ovality, diameter, or identified defect level of the tube or rod 9 exceeds a set threshold.
[0055] Control cabinet 1 is used to control the start, stop and speed of motor 10;
[0056] Motor 10 is used to drive the V-shaped roller conveyor 11 to rotate, thereby conveying the tube and bar material 9;
[0057] A ring-shaped frame is used to fix and mount the CCD line scan camera 6 and the ring coaxial light source 7.
[0058] Bracket 14 is used to fix and install the laser diameter measuring instrument 4;
[0059] Vibration damping device 2 is used to eliminate mechanical vibration;
[0060] The ring-shaped coaxial light source 7 adopts a diffuse illumination method, and its illumination direction is consistent with the axial direction of the tube and rod 9, so as to obtain a uniform brightness distribution on the surface of the tube and rod 9.
[0061] Laser diameter measuring instrument 4 is used to collect the center coordinates and orthogonal diameters of pipe and rod 9, and take the average value of the orthogonal diameters as the cross-sectional diameter of pipe and rod 9; based on the elliptical cross-section model, a correction parameter M is introduced to calculate the true ellipticity of pipe and rod 9; combined with the optimized three-point method, the straightness of pipe and rod 9 at different positions is calculated.
[0062] The CCD line scan camera 6 is used to acquire circumferential images of the tube / rod 9. Through multi-level processing, the defect areas of the tube / rod 9 are located, the features of the tube / rod 9 are extracted, and the defects are classified using a cascaded model.
[0063] In this embodiment, three sets of laser diameter gauges 4 are arranged adjacent to each other along the axial direction of the tube / rod 9 at a fixed distance of L / 2, and their centers are located on the same straight line. Each set of laser diameter gauges 4 is used to obtain the position of the center of the tube / rod 9 at its axial position relative to the origin of the coordinate system of the set of laser diameter gauges 4. The three sets of laser diameter gauges 4 work together to obtain the positions of the center of the tube / rod 9 at three different axial positions relative to the origin of their respective coordinate systems.
[0064] Each laser diameter measuring instrument 4 is equipped with two photoelectric probes arranged at 90° to form a two-dimensional measurement system. The origin O is taken as the intersection of the optical axes of the two-dimensional measurement system, and the measurement directions of the two photoelectric probes are defined as the X-axis and Y-axis, respectively, to establish an OXY coordinate system. Each photoelectric probe includes a laser emitting end 15 and a laser receiving end 16. During the detection process, the photoelectric probe captures the edge position of the tube / rod 9 in real time and simultaneously calculates the diameter of the tube / rod 9 in the X-axis and Y-axis directions and the position of its center relative to the coordinate origin O.
[0065] In this embodiment, three sets of CCD line array cameras 6 are evenly distributed on the annular frame 5 along the circumference of the tube 9 to acquire circumferential images of the tube 9.
[0066] In this embodiment, the detection system includes two sets of vibration damping devices 2. According to the theoretical model of the measurement system, the three sets of laser diameter gauges 4 must be triggered synchronously to achieve accurate acquisition and real-time processing of the center coordinates of the tube / bar 9. However, due to the asynchronous nature of data transmission, the thread scheduling mechanism of the Windows operating system, and the timing jitter caused by multi-task processing, the actual measurement data has a millisecond-level time deviation. In addition, there are geometric errors such as vertical height deviation and horizontal center offset during the installation of each roller conveyor. When the tube / bar 9 is transported between roller conveyors, these installation errors will cause the tube / bar 9 to undergo abrupt changes in motion trajectory when passing through adjacent roller conveyors, generating mechanical impact and causing vibration. The millisecond-level time deviation makes it impossible to strictly synchronize the measurement data, and the mechanical vibration will further disturb the spatial sampling position of the center coordinates, seriously affecting the accuracy of the straightness calculation results. At the same time, the vibration will also affect the circumferential image quality of the tube / bar 9 acquired by the CCD line array camera 6, thereby interfering with the surface defect detection. In order to eliminate the influence of vibration on the straightness and surface defect detection of the tube / bar 9, this detection system is equipped with the aforementioned two sets of vibration damping devices 2.
[0067] In this embodiment, the detection system includes a ring-shaped coaxial light source 7. Since the object to be detected is a tube or rod 9 made of metal with a high gloss surface and non-planar shape, which is prone to strong reflection, the ring-shaped coaxial light source 7 adopts a diffuse illumination method, and its illumination direction is consistent with the axis direction of the rod, so that the surface of the tube or rod 9 can obtain a uniform brightness distribution, thereby improving the quality of the acquired image and simplifying the subsequent defect detection process.
[0068] The system installation steps are as follows:
[0069] Roller conveyor and drive installation: Fix the V-shaped roller conveyor 11 to the ground of the inspection station with anchor bolts, ensuring that the center line of the roller conveyor is consistent with the pre-set conveying direction of the tube / bar 9. Connect the motor 10 to the drive shaft of the V-shaped roller conveyor 11 through a coupling, and connect the power cable of the motor 10 to the control cabinet 1.
[0070] Vibration damping device 2 installation: Two sets of vibration damping devices 2 are installed at the key support points below the V-shaped roller conveyor 11 (near the installation area of the laser diameter gauge 4) to suppress vibrations caused by roller conveyor installation errors (vertical height difference, horizontal center offset) and ensure the accuracy of circle center coordinate measurement and image acquisition clarity.
[0071] Laser diameter gauge 4 installation: Use bracket 14 to fix and install the three sets of laser diameter gauges 4-1, 4-2, and 4-3 along the axial direction of the pipe / rod 9. Ensure that the centers of the three sets of laser diameter gauges 4 are on the same straight line, and the distance between adjacent laser diameter gauges 4 is precisely L / 2 (L is the length of the pipe / rod 9). Figure 2As shown, each group of laser diameter gauges 4 (such as laser diameter gauge 1 4-1) contains two photoelectric probes distributed in a 90° cross pattern (laser emission end 15 and laser reception end 16, as Figure 3 shown), forming an OXY precision two-dimensional measurement coordinate system.
[0072] Installation of the vision system: Slip ring frame 1 5 and slip ring frame 2 8 over the outside of the V-shaped roller path 11, and adjust their central axes to be strictly aligned with the axis of the tube or bar 9. Uniformly distribute and install three groups of CCD linear array cameras 6 (as Figure 4 shown) circumferentially on slip ring frame 1 5. Install a ring coaxial light source 7 on slip ring frame 2 8, with its illumination direction consistent with the axis direction of the tube or bar 9, providing uniform diffuse illumination for the circumferential surface of the tube or bar 9 and suppressing strong specular reflection on the metal surface.
[0073] Electrical connection: Connect the signal lines of the three groups of laser diameter gauges 4, the signal lines of the three groups of CCD linear array cameras 6, and the control line of the acoustic-optic alarm 3 to the computer 12. Connect the speed control signal line of the motor 10 to the control cabinet 1. The computer 12 is connected to a display 13 for result display.
[0074] The system debugging steps are as follows:
[0075] Mechanical debugging: Start the motor 10, adjust the speed control knob of the control cabinet 1 to make the V-shaped roller path 11 run at a constant speed at a typical production speed (such as 1 m / s), and observe the running stability. Adjust the vibration damping device 2 until the measured vibration amplitude drops below the allowable threshold to ensure the measurement accuracy of the center coordinates and the clarity of image acquisition.
[0076] Debugging of the laser diameter gauge 4: Place a standard calibration tube or bar 9 on the V-shaped roller path 11, and separately adjust the horizontal angles of the three groups of laser diameter gauges 4 (laser diameter gauge 1 4-1, laser diameter gauge 2 4-2, laser diameter gauge 3 4-3) to ensure that the X / Y measurement optical axes of their OXY coordinate systems are facing the cross-section of the tube or bar 9 to be measured. Through the software supporting the laser diameter gauge 4, check and calibrate the zero points and linearity of the two photoelectric probes (laser emission end 15 and laser reception end 16) of each group of laser diameter gauges 4. Configure the software on the computer 12 to ensure that the three groups of laser diameter gauges 4 can achieve millisecond-level synchronous data acquisition based on encoder signals or unified trigger signals.
[0077] Specifically, the process of adjusting the horizontal angles of the three sets of laser diameter gauges 4 (laser diameter gauge 1 4-1, laser diameter gauge 2 4-2, and laser diameter gauge 3 4-3) includes: Placing the high-precision standard calibrated tube / bar 9 (diameter tolerance ≤ ±0.01 mm) stably in the center of the V-shaped roller conveyor 11, ensuring that the axis of the tube / bar 9 is parallel to the conveyor's direction. For laser diameter gauge 1 4-1, loosen the horizontal rotation bolt of the bracket 14, and slightly rotate the laser diameter gauge 4 body (approximately ±5°), observing the X / Y diameter difference (|D1 - D2|) displayed on the software. When the difference is minimized (ideally close to 0), lock the horizontal rotation bolt of the bracket 14. Repeat this process, adjusting laser diameter gauge 2 4-2 and laser diameter gauge 3 4-3 in sequence.
[0078] The process of checking and calibrating the zero point and linearity of the two photoelectric probes of each laser diameter gauge 4 includes: Zero point calibration: Remove the calibration tube rod 9 to ensure that there are no objects obstructing the measurement area of the laser diameter gauge 4. Observe whether the diameter value in the X / Y direction displayed by the software is 0.000 mm; if the displayed value is not zero, adjust the probe circuit hardware knob (such as the gain adjuster) until the display returns to zero. Linearity calibration: Select three standard calibration tube rods 9 of different diameters (such as Ø10 mm, Ø20 mm, and Ø30 mm). Place each tube rod 9 in the measurement area in sequence, and the laser diameter gauge 4 synchronously collects the X / Y axis diameter data. Calculate the linearity error of the two probes (formula: error = (|measured value - true value| / true value) × 100%). If the linearity error exceeds the standard (such as an allowable error of 0.25%), the software will prompt for adjustment, and a correction coefficient will be entered for correction.
[0079] The process of configuring software on computer 12 to ensure that the three sets of laser diameter gauges 4 can achieve millisecond-level synchronous data acquisition based on encoder signals or a unified trigger signal includes:
[0080] 1. Hardware connection and signal integration:
[0081] Encoder signal input: The output signal of the rotary encoder of motor 10 is connected to computer 12 through a high-speed data acquisition card. The encoder outputs a fixed number of pulses per revolution, and the rising edge of the pulses serves as a unified trigger signal source to ensure that the triggering accuracy is not affected by software delay.
[0082] Laser diameter gauge 4 trigger interface configuration: The trigger terminals of each group of laser diameter gauges 4 (laser diameter gauge 1 4-1, laser diameter gauge 2 4-2, laser diameter gauge 3 4-3) are connected to the trigger output port of computer 12 via shielded cables. The laser diameter gauge 4 is set to "external trigger mode", so that it only starts data acquisition when it receives an encoder pulse signal.
[0083] Vibration damping device 2 works in conjunction with the hardware: at the hardware level, vibration damping device 2 reduces the mechanical vibration amplitude of the roller conveyor, reduces the impact of physical interference on the triggering timing, and provides a stable foundation for software synchronization.
[0084] 2. Software configuration and algorithm optimization:
[0085] Trigger signal binding: Configure the "synchronous acquisition module" in the software to map the encoder pulse signal to a global trigger event. Set the trigger frequency (e.g., 1kHz) to match the conveying speed of the tube / bar 9 (e.g., 1m / s) to ensure that each group of laser diameter gauges 4 starts data acquisition at the same time point (within ±0.1ms).
[0086] Timestamp calibration algorithm: A hardware timestamp mechanism is introduced (implemented using an FPGA board). Each set of data collected by the laser diameter gauge 4 is accompanied by a high-precision timestamp. The software dynamically calibrates timing deviations using the following formula: , among which, T i Let T be the pulse time of the i-th data set. ret The encoder pulse time is used. If the deviation ΔT > 0.1ms, the software automatically compensates for the delay to ensure strict alignment of the three sets of data. This algorithm differs from existing technologies (such as the Windows Timer API) by directly bypassing the operating system scheduling layer, thus avoiding thread jitter.
[0087] Real-time priority scheduling: In a Windows environment, set the main control software thread to "real-time priority" (Priority 31) and disable interrupt preemption. Configure a dedicated data buffer (DMA transfer) to ensure that the acquired data stream is transmitted to the processing unit in real time, avoiding packet loss caused by multitasking.
[0088] Vision system debugging: Turn on the ring coaxial light source 7 and adjust its brightness and uniformity. Open the camera acquisition software on the computer 12 and adjust the aperture, focal length and exposure time of the three sets of CCD line scan cameras 6 respectively to ensure that the acquired circumferential image of the tube 9 is clear, has uniform brightness and no obvious overexposure or reflective spots.
[0089] Specifically, the process of turning on the ring-shaped coaxial light source 7 and adjusting its brightness and uniformity includes:
[0090] Brightness adjustment: Adjust the light source drive current through control cabinet 1, with the initial value set to the intermediate value. Monitor the image grayscale histogram in real time in the acquisition software of computer 12. The target grayscale mean is 120 (±10). If the histogram is skewed to the right (overexposed), reduce the current in 0.1A increments; if it is skewed to the left (underexposed), increase the current in 0.1A increments until the grayscale histogram reaches the target grayscale.
[0091] Uniformity adjustment: The acquired image is displayed in real time in the camera software of computer 12. If there are bright or dark stripes or reflective spots in the image, the installation angle of the light source on the ring frame 2 8 is finely adjusted (within ±5° range) until the grayscale histogram distribution is concentrated.
[0092] The process of opening the camera acquisition software on computer 12 and adjusting the aperture, focal length, and exposure time of the three CCD line scan cameras 6 includes:
[0093] 1. Initial Setup and Preparation: Software Startup: Open the camera acquisition software on computer 12. The software interface simultaneously displays real-time preview images from three sets of CCD line scan cameras 6. Each camera's image is displayed independently for easy individual adjustment. Environmental Calibration: Ensure the annular coaxial light source 7 is turned on and its brightness and uniformity are adjusted to provide a stable lighting environment for the cameras. The tube / bar material 9 is placed statically on the V-shaped roller conveyor 11, with a clean and unobstructed surface. Layout Reference: The camera layout is as follows... Figure 4 As shown, three sets of cameras are evenly distributed circumferentially, covering the 360° surface of the tube / rod 9. During adjustment, it is necessary to maintain the consistency of the overlapping areas of the fields of view of each camera.
[0094] 2. Focus Adjustment: Ensure image sharpness. Procedure: Select the first camera group and freeze its image in the software. Manually rotate the camera's focus ring until the surface texture of the tube / bar 9 (such as metal grains or rolling lines) is clearly visible in the preview. Use software tools (such as edge sharpness analysis): Calculate the image gradient magnitude (Sobel operator), as shown in the following formula: Among them, G x and G y These represent the horizontal and vertical gradients, respectively. Adjust the focal length to maximize the mean gradient (indicating the sharpest edges). Repeat the above process, adjusting the focal lengths of the second and third camera groups sequentially. Ensure that the sharpness of the three camera groups is consistent (gradient mean difference ≤ 5%).
[0095] 3. Aperture Adjustment: Controls light intake and depth of field. Procedure: Initial Settings: Set the aperture of all three cameras to a uniform medium value (e.g., f / 5.6) to avoid insufficient light intake due to a too-small aperture. Brightness Assessment: Observe the grayscale histogram of the preview image. If the overall brightness is low (average <100), increase the aperture (e.g., adjust to f / 4); if there are overexposed areas (grayscale value ≥250), decrease the aperture (e.g., f / 8-f / 11). Suppressing Reflections: Metal surfaces are prone to reflective spots. If localized highlights are found, fine-tune the aperture to f / 8-f / 11 and use the diffusion effect of a ring light source to eliminate reflections. Consistency Check: The aperture values of the three cameras should be adjusted independently, but the final settings should be close (difference ≤ 1 stop) to ensure uniform brightness in the circumferential image.
[0096] 4. Exposure Time Adjustment: Optimize dynamic sharpness. Operation Steps: Static Calibration: Set the initial exposure time to 1ms. Check image brightness: If too dark, increase the exposure time in 10% increments; if too bright, decrease it. Target grayscale average is 120 (±10). Dynamic Test: Drive the V-shaped roller conveyor 11 at a working speed (e.g., 1m / s) along the tube / bar 9. Observe motion blur: If image blur (motion trailing) occurs, shorten the exposure time (e.g., 0.5ms). If the dynamic image is dim, appropriately increase the exposure time, but ensure the blur is controllable (edge displacement ≤ 2 pixels). Synchronization Verification: The exposure times of the three cameras must be strictly consistent (error ≤ 0.1ms) to avoid time-difference gaps in the stitched images.
[0097] 5. Overall Optimization and Validation: Uniformity Check: Using the uniformity analysis tool in the software, calculate the brightness variance of the three sets of camera images. ,in, I represents the number of images. i 'u' represents the average brightness, where 'u' is the pixel value. Target: Variance ≤ 100 (for the entire image). Overexposure detection: Run a speckle analysis algorithm to mark pixel areas with a grayscale value > 250. If reflective spots are found, fine-tune the aperture or exposure time of the corresponding camera and confirm the uniformity of the light source. Final saving: Save the optimized parameters (focal length, aperture, exposure time) to the camera configuration file and apply them synchronously to all three cameras.
[0098] System integration and debugging: Run the main control software of the detection system to simulate the conveying of pipe rod 9. Check whether the center coordinate data stream collected by the laser diameter gauge 4 is transmitted to the computer 12 in real time and synchronously. Check whether the images collected by the CCD line scan camera 6 are transmitted in real time and can be clearly displayed on the monitor 13. Test whether the audible and visual alarm 3 can be triggered normally when the simulated parameters exceed the limits.
[0099] Specifically, 1. Simulate conveying tube / bar material 9: Start the simulated working condition: Set the speed of motor 10 on control cabinet 1 to drive the V-shaped roller conveyor 11 at a typical production speed (e.g., 1 m / s). Place the standard test tube / bar material 9 (known diameter, straightness, and no surface defects) at the roller conveyor entrance to simulate the online inspection process. Start the "simulation inspection mode" through the main control software of computer 12, and the system automatically triggers data acquisition according to the preset program. Vibration suppression device 2 coordination: Activate two sets of vibration suppression devices 2 to suppress vibration caused by roller conveyor installation errors. Verify the vibration suppression effect: The software displays the vibration sensor data in real time (amplitude must be <5 μm) to ensure that the center coordinates and image acquisition are not disturbed.
[0100] 2. Laser Diameter Gauge 4 Data Stream Check: Synchronization Verification: Monitor the real-time data streams of the three laser diameter gauges (Laser Diameter Gauge 1 4-1, Laser Diameter Gauge 2 4-2, Laser Diameter Gauge 3 4-3) in the software interface; Center Coordinates: Display the dynamic updates of O1(a,b), O2(c,d), and O3(e,f); Orthogonal Diameters: Display the D1 and D2 values (for each laser diameter gauge 4 group). Check Data Synchronization: Timestamp Comparison: The time deviation of the three sets of data acquisition should be ≤0.5ms. Anomaly Handling: If data delay or loss is found, check the signal line connection or reconfigure the synchronization trigger parameters.
[0101] 3. CCD Camera Image Transmission Inspection: Real-time Performance and Sharpness Verification: Display the images captured by three sets of CCD line scan cameras 6 on the monitor 13 in a split-screen format: Image 1: View of the first set of cameras (circumferential 120° range); Image 2: View of the second set of cameras (adjacent 120° range); Image 3: View of the third set of cameras (remaining range). Inspection indicators: Real-time performance: Image frame rate ≥ 500fps (no stuttering), latency < 20ms; Sharpness: Surface texture and scratches of the tube / rod 9 are clearly visible (edge gradient ≥ 80); Brightness uniformity: Circumferential grayscale difference ≤ 15% (no overexposure / reflective spots).
[0102] 4. Audible and Visual Alarm Trigger Test: Parameter Over-Limit Simulation: Set thresholds in the software: Diameter tolerance: ±0.1mm; Ellipticity upper limit: 1.5%; Straightness upper limit: 0.2mm / m; Defect level: Crack > 2mm is a severe defect. Simulate over-limit scenarios: Surface parameter over-limit: Input a set of out-of-tolerance center coordinates (e.g., δ > 0.3mm / m); Defect trigger: Mark the simulated crack area (length > 3mm) in the camera view; Alarm response check: Audible and visual alarm 3 should trigger immediately: Audible alarm: ≥85dB buzzer sound; Visual alarm: red warning light flashing; Software synchronous response: Display 13 highlights the location of the over-limit parameters (e.g., "Pipe tail straightness over-tolerance: 0.35mm / m"); Database records event logs (time, parameter value, defect image).
[0103] Example 2
[0104] This invention also provides a method for detecting the geometric dimensions and surface defects of tubes and rods. This method is implemented using the system described in Example 1, and detects straightness, ovality, diameter, and surface defects such as cracks, scales, scratches, and pitting in the tubes and rods 9. The method includes:
[0105] Collect the center coordinates and orthogonal diameters of the tube / rod 9, and take the average of the orthogonal diameters as the cross-sectional diameter of the tube / rod 9; based on the elliptical cross-section model, introduce the correction parameter M to calculate the true ellipticity of the tube / rod 9; combine the optimized three-point method to calculate the straightness of the tube / rod 9 at different positions;
[0106] The circumferential images of the tube / rod 9 are acquired. Through multi-level processing, the defect areas of the tube / rod 9 are located, the features of the tube / rod 9 are extracted, and the defects are classified using a cascaded model.
[0107] In this embodiment, the method for calculating the true ellipticity of the tube / rod material 9 based on the elliptical cross-section model and the introduction of a correction parameter M includes:
[0108] Data acquisition: The tube / bar 9 moves at a constant speed on the V-shaped roller conveyor 11. Three sets of laser diameter gauges 4 (laser diameter gauge 1 4-1, laser diameter gauge 2 4-2, and laser diameter gauge 3 4-3) are triggered synchronously to acquire the diameter values of their respective cross sections in the mutually perpendicular directions (X / Y) in their respective OXY coordinate systems in real time, and calculate the center coordinates O1(a, b), O2(c, d), and O3(e, f).
[0109] The laser diameter gauge 4-1 measures the diameters of a bar in the X and Y axes, D1 and D2, respectively. The formulas for calculating the bar diameter D and ellipticity T are as follows:
[0110] The diameter D is calculated as follows: the arithmetic mean of the diameters measured by the laser diameter gauge 4-1 in the X / Y directions is taken as the current cross-sectional diameter.
[0111] ;
[0112] Initial ellipticity: Using the diameters D1 and D2 in mutually perpendicular directions measured by the laser diameter gauge 4-1, the initial ellipticity value is calculated as follows:
[0113] ;
[0114] The formula for calculating the true ellipticity of tube / bar material 9 is as follows:
[0115] ;
[0116] Among them, D max D min Let be the actual maximum and minimum diameters of the tube / rod 9, respectively. Analysis of the above ellipticity calculation formula shows that, given that this system can only measure the diameters of the tube / rod 9 in two mutually perpendicular directions, and the actual maximum and minimum diameters of the tube / rod 9 are not necessarily distributed at 90° perpendicularly, the ellipticity measurement value deviates from the true value. Therefore, a correction parameter needs to be introduced. Considering the complexity of the cross-sectional shape of the tube / rod 9, for ease of study, it is now idealized as an elliptical cross-section, as shown below. Figure 5As shown. Assume that when the pipe / rod 9 is actually at position 2, the diameters D1 and D2 measured by the laser diameter gauge 4 are located in directions 2' and 2" respectively, while the actual maximum / minimum diameter of the ideal elliptical cross-section of the pipe / rod 9 is located in measurement directions 1' and 1" respectively. Define the correction parameter as M, let the major semi-axis of the ellipse be A, the minor semi-axis be B, and the pipe diameter D1 (radius R1) measured by the laser diameter gauge 4 in the X-axis direction is greater than the diameter D2 (radius R2) in the Y-axis direction. In the triangle with R1 and R2 as legs, the included angle corresponding to R2 is θ. For example... Figure 5 As shown, when the tube / rod 9 is in position 1, the included angle θ is the smallest, equal to θ1, and when the tube / rod 9 is in position 3, the included angle θ is the largest, equal to 45°.
[0117] When tube / rod 9 is in position 1:
[0118] ;
[0119] ;
[0120] ;
[0121] Therefore, the range of θ is [arctan(B / A), 45°]. Calculate the average value of T over the range [arctan(B / A), 45°].
[0122] ;
[0123] ;
[0124] Therefore, the final formula for correcting the ellipticity of the pipe used in the calculation is as follows:
[0125] ;
[0126] The correction factor M is obtained in the following way: First, a number of tubes and bars 9 are randomly selected from the batch using a high-precision measurement method to obtain their true ellipticity; then, the correction factor M applicable to the entire batch of tubes and bars 9 is calculated in reverse according to the above formula.
[0127] In this embodiment, the method for calculating the straightness of the tube / rod 9 at different positions using the optimized three-point method includes:
[0128] Three sets of laser diameter gauges 4 respectively collect the center coordinates O1(a, b), O2(c, d), and O3(e, f) of the tube / rod 9 at three different axial positions. When the tube / rod 9 is completely within the measurement area, the straightness of the tube / rod 9 is calculated based on the traditional three-point method. The formula for calculating the straightness of the main body of the tube / rod 9 is as follows:
[0129] ;
[0130] ;
[0131] ;
[0132] Where, δ x It is the straightness of the main body of tube / rod 9 in the X direction, δ y δ is the straightness of the main body of tube / rod 9 in the Y direction, and δ is the overall straightness of the main body of tube / rod 9.
[0133] The traditional three-point method can only calculate the straightness of the main body of the tube / bar 9, leaving a section of length L / 2 at both the starting end (head) and the ending end (tail) uncovered. To overcome this deficiency, this method proposes a new method for calculating the straightness of the head and tail sections:
[0134] Assume the length of the bar is L, and it moves in a predetermined direction:
[0135] Head straightness calculation: When the head of the tube / rod 9 is fully inside the laser diameter gauge 3 (4-3), the tube head straightness calculation is initiated. Based on the center coordinates of the circles collected by laser diameter gauge 1 (4-1) and laser diameter gauge 2 (4-2), a straight line is fitted, and the perpendicular distance from the center coordinates of laser diameter gauge 3 (4-3) to this straight line is calculated; this is the tube head straightness. This process is completed during the L / 2 distance movement after the head of the tube / rod 9 has fully passed through laser diameter gauge 3 (4-3).
[0136] The formula for calculating the straightness of the head of tube / bar 9 is as follows:
[0137] ;
[0138] ;
[0139] ;
[0140] Where L / 2 is the installation spacing of the laser diameter gauge 4, δx1 is the straightness of the head of the tube / rod 9 in the X direction, δy1 is the straightness of the head of the tube / rod 9 in the Y direction, and δ1 is the total straightness of the head of the tube / rod 9. L is the length of the rod, which is needed for the straightness calculation at the tail of the tube / rod 9.
[0141] Tail-end straightness calculation: When the head of the tube / rod 9 has completely passed the laser diameter gauge 3-4-3 and continues to move a distance L-3L / 2, the tail-end straightness calculation is initiated. Based on the center coordinates of the circles collected by the laser diameter gauge 2-4-2 and the laser diameter gauge 3-3, a straight line is fitted, and the perpendicular distance from the center coordinates of the laser diameter gauge 1-4-1 to this straight line is calculated, which is the tail-end straightness. This calculation is completed synchronously with the complete removal of the tail of the tube / rod 9 from the laser diameter gauge 1-4-1.
[0142] The formula for calculating the straightness of the tail section of tube / bar 9 is as follows:
[0143] ;
[0144] ;
[0145] ;
[0146] Wherein, δx2 is the straightness of the tail of the tube / rod 9 in the X direction, δy2 is the straightness of the tail of the tube / rod 9 in the Y direction, and δ2 is the total straightness of the tail of the tube / rod 9.
[0147] In this embodiment, the method of acquiring circumferential images of the tube / rod 9, locating defect areas of the tube / rod 9 through multi-level processing, extracting features of the tube / rod 9, and classifying defects using a cascaded model includes:
[0148] Step 1: Image Acquisition and Preprocessing
[0149] Three sets of CCD line array cameras 6, under the illumination of the ring coaxial light source 7, synchronously acquire circumferential images of the tube / rod 9, denoted as I(x,y), where x and y are the horizontal and vertical coordinates of the image, respectively.
[0150] (1) NSST decomposition: Perform non-subsampled shear wave transform (NSST) on each image I(x,y) to decompose it into low-frequency subband L(x,y) and high-frequency subband H. k (x,y) (where k=1,2,…,K represents different scale and orientation sub-bands), {L(x,y),H k (x,y)}=NSST{I(x,y)}. The low-frequency subband L(x,y) contains the main illumination and structural information of the image; the high-frequency subband H... k (x,y) contains details, noise, and defect edge information.
[0151] (2) Low-frequency processing: Gaussian filtering is applied to the low-frequency subband L(x,y) to suppress background noise caused by uneven illumination: L filtered (x,y)=L(x,y)∗G(x,y,σ), where * denotes convolution. Let σ be the Gaussian kernel function and σ be the standard deviation.
[0152] (3) High-frequency processing: processing the high-frequency subband H k Anisotropic diffusion filtering (Perona-Malik model) is applied to (x,y) for denoising while preserving edge details:
[0153] This represents the rate of change of the image over diffusion time, where, This is the gradient operator used to calculate the gradient magnitude of an image; t is time, and the diffusion coefficient is... , For all pixel values in the k-th high-frequency subband image.
[0154] Further gamma correction is applied to the high-frequency subband to enhance the contrast between weak defects and the background:
[0155] ,in , These are the minimum and maximum values of all pixel values in the k-th high-frequency sub-band image, respectively;
[0156] Among them, γ<1 is used to enhance shadow details.
[0157] (4) Image reconstruction: The processed low-frequency subband L filtered (x,y) and high-frequency subband H k , enhanced (x,y) is reconstructed using the inverse NSST transform to obtain the enhanced, clear image I. enhanced (x,y):
[0158] I enhanced (x,y)=NSST −1 {L filtered (x,y),H k,enhanced (x,y)}.
[0159] Step 2: Morphological optimization of the reconstructed image:
[0160] Opening operation (erosion followed by dilation): Uses a 13×13 pixel rectangular structuring element to eliminate salt-and-pepper noise (white noise) in the image. Closing operation (dilation followed by erosion): Uses the same structuring element to fill small holes and connect adjacent areas.
[0161] Step 3: Defect Area Location:
[0162] (1) Sobel edge detection:
[0163] The morphologically optimized image I was computed using the Sobel operator. ’ enhanced The gradient magnitude at (x,y) highlights the defect edges. The horizontal convolution kernel G of the Sobel operator... x and vertical convolution kernel G y They are respectively:
[0164] , ;
[0165] The gradient magnitude is calculated as follows: .
[0166] (2) Hough transform excludes the end-face marked region:
[0167] The Hough transform is used to detect straight lines and circular regions (such as end-face stamps and end-cut marks) in an image. Its parametric equations are as follows:
[0168] Line detection (polar coordinates): ;
[0169] Where ρ is the distance from the line to the origin, and θ is the angle.
[0170] Circular detection: ;
[0171] Where (a,b) is the center of the circle and r is the radius.
[0172] By setting a reasonable parameter range, such as θ∈[0,π], r∈[r] min ,r max Identify and exclude these non-defect areas to avoid false detections. min ,r max These are the minimum and maximum values of the radius, respectively.
[0173] (3) Otsu adaptive threshold segmentation:
[0174] The Otsu method binarizes the gradient image G(x,y) by maximizing the inter-class variance. Automatically determine the optimal threshold T: ;
[0175] Where w0 and w1 are the foreground and background pixel proportions, respectively, and u0 and u1 are their average values. Optimal threshold T ∗ satisfy: ;
[0176] The binarized image B(x,y) is: .
[0177] (4) Connected component analysis:
[0178] Connected component labeling is performed on the binary image B(x,y) to initially locate candidate defect regions. Let R... i Let R be the i-th connected region, which satisfies: i ={(x,y)|B(x,y)=1 and all adjacent pixels are connected}, by calculating the geometric features of each connected region (such as area, bounding rectangle, center position, etc.), possible defective regions are screened out and small connected regions caused by noise are eliminated.
[0179] Step 4: Defect Feature Extraction
[0180] Close the candidate defect region and connect the fractured parts caused by lighting or noise. Extract the skeleton of slender defects (such as scratches) and analyze their length, orientation and other characteristics.
[0181] (1) Geometric characteristic expression:
[0182] Area: A = the total number of pixels in the defect area;
[0183] Aspect Ratio: ;
[0184] Where W and H are the width and height of the minimum bounding rectangle of the defect, respectively.
[0185] Circularity: ;
[0186] Where A is the area and P is the perimeter of the defect profile. (The closer the value is to 1, the closer the shape is to a circle).
[0187] (2) Texture feature expression:
[0188] Local Binary Pattern (LBP) Histogram: Using the Uniform Pattern dimensionality reduction strategy, the LBP features are compressed into a 59-dimensional histogram (58 uniform patterns + 1 non-uniform pattern merging dimension).
[0189] Gray-Level Co-occurrence Matrix (GLCM) Characteristics: Let P(i,j) be the value at position (i,j) in the GLCM, and N be the number of gray levels. Energy: Contrast: Entropy: .
[0190] (3) Deep feature expression:
[0191] Defect Concavity / Elevation (D3d): The maximum concavity / elevation depth of the defect region is calculated by reconstructing the 3D point cloud of the defect region using multi-view stereo vision. , where z i Let be the height value of the i-th point in the defect region.
[0192] Step 5: Defect Identification and Classification:
[0193] Load the offline pre-trained MobileNetV3-RF cascade classification model. MobileNetV3, as a lightweight CNN, extracts deep features in real time; Random Forest (RF) uses geometric, texture, and deep features for classification decisions. Input the extracted features into the classification model, and output the defect type (crack, scar, scratch, pit, etc.) and its location information on the surface of the tube / bar 9 in real time.
[0194] The MobileNetV3-RF cascade classification model structure is as follows:
[0195] Front-end feature extraction layer (MobileNetV3):
[0196] Lightweight feature extraction at the front end: MobileNetV3 (Small) is used as the backbone network, and the input size is adjusted to 512×512×3 (adapted to the circumferential image of tube / rod material 9). Deep semantic features are extracted while ensuring real-time performance through depthwise separable convolution and a Squeeze-and-Excitation module. Output: A 128-dimensional feature vector F after the last layer of global average pooling (GAP). cnn Used to represent deep semantic information extracted from images. Fusion with traditional features: The F features extracted by MobileNetV3 are... cnn Concatenated with the multimodal handcrafted features extracted in step four: Handcrafted feature vector: F handcrafted =[A,AR,C,F lpb T ,E,Con,Ent,D3d] T Used to describe the geometric, textural, and 3D morphological features of defective regions in an image, where A is the area, AR is the aspect ratio, C is the roundness, and F is the area. lpb T It is a local binary mode histogram feature vector, where E, Con, and Ent are the energy, contrast, and entropy of the gray-level co-occurrence matrix features, respectively, and D3d is the defect concavity and convexity. The dimensional composition is: geometry (3) + LBP (59) + GLCM (3) + depth (1) = 66 dimensions. Mixed feature vector: F fused =[F cnn T F handcrafted T ] T Dimensional composition: MobileNetV3 features (128) + handcrafted features (66) = 194 dimensions; Concatenation operation: F cnn With F handcrafted Concatenate along the column vector direction.
[0197] Backend classification decision layer (Random Forest):
[0198] Input: Mixed features F fused Parameter Design: Number of Trees: Let N be the number of decision trees in the random forest. trees =200, to balance classification accuracy and inference speed; Maximum depth: A dynamic adjustment strategy is adopted, pruning is performed based on feature importance to avoid overfitting. Let the maximum depth of the t-th tree be D. t It satisfies: D minI is the minimum depth threshold. t Let S be the weighted sum of the feature importance of the t-th tree, where α is the scaling factor. Splitting criterion: Minimize Gini impurity. For the feature subset S at node q... q Select feature j and splitting threshold v to minimize Gini impurity: ,in, For the feature subset S at node q q The sum of Gini impurities when selecting feature j and splitting threshold v is used to evaluate the splitting effect; S L and S R These are the left and right subsets after the split; , These are the Gini impurities of the left and right subsets after the split, respectively. S is the sample set, p n Let be the proportion of category n in set S. Feature importance weighting: To enhance the identification of key defects, the deep features extracted by MobileNetV3 are given higher weights. Let the feature importance weight vector W∈R194, where the first 128 dimensions (corresponding to F) cnn The weight of ) is set to W. deep >1, the last 66 dimensions (with corresponding weights set to W) handcrafted =1). In actual splitting, the weighted importance of feature j is: , where I j W is a traditional feature importance score. j The weights are assigned to the corresponding features. Higher weights are given to the deep features extracted by MobileNetV3 to enhance the model's ability to identify key defects.
[0199] In this embodiment, quality judgment and alarm:
[0200] Computer 12 compares the real-time calculated surface parameters (diameter, ellipticity, straightness) with preset thresholds. Simultaneously, it compares the defect identification results (defect type, size, location) with defect level standards. If any surface parameter exceeds the tolerance range, or an over-limit defect (such as a severe crack) is detected, the audible and visual alarm 3 is immediately triggered, and the location of the unqualified pipe / bar 9 and the over-limit parameter / defect information are highlighted on the display 13. All detection data (raw data, processing results, alarm records) are stored in a database for quality traceability and analysis.
[0201] Compared with existing technologies, the beneficial effects of this embodiment are as follows: This invention integrates three sets of laser diameter gauges 4, three sets of CCD line array cameras 6, a vibration damping device 2, and a ring coaxial light source 7, combined with innovative detection algorithms (ellipticity correction, tube head and tail straightness compensation, NSST image enhancement, and MobileNetV3-RF classification), to achieve integrated, high-precision, full-length detection of the geometric features (diameter, ellipticity, straightness) and surface defects (cracks, scabs, etc.) of tubes and bars 9 under high-speed online conditions. The vibration damping device 2 effectively overcomes vibration and timing jitter, the ring coaxial light source 7 solves the problem of strong metal reflection, the ellipticity correction algorithm ensures parameter accuracy, the optimized three-point method model eliminates the blind spots in tube head and tail detection, and the advanced image processing and classification model improves the defect recognition rate. The system has a compact structure and can be directly integrated into existing rolling production lines, meeting the stringent requirements of "zero contact, online, fast, and full inspection," significantly improving production efficiency and product quality.
[0202] The embodiments described above are merely preferred embodiments of the present invention and are not intended to limit the scope of the present invention. Various modifications and improvements made by those skilled in the art to the technical solutions of the present invention without departing from the spirit of the present invention should fall within the protection scope defined by the claims of the present invention.
Claims
1. A system for detecting the geometric dimensions and surface defects of tubes and bars, characterized in that, The system includes: three sets of laser diameter measuring instruments, three sets of CCD line scan cameras, a computer and monitor, an audible and visual alarm, two sets of vibration damping devices, a ring coaxial light source, a control cabinet, a motor, a V-shaped roller conveyor, two sets of ring frames, and three sets of supports. The computer and display are used to process, calculate, and display the shape features and surface defects of the tubes and bars; The audible and visual alarm is used to trigger an alarm when any parameter of the straightness, ellipticity, diameter, or identified defect level of the tube or rod exceeds a set threshold. The control cabinet is used to control the start, stop and speed of the motor; The motor is used to drive the V-shaped roller conveyor to rotate, thereby conveying the tubes and bars; The ring frame is used to fix and mount the CCD line scan camera and the ring coaxial light source; The bracket is used to fix and install the laser diameter measuring instrument; The vibration damping device is used to eliminate mechanical vibration; The annular coaxial light source uses diffuse illumination, and its illumination direction is consistent with the axial direction of the tube or rod, so as to obtain a uniform brightness distribution on the surface of the tube or rod. The laser diameter measuring instrument is used to acquire the center coordinates and orthogonal diameters of the pipe / rod, and the average of the orthogonal diameters is taken as the cross-sectional diameter of the pipe / rod; a correction parameter is introduced based on the elliptical cross-section model. M Calculate the true ellipticity of the tube / bar; combine the optimized three-point method to calculate the straightness of the tube / bar at different positions. The CCD line scan camera is used to acquire circumferential images of the tubes and bars, and through multi-level processing, locate the defect areas of the tubes and bars, extract the features of the tubes and bars, and classify the defects using a cascaded model. A method for detecting the geometric dimensions and surface defects of pipes and bars, the method comprising: The center coordinates and orthogonal diameters of the tube / rod are collected, and the average of the orthogonal diameters is taken as the cross-sectional diameter of the tube / rod. Correction parameters are introduced based on the elliptical cross-section model. M Calculate the true ellipticity of the tube / bar; combine the optimized three-point method to calculate the straightness of the tube / bar at different positions. The circumferential images of the tubes and bars are acquired, and through multi-level processing, the defect areas of the tubes and bars are located, the features of the tubes and bars are extracted, and the defects are classified using a cascaded model. The method for acquiring circumferential images of pipes and bars, locating defect areas through multi-level processing, extracting features of the pipes and bars, and classifying defects using a cascaded model includes: Step 1: Perform non-subsampled shear wave transform (NSST) decomposition on the circumferential images of the tube / rod acquired by three sets of CCD linear array cameras to obtain low-frequency and high-frequency subbands; perform Gaussian filtering on the low-frequency subband to suppress illumination unevenness noise; perform anisotropic diffusion denoising on the high-frequency subband while preserving edges, and supplement with gamma correction to enhance the contrast of weak defects; reconstruct the processed low-frequency and high-frequency subbands using inverse NSST transform. Step 2: Morphological optimization of the reconstructed image: Opening operation is used to eliminate white noise, and closing operation is used to fill holes; the structuring element size is 13×13 pixels; Step 3: Based on the optimized reconstructed image, extract edge gradients using the Sobel operator; use Hough transform to identify and exclude end-face marked regions of the tube or rod; locate candidate defect regions based on Otsu adaptive threshold segmentation combined with connected component analysis. Step 4: Apply a closing operation to the candidate defects to connect the fracture regions; extract the skeleton to analyze slender defects; calculate geometric features, texture features and depth features based on 3D point cloud reconstruction. Among them, geometric features include: area, aspect ratio and roundness, and texture features include: Local Binary Pattern (LBP) and Gray-Level Co-occurrence Matrix (GLCM). Step 5: Load the offline trained MobileNetV3-RF cascade classification model; classify the defect region in real time and output the type and location information; The MobileNetV3-RF cascaded classification model structure includes: a front-end feature extraction layer, namely MobileNetV3, and a back-end classification decision layer, namely Random Forest (RF). The front-end feature extraction layer employs MobileNetV3 as its backbone network, with the input size adjusted to 512×512×3. It extracts deep semantic features while maintaining real-time performance through depthwise separable convolutions and a Squeeze-and-Excitation module. The output is a 128-dimensional feature vector F obtained after global average pooling (GAP) in the final layer. cnn Used to represent the depth semantic information extracted from the image; the F extracted by MobileNetV3 cnn Concatenated with extracted multimodal handcrafted features: Handcrafted feature vector: F handcrafted =[A,AR,C,F lpb T ,E,Con,Ent,D3d] T Used to describe the geometric, textural, and 3D morphological features of defective regions in an image, where A is the area, AR is the aspect ratio, C is the roundness, and F is the area. lpb T It is a local binary mode histogram feature vector, where E, Con, and Ent are the energy, contrast, and entropy of the gray-level co-occurrence matrix features, respectively, and D3d is the defect concavity and convexity. The dimensional composition is: geometry (3) + LBP (59) + GLCM (3) + depth (1) = 66 dimensions; the mixed feature vector is: F fused =[F cnn T F handcrafted T ] T Dimensional composition: MobileNetV3 features (128) + handcrafted features (66) = 194 dimensions; concatenation operation: F cnn With F handcrafted Concatenate along the column vector direction; Backend classification decision layer: Input: Mixed features F fused Parameter Design: Number of Trees: Let N be the number of decision trees in the random forest. trees =200, to balance classification accuracy and inference speed; Maximum depth: adopts a dynamic adjustment strategy, pruning according to feature importance, let the first... t The maximum depth of the trees is D t It satisfies: ,in D min Minimum depth threshold, I t For the first t Weighted sum of the importance of the features of each tree. Scaling factor; Splitting criterion: adopted Gini The principle of minimizing impurity; for nodes q Feature subset of the location S q Select features j and splitting threshold v To minimize Gini Impurity: ,in, For the node q Feature subset of the location S q Select features j and splitting threshold v time Gini The sum of impurities is used to evaluate the splitting effect; S L and S R These are the left and right subsets after the split; , These are the left and right subsets after the split. Gini Impurity; , S For the sample set, p n For category n In the set S The proportion in; feature importance weighting: Let the feature importance weight vector be... W ∈R194, where the first 128 dimensions correspond to F cnn The weight is set to W. deep >1, the weights corresponding to the last 66 dimensions are set to W. handcrafted =1, during actual splitting, characteristic j The weighted importance is: ,in I j For traditional feature importance scores, W j The weights are for the corresponding features; Methods for calculating the straightness of pipes and bars at different positions using the optimized three-point method include: Three sets of laser diameter gauges respectively collected the center coordinates O1 of the pipe / rod at three different axial positions. a , b ), O2( c , d ), When the pipe or rod is fully inside the measurement area, the straightness of the pipe or rod is calculated based on the traditional three-point method. The formula for calculating the straightness of the main body of the pipe or rod is as follows: ; ; ; in, δ x It refers to the straightness of the main body of the tube or bar in the X direction. δ y It refers to the straightness of the main body of the tube or rod in the Y direction. δ It refers to the overall straightness of the main body of the tube or bar material; Methods for calculating the straightness of the head and tail: Let the length of the bar be... L And move in the set direction: Head straightness calculation: When the head of the pipe or rod is completely inside laser diameter gauge three, the pipe head straightness calculation is initiated. Based on the center coordinates of the circles collected by laser diameter gauge one and laser diameter gauge two, a straight line is fitted, and the perpendicular distance from the center coordinates of laser diameter gauge three to this straight line is calculated, which is the pipe head straightness. This process continues after the head of the pipe or rod has completely passed through laser diameter gauge three. L Completed during a distance of / 2; The formula for calculating the straightness of the head of a pipe or bar is as follows: ; ; ; in, L / 2 is the installation spacing of the laser diameter gauge. δx 1 refers to the straightness of the head of the tube or bar in the X direction. δy 1 refers to the straightness of the head of the tube or bar in the Y direction. δ 1 refers to the overall straightness of the head of the tube or bar. L This refers to the length of the bar stock, which is needed for calculating the straightness of the tail section of the tube / bar stock during startup. Tail straightness calculation: After the head of the pipe or rod has completely passed the laser diameter gauge and continues to move a distance... L —3 L At / 2, the pipe tail straightness calculation is started. Based on the center coordinates of the circle collected by laser diameter gauge 2 and laser diameter gauge 3, a straight line is fitted. The vertical distance from the center coordinates of laser diameter gauge 1 to this straight line is calculated, which is the pipe tail straightness. This calculation is completed simultaneously with the complete removal of the tail of the pipe from laser diameter gauge 1. The formula for calculating the straightness of the tail section of a tube or bar is as follows: ; ; ; in, δx 2 refers to the straightness of the tail section of the tube or bar in the X direction. δy 2 is the straightness of the tail of the tube or bar in the Y direction, and δ2 is the overall straightness of the tail of the tube or bar.
2. The system according to claim 1, characterized in that, The three sets of laser diameter gauges are spaced at fixed intervals along the axial direction of the pipe / rod. L / 2 adjacent arrangement, where, L The length of the tube or bar is such that its center is on the same straight line. Each set of laser diameter gauges is used to obtain the position of the center of the tube or bar at its axial position relative to the origin of the coordinate system of the set of laser diameter gauges. The three sets of laser diameter gauges work together to obtain the positions of the center of the tube or bar at three different axial positions relative to the origin of their respective coordinate systems. Each laser diameter measuring instrument is equipped with two photoelectric probes arranged at 90° to form a two-dimensional measurement system. The origin O is the intersection of the optical axes of this two-dimensional measurement system, and the measurement directions of the two photoelectric probes are defined as the X-axis and Y-axis, respectively, to establish an OXY coordinate system. Each photoelectric probe includes a laser emitting end and a laser receiving end. During the detection process, the photoelectric probe captures the edge position of the tube or rod in real time and simultaneously calculates the diameter of the tube or rod in the X-axis and Y-axis directions and the position of its center relative to the coordinate origin O.
3. The system according to claim 1, characterized in that, Three sets of CCD line array cameras are evenly distributed along the circumference of the tube / rod on the ring frame to acquire circumferential images of the tube / rod.
4. The system according to claim 1, characterized in that, Based on the elliptical section model, correction parameters are introduced. M The process of calculating the true ellipticity of tubes and bars includes: ; in, , These are the maximum and minimum diameters of the pipe / rod measured by a laser diameter gauge.
Citation Information
Patent Citations
Linearity online detection device and method in long material straightening work procedure
CN106767557A
Improved bar straightness detection system and method based on visual detection
CN110926378A
Device for detecting surface defects and straightness of large-diameter welded pipe
CN119715604A