System and method for detecting geometric dimensions and surface defects of pipes and bars

By integrating a laser diameter gauge, a CCD linear array camera, and a vibration damping device into a detection system, and combining an elliptical section model and a cascade model, the problem of simultaneous detection of tube and bar profile parameters and surface defects under high-speed rolling conditions was solved, achieving efficient and reliable "zero-defect" quality control.

CN121323508AActive Publication Date: 2026-01-13TAIYUAN UNIVERSITY OF SCIENCE AND TECHNOLOGY +1

Patent Information

Application Number
CN202511883446.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-15
Publication Date
2026-01-13
Estimated Expiration
2045-12-15

AI Technical Summary

Technical Problem

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.

Method used

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.

Benefits of technology

It enables integrated online detection of tube and bar profile features and surface defects, eliminating functional disconnect, ensuring data reliability, improving production efficiency and product reliability, and meeting the needs of full-process quality monitoring.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121323508A_ABST
    Figure CN121323508A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of measuring equipment, and discloses a system and a method for detecting geometric dimensions and surface defects of tubes and bars, and the system comprises a laser diameter measuring instrument, a CCD (Charge Coupled Device) linear array camera and other core components. During detection, the laser diameter measuring instrument collects the circle center coordinate and the orthogonal diameter of the pipe bar, and the mean value of the double diameters is taken as the section diameter; introducing a correction parameter M based on the elliptical cross section model to calculate the real ovality; and the straightness of different positions of the pipe bar is calculated by combining an optimized three-point method. Meanwhile, a CCD camera is used for collecting circumferential images, defect areas are positioned through multi-step processing, features are extracted, and defects are classified through a cascade model. The system realizes synchronous online detection of geometric dimensions and surface defects of the pipes and the bars, breaks through the problems of single function, poor interference resistance, low efficiency and the like, and meets the strict standard of high-end manufacturing industry on the quality of the pipes and the bars.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the technical field of measuring equipment, and particularly relates to a pipe and bar geometric size and surface defect detection system and method. BACKGROUND

[0002] Pipe and bar as a key structural component in the fields of aerospace, nuclear power, precision equipment, etc., its shape features (such as diameter, ovality, straightness) and surface defects (such as cracks, scarring, scratches) directly affect the safety and service life of the component. Current industrial detection is facing severe challenges: traditional detection methods have serious functional fragmentation, shape parameter measurement relies on contact equipment or special instruments, although high precision can be achieved, but surface micro-defects cannot be identified simultaneously; while the surface defect detection system based on machine vision can capture microscopic defects, but it is difficult to reconstruct three-dimensional shape features. This step-by-step detection mode not only greatly reduces the production line efficiency, but also causes data asynchrony due to the separation of equipment, resulting in detection blind area. Especially for long-axis pipe and bar, existing roundness instruments and other equipment are limited by physical specifications and can only perform offline sampling inspection on the intercepted pipe section, which cannot meet the rigid demand of continuous production for full-length quality monitoring. High-speed rolling conditions further exacerbate the technical bottleneck: mechanical vibration causes data distortion of laser displacement sensors, motion blur causes a sharp decline in defect recognition rate of the vision system, and the strong light reflection characteristics of the metal surface further interfere with the accuracy of optical measurement. The industry attempts to improve through parallel connection of multiple sensors or structured light scanning, but still has the essential defects of large space-time matching error, high reconstruction failure rate, and insufficient real-time performance. Therefore, it is urgent to develop an integrated online detection system that combines multi-modal sensing and intelligent algorithms to simultaneously achieve micron-level measurement of shape parameters and sub-pixel-level identification of surface defects under high-speed running conditions, breaking through the three technical barriers of functional fragmentation, poor anti-interference performance, and low efficiency, and meeting the stringent standards of "zero defects" for pipe and bar in high-end manufacturing. SUMMARY

[0003] To solve the problems existing in the prior art, the present application provides a pipe and bar geometric size and surface defect detection system and method, which provides a full-process quality monitoring solution for high-end manufacturing and significantly improves production efficiency and product reliability under the "zero defect" quality control standard.

[0004] To achieve the above-mentioned purpose, the present application provides the following solutions:

[0005] A pipe and bar geometric size and surface defect detection system, the system comprising: three sets of laser diameter gauges, three sets of CCD line array cameras, a computer and a display, an audible-visual alarm, two sets of vibration suppression devices, a ring-shaped coaxial light source, a control cabinet, a motor, a V-shaped roller, two sets of ring-shaped racks, and three sets of supports;

[0006] The computer and the display are used for processing calculation and displaying the shape features and surface defects of the pipe and bar.

[0007] The sound-light alarm is used to trigger an alarm when any parameter of the straightness, ovality, diameter and identified defect level of the pipe bar exceeds the set threshold value.

[0008] The control cabinet is used to control the start-stop and rotating speed of the motor.

[0009] The motor is used to drive the rotation of the V-shaped roller way, thereby conveying the pipe bar.

[0010] The annular frame is used to fixedly install the CCD linear array camera and the annular coaxial light source.

[0011] The bracket is used to fixedly install the laser diameter measuring instrument.

[0012] The vibration suppression device is used to eliminate mechanical vibration.

[0013] The annular coaxial light source adopts a diffuse illumination mode, and the illumination direction is consistent with the axial direction of the pipe bar, so as to make the pipe bar surface obtain uniform brightness distribution.

[0014] The laser diameter measuring instrument is used to collect the center coordinates and orthogonal diameters of the pipe bar, and the mean value of the orthogonal diameters is taken as the cross-sectional diameter of the pipe bar; the true ovality of the pipe bar is calculated based on the oval cross-sectional model and the introduction of a correction parameter M; and the straightness of the pipe bar at different positions is calculated in combination with the optimized three-point method.

[0015] The CCD linear array camera is used to collect the circumferential image of the pipe bar, and through multi-stage processing, the defect area of the pipe bar is located, the features of the pipe bar are extracted, and the defects are classified by using a cascade model.

[0016] Preferably, the three groups of laser diameter measuring instruments are arranged adjacent to each other at a fixed interval L / 2 along the axial direction of the pipe bar, and the centers thereof are located on the same straight line; each group of laser diameter measuring instruments is used to obtain the position of the center of the pipe bar at the axial position thereof relative to the origin of the coordinate system of the group of laser diameter measuring instruments; and the three groups of laser diameter measuring instruments work cooperatively to respectively obtain the positions of the centers of the pipe bar at three different axial positions relative to the origins of the respective coordinate systems.

[0017] In each group of laser diameter measuring instruments, two photoelectric probes are arranged in a 90° cross distribution to form a two-dimensional measurement system; the intersection point of the optical axes of the two-dimensional measurement system is taken as the origin O, and the measurement directions of the two photoelectric probes are defined as the X-axis and the Y-axis, respectively, to establish an OXY coordinate system; each photoelectric probe includes a laser emitting end and a laser receiving end; in the detection process, the photoelectric probe captures the edge position of the pipe bar in real time, and synchronously calculates the diameters of the pipe bar in the X-axis and Y-axis directions and the position of the center of the pipe bar relative to the coordinate origin O.

[0018] Preferably, the three groups of CCD linear array cameras are uniformly distributed on the annular frame in the circumferential direction of the pipe bar, and are used to acquire circumferential images of the pipe bar.

[0019] The application further provides a pipe bar geometric size and surface defect detection method, which is realized by the system.

[0020] The center coordinates and the orthogonal diameter of the pipe bar are collected, and the average of the orthogonal diameters is taken as the cross-sectional diameter of the pipe bar; the real ellipticity of the pipe bar is calculated based on the introduction of a correction parameter M in an elliptical cross-section model; and the straightness of the pipe bar at different positions is calculated by combining an optimized three-point method.

[0021] The circumferential images of the pipe bar are collected, and the defect area of the pipe bar is located, the features of the pipe bar are extracted, and the defects are classified by using a cascade model through multi-level processing.

[0022] Preferably, the method for calculating the real ellipticity of the pipe bar based on the introduction of a correction parameter M in an elliptical cross-section model comprises the following steps.

[0023] ;

[0024] Wherein, D1 and D2 are the maximum diameter and the minimum diameter of the pipe bar measured by the laser diameter measuring instrument.

[0025] Preferably, the method for calculating the straightness of the pipe bar at different positions by combining an optimized three-point method comprises the following steps.

[0026] Supposing that the length of the pipe bar is L t , and the pipe bar moves in a set direction:

[0027] The head straightness calculation: when the head of the pipe bar completely enters the third laser diameter measuring instrument, the calculation of the straightness of the pipe head is started; a straight line is fitted based on the center position data of the pipe bar collected by the first laser diameter measuring instrument and the second laser diameter measuring instrument, and the vertical distance from the center position of the pipe bar collected by the third laser diameter measuring instrument to the fitted straight line is the straightness of the pipe head, and the calculation is completed in the process of moving the pipe bar by a distance of L / 2 after the head of the pipe bar enters the third laser diameter measuring instrument.

[0028] The tail straightness calculation: when the pipe bar completely passes through the third laser diameter measuring instrument and continues to move by a distance of L t -3L / 2, the calculation of the straightness of the pipe tail is started; a straight line is fitted based on the center position data of the pipe bar collected by the second laser diameter measuring instrument and the third laser diameter measuring instrument, and the vertical distance from the center position of the pipe bar collected by the first laser diameter measuring instrument to the fitted straight line is the straightness of the pipe tail; and the calculation is completed after the tail of the pipe bar completely passes through the first laser diameter measuring instrument.

[0029] Preferably, the method for collecting the circumferential images of the pipe bar, locating the defect area of the pipe bar, extracting the features of the pipe bar, and classifying the defects by using a cascade model through multi-level processing comprises the following steps.

[0030] Step one: Perform non-subsampled shearlet transform (NSST) decomposition on the circumferential images of the pipe and bar collected by the three groups of CCD line array cameras to obtain low-frequency subbands and high-frequency subbands; Perform Gaussian filtering on the low-frequency subbands to suppress uneven illumination noise; Perform anisotropic diffusion denoising on the high-frequency subbands and retain the edges, supplemented by gamma correction to enhance the contrast of weak defects; Reconstruct the processed low-frequency and high-frequency subbands by inverse NSST;

[0031] Step two: Perform morphological optimization on the reconstructed image: use opening operation to eliminate white noise and closing operation to fill holes; The size of the structural element is 13x13 pixels;

[0032] Step three: Based on the optimized reconstructed image, extract the edge gradient by Sobel operator; Identify the pipe and bar end face mark area and exclude it by Hough transform; Locate the candidate defect area based on Otsu adaptive threshold segmentation combined with connected component analysis;

[0033] Step four: Apply closing operation to connect the broken areas of the candidate defects; Extract the skeleton to analyze the elongated defects; Calculate the geometric features, texture features, and depth features based on 3D point cloud reconstruction, wherein the geometric features include area, aspect ratio, and circularity, and the texture features include local binary pattern (LBP) and gray level co-occurrence matrix (GLCM);

[0034] Step five: Load the offline trained MobileNetV3-RF cascade classification model; Real-time classify the defect area and output the type and location information.

[0035] Preferably, the MobileNetV3-RF cascade classification model structure includes a front-end feature extraction layer, i.e. MobileNetV3, and a back-end classification decision layer, i.e. random forest (RF);

[0036] The front-end feature extraction layer: front-end lightweight feature extraction: use MobileNetV3 as the backbone network, adjust the input size to 512x512x3, extract deep semantic features while ensuring real-time performance through depth separable convolution and Squeeze-and-Excitation module, output: 128-dimensional feature vector F after the last global average pooling (GAP) cnn to represent the deep semantic information extracted in the image; concatenate F cnn extracted by MobileNetV3 with the extracted multi-modal 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: wherein I j is a traditional feature importance score, W j is a weight for the corresponding feature.

[0038] Compared with the prior art, the present application has the following advantages:

[0039] The present application realizes integrated online detection of profile features (diameter / ellipticity / straightness) and surface defects of pipe rods, eliminates the problem of functional fragmentation; the vibration suppression device overcomes the influence of vibration and timing jitter, and the annular coaxial light source diffuse illumination suppresses metal reflection, ensuring data reliability under high-speed working conditions; the ellipticity correction algorithm ensures the accuracy of profile parameters; the optimized three-point method calculation model solves the detection blind area of pipe heads and tails, realizes continuous detection of full-length pipe rods, and the NSST image enhancement and MobileNetV3-RF classification model improve the defect recognition rate. The system has compact structure, is installed on the existing rolling production line, does not need to cut off the pipe rods, and meets the requirements of online, rapid and zero-contact detection.

[0040] The present application provides an integrated online detection technology for long-axis pipe rods, which provides effective support for full-process quality monitoring of such materials, and significantly improves the production efficiency and product reliability under the "zero defect" quality control standard. BRIEF DESCRIPTION OF DRAWINGS

[0041] In order to more clearly illustrate the technical solutions of the present application, the following briefly introduces the drawings needed to be used in the embodiments. Obviously, the drawings described in the following only constitute some embodiments of the present application, and other drawings can also be obtained by those skilled in the art without creative labor.

[0042] Figure 1 It is a schematic diagram of the detection system arrangement in the embodiment of the present application;

[0043] Figure 2 It is a schematic diagram of the installation of three sets of laser diameter measuring instruments in the embodiment of the present application;

[0044] Figure 3 It is a schematic diagram of the configuration of the laser emitting end and the laser receiving end inside the laser diameter measuring instrument in the embodiment of the present application;

[0045] Figure 4 It is a schematic diagram of the installation of three sets of CCD line array cameras in the embodiment of the present application;

[0046] Figure 5 It is a schematic diagram of the idealized model of the elliptical cross section of the pipe rod in the embodiment of the present application.

[0047] Explanation of reference signs:

[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 the tube / rod 9, and take the average of the orthogonal diameters as the cross-sectional diameter of the tube / rod 9; the true ellipticity of the tube / rod 9 is calculated based on the elliptical cross-section model by introducing a correction parameter M; and the straightness of the tube / rod 9 at different positions is calculated by combining the optimized three-point method.

[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 high-gloss, non-planar metal material, it 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 using anchor bolts, ensuring that the center line of the roller conveyor is aligned 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 via 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] Installation of laser diameter gauge 4: 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) internally contains two photoelectric probes distributed in a 90° cross (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 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 irradiation 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 the 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 suppression 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 laser diameter gauge 4: Place a standard calibration tube or bar 9 on the V-shaped roller path 11, and respectively 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 linearities 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 measuring instrument 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 to the technical solutions of the present invention by those skilled in the art 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 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; it calculates the true ellipticity of the pipe and rod based on the elliptical cross-section model by introducing a correction parameter M; and it calculates the straightness of the pipe and rod at different positions by combining the optimized three-point method. The CCD linear array camera is used to acquire circumferential images of the tubes and bars. Through multi-level processing, it locates the defect areas of the tubes and bars, extracts the features of the tubes and bars, and classifies the defects using a cascaded model.

2. The system according to claim 1, characterized in that, 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, where L is the length of the pipe or rod, 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 that 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. Each laser diameter measuring instrument is equipped with two photoelectric probes arranged at 90° angles 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. A method for detecting the geometric dimensions and surface defects of tubes and bars, said method being implemented using the system described in any one of claims 1-3, characterized in that... The method includes: 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. The system acquires circumferential images of pipes and bars, performs multi-level processing to locate defect areas, extract features, and classify defects using a cascaded model.

5. The method according to claim 4, characterized in that, Methods for calculating the true ellipticity of pipes and bars based on an elliptical section model and by introducing a correction parameter M include: ; Wherein, D1 and D2 are the maximum and minimum diameters of the pipe and rod measured by the laser diameter gauge, respectively.

6. The method according to claim 4, characterized in that, Methods for calculating the straightness of pipes and bars at different positions using the optimized three-point method include: Let the length of the tube / rod be L, and let it move in a predetermined direction: Head straightness calculation: When the head of the pipe or rod is fully inside the laser diameter measuring instrument three, the 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 head of the pipe or rod. This is completed during the process of moving a distance of L / 2 after the head of the pipe or rod is fully inside the laser diameter measuring instrument three. Tail straightness calculation: When the head of the pipe or rod passes the laser diameter gauge three and continues to move a distance L-3L / 2, the tail straightness calculation is started; a straight line is fitted based on the center position data of the pipe or rod collected by laser diameter gauge two and laser diameter gauge three. The vertical distance from the center position of the pipe or rod collected by laser diameter gauge one to the fitted straight line is the straightness of the tail of the pipe or rod; the calculation is completed after the tail of the pipe or rod has completely passed the laser diameter gauge one.

7. The method according to claim 4, characterized in that, 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.

8. The method according to claim 7, characterized in that, 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 after global average pooling (GAP) in the final layer. cnn Used to represent the deep 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: 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 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 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.

Citation Information

Patent Citations

  • Method for determining shape parameters

    CN102171530A

  • Device and method of guide rail straightness measuring

    CN103033161A

  • Linearity online detection device and method in long material straightening work procedure

    CN106767557A

  • Bar straightness detection system and detection method

    CN109974631A

  • Improved bar straightness detection system and method based on visual detection

    CN110926378A

Cited By

  • Clothing material identification method and device

    CN121884063A