A metal pipe anchor grain detection method and system based on image analysis
By using 3D industrial cameras and image analysis technology, anchor pattern indentations in metal pipes are identified and screened. Combined with photoelectric probes for grouped measurements by angle, the problem of low detection accuracy and efficiency in existing technologies is solved, achieving efficient and accurate anchor pattern detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- YANAN UNIV
- Filing Date
- 2026-04-09
- Publication Date
- 2026-06-23
AI Technical Summary
Existing metal pipe anchorage detection technologies cannot balance accuracy and efficiency. Traditional manual inspection results in metal loss and large errors, while photoelectric detection is inefficient and provides indiscriminate measurement, failing to meet the high-precision and high-efficiency requirements of modern industry.
A 3D industrial camera is used to acquire panoramic images. The watershed segmentation algorithm and lightweight convolutional neural network are combined to identify anchor pattern depressions, and key depressions are selected for detection. Photoelectric probes are used to measure in groups according to circumferential angles, reducing invalid operations and improving detection accuracy and efficiency.
It has improved the accuracy of metal pipe anchor pattern detection, reduced detection errors, increased efficiency, shortened the detection time of a single pipe to within 10 minutes, and reduced the number of equipment operations by more than 70%.
Smart Images

Figure CN121998980B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of pipeline quality inspection technology, and in particular to a method for measuring the anchorage of metal pipelines using a combination of image processing and photoelectric detection techniques. Background Technology
[0002] Metal pipes, with their excellent corrosion resistance, pressure resistance, and formability, have become core pipe materials in fields such as petrochemicals, municipal water supply and drainage, and gas transmission. The anchor pattern of the inner wall after sandblasting and rust removal is a key indicator for measuring the quality of anti-corrosion pretreatment. The anchor pattern is the uneven texture formed by the abrasive impact on the inner wall of the pipe during sandblasting. The depth and uniformity of the anchor pattern directly determine the adhesion between the anti-corrosion coating and the inner wall of the pipe. If the anchor pattern is too shallow, the coating will easily fall off and the anti-corrosion will fail. If it is too deep, it will easily cause uneven coating accumulation and stress concentration. Therefore, accurate and efficient detection of the anchor pattern on the inner surface of metal pipes is an important preliminary process to ensure the subsequent service life of the pipeline.
[0003] Currently, there are two main testing methods in the field of metal pipe anchorage testing. The traditional manual testing method was the mainstream method in the early days of the industry. During testing, a section of sample pipe needs to be cut from the entire pipe and broken apart. The inspector observes the texture of the inner wall of the sample pipe end with the naked eye and then compares it with the standard sample image of anchorage grade to determine the grade. This method not only causes a large amount of metal pipe waste and increases production costs, but also has a limited sampling range, only able to observe the end area of the pipe, and cannot reflect the true anchorage of the entire pipe. In addition, manual observation is subject to subjective judgment errors, and the test results are highly random, with extremely low accuracy and reliability, which can no longer meet the batch testing needs of modern industry.
[0004] To address the drawbacks of manual inspection, photoelectric inspection technologies have been proposed. Among them, the photoelectric inspection method for anchor texture on the inner surface of pipes proposed in patent CN1075203A is a typical example. Although this method achieves non-manual inspection and non-destructive inspection of pipes, it still has the following two shortcomings: First, this method cannot ensure that the measuring light accurately illuminates the deepest part of the anchor texture. It is necessary to continuously rotate the equipment to obtain multiple sets of depth data and then select the maximum value, resulting in low inspection efficiency. Second, the inspection process is an indiscriminate point-by-point measurement without screening the anchor texture points. All depressions are measured, resulting in a large number of invalid measurement operations. Moreover, the equipment needs to rotate and stop once for each measurement point, and the frequent stops significantly increase the inspection time.
[0005] It is evident that the shortcomings of existing testing technologies mean that the inspection of metal pipe anchorage texture can never balance accuracy and efficiency. The rapid development of petrochemical and municipal engineering has placed higher demands on the accuracy, efficiency, and comprehensiveness of metal pipe inspection. Therefore, it is urgent to develop a new inspection method. Summary of the Invention
[0006] This application provides a method and system for detecting the anchor texture of metal pipes based on image analysis, in order to solve the above-mentioned problems in the prior art.
[0007] On the one hand, embodiments of this application provide a method for detecting the anchor texture of metal pipes based on image analysis, including:
[0008] A 3D industrial camera is used to capture panoramic images of the inside of metal pipes. The panoramic images include 2D texture images and 3D point cloud data.
[0009] The panoramic image is preprocessed and anchor pattern feature enhancement is performed to form an enhanced two-dimensional contour image and optimized three-dimensional point cloud data.
[0010] The watershed segmentation algorithm is used to identify the core regions of potential independent anchor pattern depressions in the enhanced 2D contour image and mark the core regions as initial seed points. A lightweight convolutional neural network is used to generate contour masks of independent anchor pattern depressions in the enhanced 2D contour image. Combining the initial seed points and contour masks, and using optimized 3D point cloud data as an auxiliary judgment basis, the connected anchor pattern depression contours are segmented to determine all independent anchor pattern depression contours.
[0011] The depth estimate of each independent anchor pattern recess is determined based on the optimized 3D point cloud data corresponding to the contour of each independent anchor pattern recess.
[0012] The average estimated value is determined based on the estimated depth of all independent anchor pattern depressions. Based on the relationship between the estimated depth of each independent anchor pattern depression and the average estimated value, key depressions are selected for detection among the independent anchor pattern depressions.
[0013] The key detection depressions are divided into multiple measurement groups according to the pre-set circumferential angle grouping threshold, and each measurement group corresponds to a target circumferential angle.
[0014] The photoelectric probe is rotated to the circumferential angle of each target, so that the photoelectric probe projects measurement light into the corresponding measurement group. The reflected light signal of the measurement light is converted into an electrical signal. Based on the intensity and variation law of the electrical signal, the actual depth data of each key detection depression in the measurement group is calculated.
[0015] The anchorage measurement results are obtained by summarizing all the actual depth data of the entire metal pipe.
[0016] On the other hand, embodiments of this application also provide a metal pipe anchor texture detection system based on image analysis, including:
[0017] The image acquisition module is used to acquire panoramic images of the inside of metal pipes using a 3D industrial camera. The panoramic images include 2D texture images and 3D point cloud data.
[0018] The preprocessing module is used to preprocess the panoramic image and enhance the anchor pattern features to form an enhanced two-dimensional contour image and optimized three-dimensional point cloud data.
[0019] The contour segmentation module is used to identify potential independent anchor pattern concave core regions in the enhanced 2D contour image using the watershed segmentation algorithm, and marks the core regions as initial seed points; it uses a lightweight convolutional neural network to generate contour masks for independent anchor pattern concave in the enhanced 2D contour image; and it combines the initial seed points and contour masks with optimized 3D point cloud data as an auxiliary judgment basis to segment connected anchor pattern concave contours and determine all independent anchor pattern concave contours.
[0020] The depth estimation module is used to determine the depth estimate of each independent anchor pattern recess based on the optimized 3D point cloud data corresponding to the contour of each independent anchor pattern recess.
[0021] The depression screening module is used to determine the average estimated value based on the estimated depth of all independent anchor pattern depressions. Based on the relationship between the estimated depth of each independent anchor pattern depression and the average estimated value, it screens out depressions that need to be detected in the independent anchor pattern depressions.
[0022] The measurement group division module is used to divide the key detection depressions into multiple measurement groups according to the preset circumferential angle grouping threshold, with each measurement group corresponding to a target circumferential angle;
[0023] The depth measurement module is used to control the photoelectric probe to rotate to the circumferential angle of each target, so that the photoelectric probe projects measurement light into the corresponding measurement group, converts the reflected light signal of the measurement light into an electrical signal, and calculates the actual depth data of each key detection depression in the measurement group based on the intensity and variation law of the electrical signal.
[0024] The data aggregation module is used to aggregate all actual depth data of the entire metal pipe to obtain the anchor pattern detection results.
[0025] The image analysis-based method and system for detecting anchor texture in metal pipes disclosed in this application have the following advantages:
[0026] 1. A qualitative improvement in detection accuracy is achieved, fundamentally solving the positioning and measurement error problems of existing technologies. This application uses a 3D industrial camera to acquire panoramic 3D images of the inner wall of the pipe, which can accurately obtain the 3D spatial coordinates of each anchor groove depression and directly locate the deepest part of the anchor groove. There is no need to continuously rotate the equipment to select the maximum value, thus completely avoiding the errors caused by rotational positioning deviation.
[0027] 2. Significantly improved detection efficiency, effectively reducing equipment operation times and invalid measurements. This application uses anchor pattern depth estimation calculated from 3D images to screen out key depressions that have a significant impact on the overall average anchor pattern depth, ignoring general depressions with depths close to the average, directly reducing invalid measurement operations by more than 50%. Simultaneously, the screened key depressions are grouped by circumferential angle; depressions within ±2° of the same circumferential angle can be detected with a single equipment rotation and a single measurement light illumination. Compared to the point-by-point measurement of existing technologies, the number of equipment rotations and stops is reduced by more than 70%. The detection time for a single 18-meter-long metal pipe can be controlled within 10 minutes, with detection efficiency far exceeding existing photoelectric detection methods. Attached Figure Description
[0028] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0029] Figure 1 A flowchart illustrating an image analysis-based method for detecting anchor texture in metal pipes, as provided in this application embodiment. Detailed Implementation
[0030] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0031] Figure 1 A flowchart illustrating an image analysis-based method for detecting anchor marks on metal pipes, as provided in this application embodiment. This application embodiment provides an image analysis-based method for detecting anchor marks on metal pipes, including:
[0032] The S100 uses a 3D industrial camera to capture panoramic images of the inside of metal pipes. The panoramic images include 2D texture images and 3D point cloud data.
[0033] For example, before acquiring panoramic images, it is necessary to first perform pre-detection preparation and full-dimensional debugging of the detection system. These tasks include the following:
[0034] 1. Pipe Fixing and Parameter Input. Place the metal pipe to be inspected on the inspection bracket; according to the pipe's factory certificate of conformity, input the core parameters of the metal pipe to be inspected into the basic information module of the computer control system, including the pipe inner diameter D, effective length La, abrasive type and blasting pressure, and the inspection quality standards, such as the acceptable depth range of anchor pattern and the uniformity of distribution.
[0035] 2. Device Hardware Debugging. Adjust the distance between the guide wheels of the 3D detection device and the photoelectric measurement device according to the inner diameter of the pipe to be inspected, ensuring that the main body diameter of the device is 5-10mm smaller than the inner diameter of the pipe, and that the guide wheels make smooth contact with the inner wall of the pipe without jamming or deviation during device movement. Check the operating status of the DC torque motor and stepper motor of the traction vehicle to ensure that the motors rotate smoothly and accurately. Check the power supply and cleanliness of the 3D industrial camera and photoelectric probe, and wipe the camera lens and the detection window of the photoelectric probe to avoid dirt affecting imaging and measurement. In the embodiments of this application, both the 3D detection device and the photoelectric measurement device include an external support with at least three sets of guide wheels. These guide wheels are evenly arranged on the outside of the central 3D industrial camera and photoelectric probe, and the center of the circular area formed by the edges of the multiple sets of guide wheels coincides with the center of the 3D industrial camera and photoelectric probe, ensuring that the 3D industrial camera and photoelectric probe always move along the axis of the pipe when the device moves inside the metal pipe. Furthermore, the connecting rod between each set of guide wheels and the center adopts a telescopic structure to easily adapt to pipes of different diameters. The tractor unit is detachably connected to the 3D detection device and the photoelectric measurement device, allowing the tractor unit to pull these devices along the pipeline driven by a DC torque motor. While moving along the pipeline's axis, the tractor unit will stop axially after moving a certain distance, and then rotate circumferentially around its current position under the drive of a stepper motor.
[0036] 3. Equipment parameter calibration and setting, including the following:
[0037] 3.1 3D Industrial Camera Calibration: Set the camera's shooting parameters. For the sandblasted texture features of the inner wall of the metal pipe, adjust the shooting resolution to 2048×2048, exposure time to 5-10ms, focal length to 12mm, and 3D imaging accuracy to ±0.5μm. Complete the calibration of the camera's internal and external parameters to eliminate lens distortion. Set the camera's rotation parameters: rotation speed 10° / s, rotation angle 0-360° to ensure that a panoramic image of the inner wall of the pipe can be acquired.
[0038] 3.2. Calibration of photoelectric measurement device: Adjust the brightness of the light source to ensure that the projected measurement light is a continuous straight bright line parallel to the metal pipe busbar, and the width of the bright line is controlled within 0.5-1mm; calibrate the sensitivity of the CCD (charge-coupled device) photoelectric conversion module, set the electrical signal transmission rate to 10Mbps, and ensure that the optical signal conversion is without delay or distortion.
[0039] 3.3 Detection device operation parameter settings: Set the tractor speed to 25m / min and the axial detection interval to 1m, that is, the device completes one image acquisition and photoelectric measurement operation every 1m of travel; set the stepper motor rotation positioning accuracy to ±0.1° to ensure that the photoelectric probe can accurately rotate to the target circumferential angle.
[0040] 4. System Connection and Trial Operation. Establish a two-way connection between the computer control system and the detection device and photoelectric measurement device via cable and wireless signal to ensure that the computer can send control commands in real time and the device can transmit collected data back in real time. Place the detection device at the pipeline inlet and conduct a short-distance (0.5m) trial operation to check whether the device movement, camera imaging, photoelectric probe projection, and data transmission are normal. If any problems are found, debug them in time.
[0041] After completing the above debugging work, you can proceed with the panoramic image acquisition process as follows:
[0042] 1. Start-up and movement of the detection device. The computer control system sends a start command to the tractor, driving the detection device to move at a constant speed along the axial direction of the metal pipe. The moving speed is set at 25m / min. The guide wheel assembly makes smooth contact with the inner wall of the pipe, ensuring that the device does not deviate or shake.
[0043] 2. Axial Point Stopping and Image Acquisition. When the detection device moves to the first preset axial detection point (1m from the pipe inlet), the computer sends a stop command, the tractor immediately stops, and the device remains in a fixed position. At the same time, an acquisition command is sent to the 3D industrial camera, which starts to acquire 360° panoramic images. Driven by a stepper motor, the camera rotates at a constant speed around the pipe axis. During the rotation, it simultaneously acquires two-dimensional texture images and three-dimensional point cloud data of the inner wall of the pipe. The two-dimensional image records the texture outline, and the three-dimensional point cloud data records the three-dimensional spatial coordinates of each pixel. In this three-dimensional spatial coordinate system, X is the pipe axial direction, Y is the pipe circumferential direction, and Z is the pipe radial / depth direction.
[0044] 3. Real-time data transmission and storage. The two-dimensional texture images and three-dimensional point cloud data acquired by the camera are transmitted back to the computer control system in real time through the data transmission module. The image storage module stores the data by numbering according to the rule of "axial point position - acquisition time", such as "axial 1m-2025XXXX-XXXX". At the same time, the basic pipeline parameter label is added to each set of data to ensure that the data can be quickly retrieved, correlated and identified.
[0045] 4. Continuous acquisition of multiple points. After the panoramic image of a single axial point is acquired, the computer sends a command to continue moving. The tractor drives the device to continue moving along the axial direction at a constant speed. The above-mentioned stopping, acquisition, transmission, and storage operations are repeated every 1m until the device reaches the end of the pipeline, completing the panoramic image acquisition of all preset axial detection points of the entire metal pipeline.
[0046] 5. Device Reset After Data Acquisition: After image acquisition of the entire pipeline is completed, the computer sends a reset command, and the tractor drives the detection device back along the pipeline axis at a constant speed to the pipeline inlet, awaiting subsequent photoelectric measurement operations.
[0047] S110 performs preprocessing and anchor pattern feature enhancement on the panoramic image to form an enhanced two-dimensional contour image and optimized three-dimensional point cloud data.
[0048] For example, preprocessing and anchor pattern enhancement of panoramic images include:
[0049] Gaussian filtering algorithm is used to filter and reduce noise in two-dimensional texture images;
[0050] A histogram equalization algorithm is used to enhance the contrast of the denoised two-dimensional texture image, and then the grayscale value of the enhanced two-dimensional texture image is normalized.
[0051] The Canny edge detection algorithm is used to perform edge detection on the normalized two-dimensional texture image to generate a binary image with edge detection.
[0052] Dilation-erosion morphological operations are performed on the edge detection binary image to obtain an enhanced two-dimensional texture image;
[0053] Outlier removal and smoothing processes are performed on the 3D point cloud data to obtain optimized 3D point cloud data.
[0054] Specifically, the above process includes the following steps:
[0055] 1. Data Retrieval and Preprocessing Initialization. The computer control system retrieves the two-dimensional texture image and three-dimensional point cloud data of a single axial detection point from the image storage module, imports them into the preprocessing algorithm framework, and sets the pixel unit and three-dimensional coordinate unit of image processing to be unified to μm to ensure that the data matching is without deviation.
[0056] 2. Two-dimensional texture image denoising. A Gaussian filtering algorithm is used to filter and denoise the two-dimensional texture image. The Gaussian filter kernel size is set to 5×5 and the standard deviation σ=1.0. The gray value of each pixel in the image is weighted and averaged through convolution operation to remove random noise, grain noise and motion blur noise caused by the movement of the device, while retaining the real texture features of the anchor pattern and avoiding noise interference to subsequent contour recognition.
[0057] 3. Image Contrast Enhancement Processing. A histogram equalization algorithm is used to enhance the contrast of the denoised 2D texture image. By remapping the grayscale distribution of the image, the difference in grayscale values between the dark areas of the anchor pattern recesses and the light areas of the smooth pipe wall is amplified, making the outline of the anchor pattern recesses clearer and more recognizable. Simultaneously, the enhanced image undergoes grayscale normalization, controlling the grayscale values within the range of 0-255 to facilitate subsequent algorithm processing.
[0058] 4. Anchor Pattern Contour Edge Detection. The Canny edge detection algorithm is used to perform edge detection on the normalized 2D texture image. A high threshold of 200 and a low threshold of 100 are set. Through four steps, namely gradient calculation, non-maximum suppression, double threshold detection, and edge connection, all valid edges in the image are accurately extracted, including the contour edges of the anchor pattern indentation. Slight scratches and false edges formed by noise on the inner wall of the pipe are removed, and a binary edge detection image is generated. In this image, edge pixels are white with a grayscale value of 255, and non-edge pixels are black with a grayscale value of 0.
[0059] 5. Morphological optimization processing. Dilation-erosion morphological operations are performed on the edge detection binary image. Using a 3×3 structuring element, the dilation operation is first performed to connect the broken anchor pattern concave contours to ensure the integrity of the contours. Then, the erosion operation is performed to eliminate burrs and false edges on the contour edges, further optimizing the clarity and regularity of the anchor pattern contours, and finally obtaining a two-dimensional contour image with enhanced anchor pattern features.
[0060] 6. 3D Point Cloud Data Optimization. Outlier removal and smoothing are performed on the 3D point cloud data. A statistical filtering algorithm is used to calculate the mean and variance of the distance to neighboring points of each point cloud. Points with a mean distance exceeding three times the variance are identified as outlier discrete points and removed. Then, the moving least squares method is used to smooth the remaining point cloud data, ensuring that the 3D spatial coordinate data of the anchor pattern indentation is continuous, accurate, and without jumps, resulting in optimized 3D point cloud data.
[0061] S120: The watershed segmentation algorithm is used to identify the core regions of potential independent anchor pattern depressions in the enhanced 2D contour image and the core regions are marked as initial seed points. A lightweight convolutional neural network is used to generate contour masks of independent anchor pattern depressions in the enhanced 2D contour image. Combining the initial seed points and contour masks, and using the optimized 3D point cloud data as an auxiliary judgment basis, the connected anchor pattern depression contours are segmented to determine all independent anchor pattern depression contours.
[0062] For example, a method for identifying initial seed points in an enhanced two-dimensional contour image includes:
[0063] A fixed threshold binarization segmentation is performed on a two-dimensional contour image to generate a foreground and background binary image;
[0064] The Euclidean distance transformation method is used to calculate the Euclidean distance from each foreground pixel to the nearest background pixel in the binary foreground and background images to generate a distance transformation map. The distance transformation map is then segmented by thresholding, and pixels with distance values greater than the distance threshold are marked as initial seed points.
[0065] Specifically, the above process includes the following steps:
[0066] 1. Binarization Segmentation and Foreground / Background Delineation. A fixed threshold binarization segmentation is performed on the two-dimensional contour image. A segmentation threshold of 128 is set. Anchor pattern recessed contour areas with grayscale values ≥ 128 are marked as foreground, while smooth pipe inner wall areas with grayscale values < 128 are marked as background. This clarifies the overall extent of the anchor pattern recessed areas and generates a foreground / background binary map.
[0067] 2. Watershed Segmentation Algorithm Preprocessing. A distance transformation is performed on the binary images of the foreground and background. The Euclidean distance transformation method is used to calculate the Euclidean distance from each foreground pixel to the nearest background pixel, generating a distance transformation map. The larger the distance value, the closer the pixel is to the core region of the anchor pattern depression. Then, a threshold segmentation is performed on the distance transformation map. A distance threshold of 5μm is set, and pixels with distance values greater than this threshold are marked as initial seed points. Each seed point corresponds to a potential independent core region of the anchor pattern depression.
[0068] Furthermore, the lightweight convolutional neural network includes an input layer, a first convolutional layer, a first pooling layer, a second convolutional layer, a third pooling layer, an activation layer, and a fully connected layer connected in sequence.
[0069] Specifically, the lightweight convolutional neural network (AnchorNet) adopts a lightweight structure of "convolutional layer-pooling layer-activation layer-fully connected layer". The input is a 2048×2048 two-dimensional contour image, and the output is a contour mask with independent anchor pattern indentations. The specific structure of this network is as follows: ① Input layer: receives the two-dimensional contour image; ② Convolutional layer 1: 32 3×3 convolutional kernels, stride 1, padding 1, output feature map dimension 2048×2048×32; ③ Pooling layer 1: uses 2×2 max pooling, stride 2, output feature map dimension 1024×1024×32; ④ Convolutional layer 2: 64 3×3 convolutional kernels, stride 1, padding 1, output feature map dimension 1024×1024×32. 4×64; ⑤ Pooling layer 2: 2×2 max pooling with a stride of 2, output feature map dimension is 512×512×64; ⑥ Convolutional layer 3: 128 3×3 convolutional kernels with a stride of 1 and padding of 1, output feature map dimension is 512×512×128; ⑦ Activation layer: ReLU activation function is used to solve the gradient vanishing problem; ⑧ Fully connected layer: outputs a 512×512 contour mask, where 1 represents an independent concave contour and 0 represents the background.
[0070] The network training process is as follows: The training set consists of 10,000 actual sample images of metal pipe anchor texture detection (including images of anchor texture depressions with different sandblasting processes and varying degrees of connectivity). These images are divided into training, validation, and test sets in an 8:1:1 ratio. Training parameters are set as follows: batch size of 32, epochs of 50, and initial learning rate of 0.001. Gradient descent is performed using the Adam optimizer. The cross-entropy loss function is used as the model's loss function, and the formula for the loss function L is: Where N is the total number of pixels, y i The true label for pixel i. Predict labels for the model. When the loss value on the model validation set tends to stabilize and the recognition accuracy is ≥99%, stop training and obtain the trained AnchorNet model.
[0071] The 2D contour image is input into the trained AnchorNet model, and the model outputs the contour mask of the independent anchor pattern depression. Combined with the initial seed points obtained by watershed segmentation, the height difference of the optimized 3D point cloud data is used as the auxiliary judgment criterion. That is, if the 3D height difference between two regions is greater than 2μm, it is judged as an independent depression. The connected anchor pattern depression contours are accurately segmented, and a single connected contour is segmented into multiple independent anchor pattern depression contours that correspond one-to-one with abrasive impact.
[0072] Next, each segmented independent anchor pattern recess contour is uniquely numbered according to the rule of "axial point position - contour number", such as "axial 1m-001" and "axial 1m-002". At the same time, each independent anchor pattern recess contour is precisely matched with the optimized three-dimensional point cloud data to ensure that each contour corresponds to a complete set of three-dimensional spatial coordinate data, forming a one-to-one correspondence between "contour number - two-dimensional contour - three-dimensional point cloud".
[0073] After the above processing, all independent anchor pattern recess contours for each axial point are obtained. Each contour has a unique number and is accurately matched with the 3D point cloud data to form an independent anchor pattern recess contour-coordinate matching table.
[0074] S130, based on the optimized 3D point cloud data corresponding to each independent anchor pattern recess contour, determine the estimated depth of each independent anchor pattern recess.
[0075] For example, a method for determining the estimated depth of each individual anchor groove indentation includes:
[0076] Extract the three-dimensional coordinates of all pixels in the contour of the independent anchor pattern, determine the pixel with the smallest Z value in the three-dimensional coordinates as the deepest point of the independent anchor pattern, and record the corresponding Z value of the deepest point of the anchor pattern.
[0077] The arithmetic mean of the Z values of all pixels in the flat area of the inner wall of the metal pipe in the optimized 3D point cloud data is calculated, and the arithmetic mean is used as the Z value of the radial reference plane.
[0078] The difference between the Z-value of the radial reference plane and the Z-value of the deepest part of the anchor pattern is calculated to obtain the depth estimate.
[0079] Specifically, the above process includes the following steps:
[0080] 1. Contour Coordinate Extraction. The computer control system retrieves the contour number and corresponding 3D point cloud data of a single independent anchor pattern recess from the independent anchor pattern recess contour-coordinate matching table, and extracts the 3D spatial coordinates (X, Y, Z) of all pixels within the contour. The X-axis is the axial direction of the metal pipe, the Y-axis is the circumferential direction of the pipe, and the Z-axis is the radial direction of the pipe, i.e., the depth direction. The smaller the Z value, the deeper the position.
[0081] 2. Locating the deepest point of the anchor pattern. All extracted 3D coordinates are filtered by Z-value. The pixel with the smallest Z-value is determined as the deepest point of the independent anchor pattern depression. The complete 3D spatial coordinates (X0, Y0, Z0) of this point are recorded. Simultaneously, Y0 is converted to the corresponding circumferential angle value θ0, forming a coordinate table of the deepest point of the anchor pattern. The table contains the contour number, the 3D coordinates of the deepest point, and the circumferential angle θ0.
[0082] 3. Determination of the reference surface of the pipe inner wall. In the 3D point cloud data, select a smooth area on the inner wall of the metal pipe, i.e., an area without anchor pattern indentations or scratches. Extract the Z-values of all pixels within this area and calculate their arithmetic mean Z0. 基准 This value is used as the radial reference plane Z value of the inner wall of the pipe, and the reference plane is the reference plane for calculating the anchor pattern depth.
[0083] 4. Calculation of anchor pattern depth estimate. Based on the radial reference plane Z of the pipe inner wall. 基准 For reference, calculate the estimated depth of each individual anchor pattern indentation. The formula for calculating the estimated depth is: H 预 =Z 基准 -Z0, where H 预 For in-depth estimation, Z 基准 Z is the reference plane Z value, and Z0 is the Z value at the deepest point of the anchor pattern. The depth estimate is calculated from the imaging data of the 3D industrial camera with an accuracy of ±0.5μm, which meets the accuracy requirements for point selection.
[0084] 5. Data aggregation and updating. The estimated depth H of each individual anchor pattern indentation... 预 Add the coordinates of the deepest point of the anchor pattern to the table, and complete the data update in the table. The updated table includes the outline number, the three-dimensional coordinates of the deepest point (X0, Y0, Z0), the circumferential angle θ0, and the estimated depth H. 预 Five core messages.
[0085] S140, determine the average estimated value based on the estimated depth of all independent anchor pattern depressions, and select key depressions for detection based on the relationship between the estimated depth of each independent anchor pattern depression and the average estimated value.
[0086] For example, a method for selectively detecting depressions includes:
[0087] Calculate the difference between the estimated depth of each individual anchor groove indentation and the average estimated depth, and determine the absolute value of the ratio of this difference to the average estimated depth.
[0088] If the absolute value is greater than 20%, the corresponding independent anchor pattern depression will be the focus of the inspection.
[0089] Specifically, the above process includes the following steps:
[0090] 1. Depth Prediction Statistics. The computer control system extracts the depth prediction H of all independent anchor pattern depressions at a single axial detection point from the coordinate table of the deepest point of the anchor pattern. 预 This data is then imported into a data statistics framework to form a deep prediction dataset.
[0091] 2. Calculation of the average estimated anchor pattern depth at axial detection points. Calculate the average estimated anchor pattern depth at this axial detection point. The arithmetic mean method is used for calculation.
[0092] 3. Key Inspection Depression Screening Rules: Based on the actual industrial needs of metal pipe anchor pattern inspection, the following screening rules are established: If the absolute value of the predicted depth of an independent anchor pattern depression deviates from the average predicted depth of axial points by more than 20%, the depression is determined to be a key inspection depression. Such depressions have a significant deviation from the average depth, significantly impacting the average anchor pattern depth and distribution uniformity of the entire pipe, requiring subsequent precise photoelectric measurement. If the absolute value of the deviation is ≤20%, it is determined to be a general depression. Such depressions have a minor impact on the overall inspection results and are ignored without further photoelectric measurement.
[0093] 4. Key Depression Screening and Data Processing. Based on the screening rules, all independent anchor pattern depressions at this axial point are individually assessed to identify all key detection depressions. All core information of these key detection depressions is extracted from the anchor pattern deepest point coordinate table to form a key detection depression information table. This table includes the contour number, the three-dimensional coordinates of the deepest point (X0, Y0, Z0), the circumferential angle θ0, and the estimated depth, and is sorted in ascending order by the circumferential angle θ0.
[0094] S150 divides the key detection depression into multiple measurement groups according to the preset circumferential angle grouping threshold, with each measurement group corresponding to a target circumferential angle.
[0095] For example, methods for dividing measurement groups include:
[0096] The circumferential angle of the first key detection depression is selected as the center angle. The first key detection depression and all other key detection depressions whose difference from the center angle is within the circumferential angle grouping threshold are classified into the first measurement group.
[0097] The circumferential angle of the first ungrouped key detection depression is selected as the new center angle. The first ungrouped key detection depression and all other ungrouped key detection depressions whose difference from the new center angle is within the circumferential angle grouping threshold are classified into the second measurement group.
[0098] Repeat the above steps until all key detection depressions have been grouped.
[0099] Specifically, the above process includes the following steps:
[0100] 1. Grouping Criteria and Threshold Setting. Based on the measurement light characteristics of the photoelectric measuring device, namely, the measurement light is a continuous straight bright line parallel to the pipeline generatrix, with a circumferential coverage range of ±2°, the circumferential angle grouping threshold is set to ±2°. That is, if the difference between the circumferential angle θ0 of multiple key detection depressions and a certain angle value is within ±2°, these depressions are grouped into the same measurement group, and a single measurement light irradiation can cover the deepest part of all depressions in the group.
[0101] 2. Circumferential Grouping Operation. The computer control system extracts the circumferential angle θ0 of all key detection depressions from the key detection depression information table and groups them in ascending order: ① Select the circumferential angle θ1 of the first key detection depression as the center angle of the initial measurement group, and classify all key detection depressions with circumferential angles within the range of θ1±2° into the first measurement group; ② Select the circumferential angle θ2 of the first ungrouped key detection depression as the new center angle, and classify all ungrouped depressions with circumferential angles within the range of θ2±2° into the second measurement group; ③ Repeat the above operation until all key detection depressions at this axial point are grouped.
[0102] 3. Measurement Group Numbering and Information Processing. Each measurement group will be uniquely numbered according to the rule "axial point location - measurement group number", such as "axial 1m-01", "axial 1m-02". The target circumferential angle θ will be calculated for each measurement group. 目标 This is the arithmetic mean of the circumferential angles of all the key depressions being inspected in this group, ensuring that the measuring light can accurately cover the deepest part of all the depressions in this group. At the same time, core information for each measurement group is compiled, including the measurement group number and the target circumferential angle θ. 目标 The key depression numbers within the group and the three-dimensional coordinates (X0, Y0, Z0) of the deepest point of each depression within the group are used to form a detailed information table for the measurement group.
[0103] 4. Equipment Measurement Command Generation. The computer control system generates a set of equipment measurement commands based on the detailed information table of the measurement group. Each measurement group corresponds to an independent measurement command, the content of which includes: measurement group number, target circumferential angle θ. 目标 The three-dimensional coordinates (X0, Y0, Z0) of the deepest point of all anchor patterns within the group that require depth data extraction are specified. The instruction set is arranged in ascending order according to the measurement group number to ensure that the detection device completes the measurement operation in sequence. The instructions are pre-stored in the local control module of the detection device through the data transmission module for subsequent offline execution.
[0104] S160 controls the photoelectric probe to rotate to the circumferential angle of each target, so that the photoelectric probe projects measurement light into the corresponding measurement group, converts the reflected light signal of the measurement light into an electrical signal, and calculates the actual depth data of each key detection depression in the measurement group based on the intensity and variation law of the electrical signal.
[0105] For example, the measuring light is a continuous straight line. When calculating the actual depth data, the three-dimensional coordinates of the deepest point of each key detection depression are obtained, and only the actual depth data under these three-dimensional coordinates are extracted.
[0106] Specifically, S160 includes the following steps:
[0107] 1. Detection device positioning and command retrieval. The computer control system sends a positioning command to the detection device, driving the tractor to move the detection device to the target axial detection point and stop it, keeping the device in a fixed position; the local control module of the detection device retrieves the pre-stored equipment measurement command set and prepares to execute the measurement operation according to the number sequence.
[0108] 2. Precise rotation and positioning of the photoelectric probe. The local control module sends a rotation command to the stepper motor, driving the stepper motor to rotate the photoelectric probe at a constant speed around the pipe axis until it reaches the target circumferential angle θ of the first measurement group. 目标 Then, the stepper motor immediately stops and locks its position, with a rotational positioning accuracy of ±0.1°, ensuring that the projection direction of the photoelectric probe is accurate and without angular deviation.
[0109] 3. Measurement Light Projection and Light Signal Acquisition. After receiving the start command, the photoelectric probe activates its built-in light source, projecting a continuous straight measurement light parallel to the metal pipe busbar. The measurement light covers the axial position of all key detection depressions within the measurement group with a preset width (0.5-1mm), and accurately illuminates the three-dimensional coordinate position of the deepest point of all depressions. After the measurement light illuminates the deepest point of the anchor pattern, it is reflected, and the reflected light signal is received by the optical imaging system of the photoelectric probe, ensuring that the light signal is unobstructed and attenuated.
[0110] 4. Optical-to-electrical signal conversion and transmission. The received reflected light signal is input into the CCD photoelectric conversion module. The module converts the light signal into an electrical signal according to preset parameters (transmission rate 10Mbps). After being amplified and filtered by the drive circuit, the electrical signal is transmitted back to the depth calculation module of the computer control system in real time through the data transmission module.
[0111] 5. Target Depth Data Extraction and Calculation. The depth calculation module calculates the full-range depth data of the measurement light-illuminated area based on the intensity and variation of the electrical signal, combined with the calibration parameters of the photoelectric probe. Simultaneously, based on the three-dimensional coordinates of the deepest point of the anchor pattern in the equipment measurement command, only the depth data at that coordinate position is extracted, ignoring stray data from non-deepest areas traversed by the measurement line, ensuring the accuracy of the depth data. The extracted depth data is then determined as the actual depth H of the anchor pattern indentation. 实 Measurement accuracy ±0.3μm.
[0112] 6. Multiple sets of continuous measurements. After the first set of measurements is completed, the stepper motor drives the photoelectric probe to rotate to the target circumferential angle θ of the next set of measurements. 目标 Repeat the above measurement, conversion, transmission, and extraction operations until all measurement groups at that axial point have completed precise photoelectric measurement.
[0113] 7. Actual depth data matching and storage. The actual depth data H of each key detection depression is matched and stored. 实 The data is precisely matched with the corresponding contour number, the three-dimensional coordinates of the deepest point, the axial point position, and the measurement group number, and stored in the computer's depth database to form a master table of the actual depth data of the deepest point of the anchor pattern.
[0114] 8. Continuous measurement of multiple axial points. After the photoelectric measurement of a single axial point is completed, the tractor moves the detection device to the next axial detection point, repeating the above positioning, rotation, measurement, and extraction operations until the photoelectric measurement of all axial points of the entire metal pipe is completed accurately.
[0115] S170 summarizes all actual depth data of the entire metal pipe to obtain the anchor pattern detection results.
[0116] For example, methods for aggregating actual depth data include:
[0117] The average anchor depth of the entire metal pipe is calculated based on actual depth data.
[0118] The percentage of key detection depressions in different depth ranges was statistically analyzed.
[0119] Analyze the distribution patterns of anchor patterns in the axial and circumferential directions of metal pipes to identify abnormal areas.
[0120] Specifically, the above process includes the following steps:
[0121] 1. Comprehensive Depth Data Summary. The computer control system extracts the actual depth data of all key detection depressions along the entire metal pipe from the master table of actual depth data at the deepest point of the anchor pattern. This data is then categorized and summarized in multiple dimensions, including axial points, measurement groups, and circumferential angles. The system also calculates the number of key depressions and the maximum depth H at each axial point. max Minimum depth H min Median depth H med .
[0122] 2. Calculation of the average anchor depth of the entire pipe. The average anchor depth of the entire metal pipe is calculated using the arithmetic mean method. The average value is the core indicator for determining the quality grade of the anchor pattern.
[0123] 3. Anchor Pattern Distribution Characteristics Analysis. ① Statistically analyze the percentage of key inspection depressions in different depth ranges. According to industrial standards, the depth is divided into three ranges: ≤50μm, 50μm<H≤100μm, and >100μm. Calculate the percentage of depressions in each range to the total number of key depressions, and generate an anchor pattern depth distribution histogram; ② Analyze the distribution pattern of anchor patterns in the axial and circumferential directions of the pipe to determine whether there are problems such as excessively deep, shallow, or unevenly distributed anchor patterns at local axial points or circumferential areas, and mark abnormal areas.
[0124] 4. Quality Grade Determination. Based on the quality standard for metal pipe anchor pattern inspection entered in step S100, the quality grade of the inspection results is determined. The determination rules are as follows: ① If the average anchor pattern depth is within the qualified depth range, and the proportion of each depth interval meets the requirements for uniform distribution, and there are no obvious abnormal areas, then the anchor pattern of the metal pipe is deemed qualified; ② If the average anchor pattern depth exceeds the qualified depth range, or the uniform distribution does not meet the standard, or there are obvious abnormal areas, then the anchor pattern of the pipe is deemed unqualified, and the reason for the unqualification is clearly stated, such as the average value exceeding the standard, uneven distribution, or the anchor pattern being too deep / too shallow in some areas.
[0125] 5. Standardized Inspection Report Generation. The computer control system automatically generates an inspection report for the anchorage of metal pipes. The report adopts an industrial standardized format and includes six core parts: ① Pipe basic information (inner diameter, length, sandblasting process, inspection time); ② Inspection system parameters (core operating parameters of camera, photoelectric probe, and inspection device); ③ Distribution of inspection points (number and location of axial inspection points); ④ Inspection data statistics (total number of key depressions, average depth, maximum, minimum, median, and depth distribution percentage); ⑤ Distribution characteristic analysis (depth distribution histogram, axial / circumferential distribution pattern, and marking of abnormal areas); ⑥ Quality grade determination (pass / fail, reason for failure).
[0126] 6. Full storage and traceability of test data: The test data includes the metal pipe anchor texture test report, the total table of actual depth data of the deepest anchor texture, the panoramic image of the inner wall of the pipe, and the original photoelectric measurement data. The storage path is set according to "pipe number-test time". At the same time, it supports cloud-based synchronous storage of data, so as to realize the full query and traceability of test data.
[0127] This application also provides an image analysis-based system for detecting the anchor texture of metal pipes, including:
[0128] The image acquisition module is used to acquire panoramic images of the inside of metal pipes using a 3D industrial camera. The panoramic images include 2D texture images and 3D point cloud data.
[0129] The preprocessing module is used to preprocess the panoramic image and enhance the anchor pattern features to form an enhanced two-dimensional contour image and optimized three-dimensional point cloud data.
[0130] The contour segmentation module is used to identify potential independent anchor pattern concave core regions in the enhanced 2D contour image using the watershed segmentation algorithm, and marks the core regions as initial seed points; it uses a lightweight convolutional neural network to generate contour masks for independent anchor pattern concave in the enhanced 2D contour image; and it combines the initial seed points and contour masks with optimized 3D point cloud data as an auxiliary judgment basis to segment connected anchor pattern concave contours and determine all independent anchor pattern concave contours.
[0131] The depth estimation module is used to determine the depth estimate of each independent anchor pattern recess based on the optimized 3D point cloud data corresponding to the contour of each independent anchor pattern recess.
[0132] The depression screening module is used to determine the average estimated value based on the estimated depth of all independent anchor pattern depressions. Based on the relationship between the estimated depth of each independent anchor pattern depression and the average estimated value, it screens out depressions that need to be detected in the independent anchor pattern depressions.
[0133] The measurement group division module is used to divide the key detection depressions into multiple measurement groups according to the preset circumferential angle grouping threshold, with each measurement group corresponding to a target circumferential angle;
[0134] The depth measurement module is used to control the photoelectric probe to rotate to the circumferential angle of each target, so that the photoelectric probe projects measurement light into the corresponding measurement group, converts the reflected light signal of the measurement light into an electrical signal, and calculates the actual depth data of each key detection depression in the measurement group based on the intensity and variation law of the electrical signal.
[0135] The data aggregation module is used to aggregate all actual depth data of the entire metal pipe to obtain the anchor pattern detection results.
[0136] Although preferred embodiments of this application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application.
[0137] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. A method for detecting anchor texture in metal pipes based on image analysis, characterized in that, include: A panoramic image of the interior of a metal pipe is acquired using a 3D industrial camera. The panoramic image includes a 2D texture image and 3D point cloud data. The panoramic image is preprocessed and anchor pattern feature enhancement is performed to form an enhanced two-dimensional contour image and optimized three-dimensional point cloud data. A watershed segmentation algorithm is used to identify potential independent anchor pattern depression core regions in the enhanced 2D contour image, and the core regions are marked as initial seed points. A lightweight convolutional neural network is used to generate contour masks for independent anchor pattern depressions in the enhanced 2D contour image. Combining the initial seed points and the contour masks, the height difference of the optimized 3D point cloud data is used as an auxiliary judgment criterion. That is, if the 3D height difference between two regions is >2μm, it is determined to be an independent depression. Connected anchor pattern depression contours are segmented, and a single connected contour is segmented into multiple independent anchor pattern depression contours that correspond one-to-one with abrasive impact, thus determining all independent anchor pattern depression contours. The depth estimate of each independent anchor pattern recess is determined based on the optimized 3D point cloud data corresponding to each independent anchor pattern recess contour. An average estimated value is determined based on the estimated depth of all the independent anchor pattern recesses. Based on the relationship between the estimated depth of each independent anchor pattern recess and the average estimated value, key recesses are selected for detection among the independent anchor pattern recesses. The key detection depression is divided into multiple measurement groups according to a pre-set circumferential angle grouping threshold, and each measurement group corresponds to a target circumferential angle; The photoelectric probe is controlled to rotate to the circumferential angle of each target, so that the photoelectric probe projects measurement light into the corresponding measurement group. The measurement light is a continuous straight bright line parallel to the metal pipe generatrix. The reflected light signal of the measurement light is converted into an electrical signal. The actual depth data of each key detection depression in the measurement group is calculated based on the intensity and variation law of the electrical signal. The anchor pattern detection results are obtained by summarizing all the actual depth data of the entire metal pipe.
2. The method for detecting anchor texture of metal pipes based on image analysis according to claim 1, characterized in that, The preprocessing and anchor pattern enhancement processing performed on the panoramic image includes: The two-dimensional texture image is filtered and denoised using a Gaussian filtering algorithm. The contrast of the noise-reduced two-dimensional texture image is enhanced by a histogram equalization algorithm, and the grayscale value of the enhanced two-dimensional texture image is normalized. The Canny edge detection algorithm is used to perform edge detection on the normalized two-dimensional texture image to generate an edge-detected binary image. The edge detection binary image is subjected to dilation-erosion morphological operation to obtain the enhanced two-dimensional texture image; The three-dimensional point cloud data is subjected to outlier removal and smoothing processes to obtain optimized three-dimensional point cloud data.
3. The method for detecting anchor texture of metal pipes based on image analysis according to claim 1, characterized in that, The method for identifying the initial seed points in the enhanced two-dimensional contour image includes: The two-dimensional contour image is segmented using fixed threshold binarization to generate a foreground and background binary image; The Euclidean distance from each foreground pixel to the nearest background pixel is calculated using the Euclidean distance transform method on the binary foreground and background image to generate a distance transform image. The distance transform image is then subjected to threshold segmentation, and pixels with distance values greater than the distance threshold are marked as the initial seed points.
4. The method for detecting anchor texture of metal pipes based on image analysis according to claim 1, characterized in that, The lightweight convolutional neural network includes an input layer, a first convolutional layer, a first pooling layer, a second convolutional layer, a third pooling layer, an activation layer, and a fully connected layer, connected in sequence.
5. The method for detecting anchor texture of metal pipes based on image analysis according to claim 1, characterized in that, The method for determining the estimated depth of each of the individual anchor pattern recesses includes: Extract the three-dimensional coordinates of all pixels in the contour of the independent anchor pattern, determine the pixel with the smallest Z value in the three-dimensional coordinates as the deepest point of the independent anchor pattern, and record the corresponding Z value of the deepest point of the anchor pattern. The arithmetic mean of the Z values of all pixels in the flat area of the inner wall of the metal pipe in the optimized 3D point cloud data is calculated, and the arithmetic mean is used as the Z value of the radial reference plane. The difference between the radial reference plane Z value and the Z value at the deepest point of the anchor pattern is calculated to obtain the depth estimate.
6. The method for detecting anchor texture of metal pipes based on image analysis according to claim 1, characterized in that, The method for screening the key detection depressions includes: Calculate the difference between the estimated depth of each individual anchor groove and the average estimated depth, and determine the absolute value of the ratio of the difference to the average estimated depth. If the absolute value is greater than 20%, the corresponding independent anchor pattern depression will be designated as the key detection depression.
7. The method for detecting anchor texture of metal pipes based on image analysis according to claim 1, characterized in that, The method for dividing the measurement groups includes: The circumferential angle of the first key detection depression is selected as the center angle, and the first key detection depression and all other key detection depressions whose difference from the center angle is within the circumferential angle grouping threshold are classified into the first measurement group. The circumferential angle of the first ungrouped key detection depression is selected as the new center angle. The first ungrouped key detection depression and all other ungrouped key detection depressions whose difference from the new center angle is within the circumferential angle grouping threshold are classified into the second measurement group. Repeat the above steps until all the key detection depressions have been grouped.
8. The method for detecting anchor texture of metal pipes based on image analysis according to claim 1, characterized in that, When calculating the actual depth data, the three-dimensional coordinates of the deepest point of each key detection depression are obtained, and only the actual depth data under these three-dimensional coordinates are extracted.
9. The method for detecting anchor texture of metal pipes based on image analysis according to claim 1, characterized in that, The methods for summarizing the actual depth data include: The average anchor depth of the entire metal pipe is calculated based on the actual depth data. The percentage of the key detection depressions in different depth ranges was statistically analyzed. Analyze the distribution patterns of anchor patterns in the axial and circumferential directions of metal pipes to identify abnormal areas.
10. A system for detecting the anchorage density of metal pipes based on image analysis as described in any one of claims 1-9, characterized in that, The system includes: The image acquisition module is used to acquire panoramic images of the inside of metal pipes using a 3D industrial camera. The panoramic images include 2D texture images and 3D point cloud data. The preprocessing module is used to preprocess the panoramic image and enhance the anchor pattern features to form an enhanced two-dimensional contour image and optimized three-dimensional point cloud data. The contour segmentation module is used to identify potential independent anchor pattern concave core regions in the enhanced 2D contour image using a watershed segmentation algorithm, and to mark the core regions as initial seed points; to generate contour masks of independent anchor pattern concave in the enhanced 2D contour image using a lightweight convolutional neural network; and to segment connected anchor pattern concave contours by combining the initial seed points and the contour masks, with the optimized 3D point cloud data as an auxiliary judgment basis, to determine all independent anchor pattern concave contours. The depth estimation module is used to determine the depth estimation value of each independent anchor pattern recess based on the optimized three-dimensional point cloud data corresponding to each independent anchor pattern recess contour. The depression screening module is used to determine the average estimated value based on the estimated value of the depth of all the independent anchor pattern depressions, and to screen out depressions for key detection based on the relationship between the estimated value of the depth of each independent anchor pattern depression and the average estimated value. The measurement group division module is used to divide the key detection depression into multiple measurement groups according to a preset circumferential angle grouping threshold, and each measurement group corresponds to a target circumferential angle. The depth measurement module is used to control the photoelectric probe to rotate to the circumferential angle of each target, so that the photoelectric probe projects measurement light into the corresponding measurement group, converts the reflected light signal of the measurement light into an electrical signal, and calculates the actual depth data of each key detection depression in the measurement group based on the intensity and variation law of the electrical signal. The data aggregation module is used to aggregate all the actual depth data of the entire metal pipe to obtain the anchor pattern detection results.