Pipeline x-ray flaw detection method and system based on multi-view self-adaptation

By acquiring pipeline structural parameters to generate multi-view detection configuration parameters, controlling X-ray inspection equipment to acquire images from multiple angles and perform viewpoint adaptive feature fusion, the problems of missed detection and false detection in single-view detection are solved, and efficient and accurate pipeline defect detection is achieved.

CN120651879BActive Publication Date: 2025-10-24SICHUAN CHUANHUAXINHE TESTING TECHNOLOGY CO LTD

Patent Information

Application Number
CN202511170730.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-20
Publication Date
2025-10-24
Estimated Expiration
2045-08-20

AI Technical Summary

Technical Problem

Existing pipe X-ray flaw detection methods suffer from problems such as missed detections and false detections due to single-view inspection, and lack adaptive adjustment for different structural parameters, resulting in low detection efficiency and accuracy.

Method used

By obtaining a set of pipeline structural parameters, generating multi-view detection configuration parameters, controlling the X-ray detection equipment to acquire multi-angle images, and combining the multi-view X-ray image set to perform perspective adaptive feature fusion, a comprehensive feature set of pipeline defects is generated.

Benefits of technology

It improves the accuracy and reliability of pipeline defect detection, and significantly enhances the quality and efficiency of pipeline X-ray flaw detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120651879B_ABST
    Figure CN120651879B_ABST
Patent Text Reader

Abstract

The application provides a pipeline X-ray flaw detection method and system based on multi-view self-adaption, and belongs to the technical field of pipeline flaw detection. Firstly, a pipeline structure parameter set of a pipeline to be detected is acquired, and multi-view detection configuration parameters are generated according to the pipeline structure parameter set, covering the relative distance between a ray source and a pipeline surface, a ray emission angle and a detection equipment displacement step parameter. Based on the multi-view detection configuration parameters, an X-ray detection equipment is controlled to perform a multi-angle image acquisition operation, and a multi-view X-ray image set composed of pipeline cross-section and longitudinal section image units under different detection angles is obtained. The multi-view X-ray image set is subjected to view angle self-adaption feature fusion processing, and a pipeline defect comprehensive feature set with view angle complementarity is generated. Finally, a pipeline flaw detection result report containing defect position coordinates, defect type identification and defect size parameters is generated according to the pipeline defect comprehensive feature set, and the quality and efficiency of pipeline X-ray flaw detection are significantly improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of pipeline flaw detection, in particular to a pipeline X-ray flaw detection method and system based on multi-view self-adaptation. BACKGROUND

[0002] In the industrial field, pipelines are key facilities for transporting fluid media such as oil, natural gas, and chemical raw materials. The safety and integrity of pipelines are of great importance. Once a pipeline has defects such as cracks, corrosion, and weld defects, it may cause media leakage, which not only causes resource waste and economic loss, but also may cause environmental pollution and safety accidents. Therefore, regular and accurate flaw detection of pipelines is a necessary means to ensure the safe operation of pipelines.

[0003] Currently, common pipeline flaw detection methods mainly include ultrasonic detection, magnetic powder detection, and X-ray detection. Among them, X-ray detection has been widely used in pipeline flaw detection because it can directly show the shape and position of internal defects in the pipeline. However, the existing pipeline X-ray flaw detection method has some limitations. On the one hand, traditional X-ray detection usually uses a single view for detection. Due to the complexity of the pipeline structure, the single-view detection image may not fully and accurately reflect the internal defect situation of the pipeline, and may easily cause missed detection and false detection. On the other hand, for pipelines with different structural parameters such as diameter, material, and laying path, the existing detection method often lacks targeted detection configuration and is difficult to adaptively adjust according to the specific characteristics of the pipeline, resulting in low detection efficiency and accuracy. SUMMARY

[0004] In view of the above-mentioned problems, in combination with the first aspect of the present application, the embodiments of the present application provide a pipeline X-ray flaw detection method based on multi-view self-adaptation, which comprises:

[0005] Obtaining a set of pipeline structure parameters of a pipeline to be detected, the set of pipeline structure parameters including a pipeline diameter parameter, a pipeline material parameter, and a pipeline laying path parameter;

[0006] Generating multi-view detection configuration parameters according to the set of pipeline structure parameters, the multi-view detection configuration parameters including a relative distance parameter of a ray source and a pipeline surface, a ray emission angle parameter, and a detection device displacement step parameter;

[0007] Controlling an X-ray detection device to perform a multi-angle image acquisition operation on the pipeline to be detected based on the multi-view detection configuration parameters, to obtain a set of multi-view X-ray images, the set of multi-view X-ray images being composed of pipeline cross-sectional image units and pipeline longitudinal cross-sectional image units under different detection angles;

[0008] perform perspective adaptive feature fusion processing on the multi-view X-ray image set to generate a pipe defect comprehensive feature set with perspective complementarity;

[0009] generate a pipe defect detection result report according to the pipe defect comprehensive feature set, wherein the pipe defect detection result report includes defect position coordinates, defect type identification, and defect size parameters.

[0010] In still another aspect, an embodiment of the present application also provides a pipe X-ray detection system based on multi-view adaptation, which comprises a processor and a machine readable storage medium, the machine readable storage medium is connected with the processor, the machine readable storage medium is used for storing programs, instructions or codes, and the processor is used for executing the programs, instructions or codes in the machine readable storage medium to realize the above method.

[0011] Based on the above aspects, an embodiment of the present application realizes adaptive adjustment of detection parameters by acquiring a pipe structure parameter set of a pipe to be detected and generating multi-view detection configuration parameters according to the pipe structure parameter set, can formulate an optimal detection scheme for pipes with different structural characteristics, controls an X-ray detection device to perform multi-angle image acquisition operation based on the multi-view detection configuration parameters, obtains a multi-view X-ray image set containing rich information of a pipe cross section and a pipe longitudinal section, performs perspective adaptive feature fusion processing on the multi-view X-ray image set to generate a pipe defect comprehensive feature set with perspective complementarity, and further improves the accuracy and reliability of defect detection. Finally, a detailed pipe defect detection result report is generated according to the pipe defect comprehensive feature set, thereby significantly improving the quality and efficiency of pipe X-ray detection. BRIEF DESCRIPTION OF DRAWINGS

[0012] Figure 1 is a flowchart of the pipe X-ray detection method based on multi-view adaptation provided by an embodiment of the present application.

[0013] Figure 2 is a schematic diagram of exemplary hardware and software components of the pipe X-ray detection system based on multi-view adaptation provided by an embodiment of the present application. DETAILED DESCRIPTION

[0014] The present application will be described in detail below with reference to the accompanying drawings, Figure 1 is a flowchart of the pipe X-ray detection method based on multi-view adaptation provided by an embodiment of the present application, and the pipe X-ray detection method based on multi-view adaptation will be described in detail below.

[0015] This embodiment takes X-ray detection of an industrial pipe as a scene to describe the specific implementation process of the pipe X-ray detection method based on multi-view adaptation.

[0016] Step S110: Obtain the pipeline structure parameter set of the pipeline to be detected, which includes the pipeline diameter parameter, the pipeline material parameter and the pipeline laying path parameter.

[0017] In this embodiment, for the pipeline diameter parameter, in addition to checking the design drawings, it can also be verified by field measurement. A laser diameter measuring instrument is used to select multiple measurement points at different positions of the pipeline and measure their outer diameters respectively. When measuring, ensure that the laser beam is perpendicular to the pipeline axis to reduce measurement error. Take the average of the results of multiple measurements as the final pipeline diameter parameter. If there is a large deviation between the measured value and the value marked on the design drawing, further check whether the pipeline has deformation and the like, and record the relevant differences.

[0018] In addition to design data and material certification documents, the pipeline material parameter can also be confirmed by material analysis instruments. For example, a spectrum analyzer is used to detect the pipeline surface to analyze its element composition and accurately determine the pipeline material. For some old pipelines, the material certification documents may be lost or blurred, and the above-mentioned auxiliary detection method can effectively ensure the accuracy of the material parameter. At the same time, record the specific grade, heat treatment state and other information of the pipeline material, which will also affect the attenuation characteristics of X-ray.

[0019] For the determination of the pipeline laying path parameter, three-dimensional laser scanning technology can be used during field investigation, which can quickly obtain three-dimensional point cloud data of the pipeline. Through professional point cloud processing software, the trend, position, bending radius and other parameters of the pipeline can be accurately extracted. For buried pipelines or partially blocked pipelines, underground pipeline detectors and other equipment can be used for detection. The obtained path parameters are arranged to form a detailed pipeline laying path diagram, and the starting point, end point of the horizontal laying section, vertical laying section and bending section, and the curvature center of the bending section are marked.

[0020] Step S120: Generate multi-view detection configuration parameters according to the pipeline structure parameter set, which includes the relative distance parameter between the ray source and the pipeline surface, the ray emission angle parameter and the detection equipment displacement step parameter.

[0021] Generating multi-view detection configuration parameters based on pipeline structure parameters is a key step to realize accurate detection, which needs to consider the correlation and influence between various parameters.

[0022] Step S121: Analyze the pipeline diameter parameter in the pipeline structure parameter set, determine the ray source focal point size parameter matched with the pipeline diameter parameter, and the ray source focal point size parameter is positively correlated with the pipeline diameter parameter.

[0023] In the analysis of the pipe diameter parameter, the obtained diameter data is first filtered to remove outliers. The sliding average filtering method can be used, and a sliding window is set. The average value of the diameter data in the window is taken as the diameter value at the center position of the window. Through the above method, the influence of random errors in the measurement process on the diameter parameter can be reduced.

[0024] In determining the focal point size parameter of the ray source, a pre-established corresponding relationship model of pipe diameter and focal point size is used. This corresponding relationship model is obtained by fitting a large amount of experimental data. For example, when the pipe diameter is in a certain range, the corresponding focal point size is in another range. In actual application, the analyzed pipe diameter parameter is input into the corresponding relationship model, and the corresponding relationship model outputs a suggested value of the focal point size parameter of the ray source. At the same time, the type and energy level of the ray source also need to be considered. Different types and energy levels of the ray source have different ranges of selectable focal point sizes and different influences on the detection results. For high-energy ray sources, the focal point size can be appropriately increased to improve the ray intensity; for low-energy ray sources, the focal point size needs to be smaller to ensure the resolution of the image.

[0025] Step S122: Based on the pipe material parameter, a pre-set material attenuation coefficient reference table is queried to obtain an X-ray attenuation coefficient parameter corresponding to the pipe material parameter. The X-ray attenuation coefficient parameter is used to adjust the emission intensity parameter of the ray source.

[0026] The pre-set material attenuation coefficient reference table not only contains the attenuation coefficients of different materials, but also contains the attenuation coefficient values under different X-ray energies. Because the same material will change its attenuation coefficient under different X-ray energies, the energy parameter of the X-ray needs to be determined at the time of querying. If the pipe material is a composite material, the attenuation coefficients of each component part need to be queried respectively, and the comprehensive attenuation coefficient is calculated according to the thickness proportion of each part.

[0027] After obtaining the X-ray attenuation coefficient parameter, the emission intensity is adjusted according to the corresponding relationship between the attenuation coefficient and the emission intensity of the ray source. This corresponding relationship can be derived by formula, for example, the emission intensity needs to be in a certain proportional relationship with the attenuation coefficient, so as to ensure that the ray intensity reaching the detector after attenuation by the pipe can meet the image acquisition requirements. At the same time, the wall thickness parameter of the pipe also needs to be considered. The greater the wall thickness, the greater the required emission intensity. During the adjustment process, multiple simulation calculations need to be performed to verify the rationality of the emission intensity setting.

[0028] Step S123: According to the pipe laying path parameter, the spatial direction change characteristics of the pipe to be detected are identified, which include horizontal laying segment identification, vertical laying segment identification and curved segment identification.

[0029] When analyzing the pipeline laying path parameters, the point cloud data obtained by the three-dimensional laser scanning is imported into the path analysis software. The software will automatically segment the path and calculate the slope and curvature of each segment. When the slope of a segment is within the preset horizontal slope range (such as -0.5% to 0.5%), it is marked as a horizontal laying segment; when the slope exceeds the horizontal slope range and the direction is vertical, it is marked as a vertical laying segment. For curved segments, the curvature radius is calculated, and when the curvature radius is less than the preset value, it is marked as a curved segment, and the starting angle, ending angle, and other information of the curved segment are recorded.

[0030] During the identification process, some transitional pipeline segments, such as the transition area from a horizontal segment to a vertical segment, need to be specially marked because these areas are more difficult to detect and require more detailed detection configurations. At the same time, the bending direction of the curved segment (such as left bending or right bending) is determined, which will affect the adjustment of the motion direction and the ray emission angle of the detection device.

[0031] Step S124: Generate detection device motion trajectory planning parameters based on the spatial trend change characteristics, which include straight line motion segment parameters and curve motion segment parameters. The curve motion segment parameters match the curvature radius parameters identified by the curved segment.

[0032] When generating straight line motion segment parameters, for horizontal laying segments, the motion direction is consistent with the axis direction of the pipeline, and the motion speed is determined according to the diameter of the pipeline and the detection accuracy requirements. Generally, the larger the pipeline diameter, the lower the motion speed can be appropriately reduced to ensure sufficient time to collect image details. At the same time, acceleration and deceleration stages are set to ensure smooth operation of the detection device when starting and stopping, avoiding device vibration caused by sudden speed changes, which affects image acquisition quality.

[0033] For vertical laying segments, in addition to the motion direction and speed, the influence of gravity also needs to be considered. In the motion trajectory planning, appropriate driving force parameters are set to overcome the influence of gravity on device motion, ensuring that the device can move stably along the vertical direction.

[0034] When generating curve motion segment parameters, the central angle and arc length of the motion trajectory are calculated according to the curvature radius of the curved segment. The speed of curve motion needs to be set lower than that of straight line motion because in the curved segment, the device needs to constantly adjust the direction, and a lower speed can ensure the stability of the motion. At the same time, the acceleration and jerk parameters of curve motion are set to ensure smooth transition when entering and leaving the curved segment, reducing impact.

[0035] Step S125: input the ray source focal point size parameter, X-ray attenuation coefficient parameter and detection device motion trajectory planning parameter into a multi-view configuration generation model to generate a multi-view detection configuration parameter containing a relative distance parameter of the ray source and the pipe surface, a ray emission angle parameter and a detection device displacement step parameter, the ray emission angle parameter being dynamically adjusted by a preset angle increment within the detection area corresponding to the bending section.

[0036] The multi-view configuration generation model adopts a deep learning model, and training data of the deep learning model contains a large number of optimal detection configuration parameter cases under different pipe structure parameters. An input layer of the deep learning model receives the ray source focal point size parameter, the X-ray attenuation coefficient parameter and the detection device motion trajectory planning parameter, and finally outputs the multi-view detection configuration parameter through feature extraction and processing of a plurality of hidden layers.

[0037] When calculating the relative distance parameter of the ray source and the pipe surface, the model comprehensively considers factors such as the ray source focal point size, the pipe diameter and the X-ray energy. If the distance is too close, the divergence angle of the ray beam is too small, and the entire pipe cross section may not be covered; if the distance is too far, the ray intensity attenuation is too large, and the image quality may be affected. The model calculates an optimal distance value through an internal algorithm to ensure that the ray beam can cover the detection area at the best angle and intensity.

[0038] The generation of the ray emission angle parameter is as follows: in a straight section, the model determines a fixed emission angle range according to the diameter of the pipe and the detection range, so that the ray beam can cover each direction of the pipe. In a bending section, the preset angle increment is determined according to the curvature radius of the bending section. The smaller the curvature radius, the smaller the angle increment, so as to ensure that the bending part can be detected from enough angles. For example, for a bending section with a small curvature radius, the angle increment can be set to 5 degrees. The ray emission angle is increased by 5 degrees every time the detection device moves a certain distance, until the detection of the entire bending section is completed.

[0039] The determination of the detection device displacement step parameter balances the detection accuracy and efficiency. For high-risk areas where defects may exist on the pipe surface, the displacement step is set to be small to improve the detection resolution; for relatively safe areas, the displacement step can be appropriately increased to improve the detection efficiency. At the same time, the displacement step also needs to match the emission angle range of the ray source to ensure that there is a certain overlap area between the images collected at adjacent times, so as to avoid the occurrence of a detection blind area.

[0040] Step S130: based on the multi-view detection configuration parameter, control the X-ray detection device to perform a multi-angle image acquisition operation on the pipe to be detected to obtain a multi-view X-ray image set, the multi-view X-ray image set being composed of pipe cross section image units and pipe longitudinal section image units under different detection angles.

[0041] According to the multi-view detection configuration parameter control X-ray detection equipment for image acquisition, is the core process of obtaining detection data, need to accurately control the motion of the device and the emission of rays.

[0042] Step S131: send the multi-view detection configuration parameter to the motion control module of the X-ray detection equipment, call the motion control module to drive the detection mechanical arm to perform intermittent displacement operation according to the detection equipment displacement step parameter.

[0043] After receiving the multi-view detection configuration parameter, the motion control module analyzes the detection equipment displacement step parameter and converts it into the motion instruction of the mechanical arm. The driving of the mechanical arm adopts servo motor, which can accurately control the displacement and speed of the mechanical arm. In the intermittent displacement operation, the mechanical arm can be positioned through the position sensor after moving a displacement step, to ensure that the actual displacement is consistent with the set value. If there is deviation, the motion control module will issue a correction instruction to adjust the position of the mechanical arm.

[0044] In the process of mechanical arm movement, its motion state such as speed, acceleration, vibration and other parameters are monitored in real time. If abnormality is found, the movement is stopped immediately and an alarm signal is sent out for the operator to handle in time. At the same time, the motion trajectory data of the mechanical arm is recorded.

[0045] Step S132: at each displacement stop point, call the motion control module to adjust the spatial position relationship between the ray source and the pipe to be detected according to the relative distance parameter of the ray source and the pipe surface, so that the vertical distance between the ray source focal point and the pipe surface remains constant.

[0046] At each displacement stop point, the motion control module measures the vertical distance between the ray source focal point and the pipe surface in real time through the laser ranging sensor. Compare the measured value with the set relative distance parameter, if there is difference, control the adjusting mechanism on the mechanical arm to adjust. The adjusting mechanism can adopt precision lead screw nut structure, through motor driving screw rotation, drive the ray source to move along the direction perpendicular to the pipe surface, until the distance reaches the set value.

[0047] In the adjustment process, the laser ranging sensor measures at a high frequency to ensure the accuracy of distance adjustment. At the same time, considering the unevenness of the pipe surface, multiple measurement points are selected during measurement, and the average value is taken as the final distance value, so as to reduce the influence of surface unevenness on the measurement result.

[0048] Step S133: call the angle adjusting unit of the X-ray detection equipment to adjust the emission direction of the ray source according to the ray emission angle parameter, so that the X-ray beam irradiates the target detection area of the pipe to be detected at the preset incident angle, and the target detection area includes the circumferential area of the pipe cross section and the axial area of the pipe longitudinal section.

[0049] The angle adjusting unit is composed of a rotating table and an angle sensor. The rotating table is used to support the ray source and can rotate in horizontal and vertical directions to adjust the emission direction of the ray source. The angle sensor monitors the rotation angle of the rotating table in real time and feeds back data to the control unit. When the ray emission angle parameter is received, the control unit drives the rotating table to rotate until the measured value of the angle sensor is consistent with the set emission angle parameter.

[0050] For the circumferential area of the pipe cross section, the setting of the preset incident angle needs to ensure that the ray beam can cover the entire circumference. For example, the emission angle can be set to vary within the range of 0 degrees to 360 degrees, and the cross-sectional images in different directions can be obtained by rotating a certain angle each time. For the axial area of the pipe longitudinal section, the incident angle is set along the axis, and multiple different axial angles can be set according to the length of the pipe and the detection range to fully capture the information of the longitudinal section.

[0051] When adjusting the emission direction, it is necessary to avoid the ray beam being blocked by the detection device itself or other obstacles. By pre-planning the motion trajectory and emission angle range of the ray source, it is ensured that the ray beam can accurately reach the target detection area.

[0052] Step S134: When the relative position of the ray source and the pipe surface and the emission angle adjustment are completed, the X-ray detector is triggered to perform image acquisition operation to obtain the original X-ray image containing the internal structure information of the pipe, and the exposure time parameter of the original X-ray image is in a positive correlation with the X-ray attenuation coefficient parameter.

[0053] After the position and emission angle of the ray source are adjusted, the control unit sends a trigger signal to the X-ray detector. After receiving the signal, the detector starts exposure and collects images. The setting of the exposure time parameter is determined according to the X-ray attenuation coefficient parameter, and the emission intensity of the ray source and the sensitivity of the detector also need to be considered. The relationship model between the exposure time, the attenuation coefficient, the emission intensity and the detector sensitivity can be established through experiments, and the optimal exposure time can be calculated according to the model.

[0054] During the image acquisition process, the detector monitors the ray intensity in real time, and if the ray intensity exceeds the preset range, the exposure time is automatically adjusted or a signal is sent to the control unit to require adjusting the emission intensity of the ray source. The original X-ray image collected is stored in the memory of the device in the form of digital signal, and related information such as acquisition time, position, ray parameter, etc. is also recorded.

[0055] Step S135: Add a view angle identification tag to each original X-ray image collected at each displacement stop point, the view angle identification tag containing a ray emission angle parameter value and a displacement step cumulative value, combine the original X-ray images after adding the view angle identification tag in the order of acquisition time sequence to generate a multi-view X-ray image set containing pipe cross-sectional image units and pipe longitudinal cross-sectional image units.

[0056] When adding the view angle identification tag, the metadata is embedded into the original X-ray image file. The ray emission angle parameter value is accurate to one decimal place, and the displacement step cumulative value is calculated according to the actual displacement of the mechanical arm, accurate to the millimeter level. In addition to these two parameters, auxiliary information such as acquisition time and detector temperature can also be added to facilitate subsequent image management and analysis.

[0057] When combining the images in the order of acquisition time sequence, an index file is established to record the file name, view angle identification tag and position in the sequence of each image. The pipe cross-sectional image units and pipe longitudinal cross-sectional image units are stored in different folders, and the image type is noted in the index file. In this way, the required image units can be quickly retrieved and extracted during subsequent processing.

[0058] Step S140: Perform view angle adaptive feature fusion processing on the multi-view X-ray image set to generate a pipe defect comprehensive feature set with complementary views.

[0059] Feature fusion processing on the multi-view X-ray image set is a key step in extracting effective defect information from a large amount of image data, which can fully utilize the advantages of different view images and improve the accuracy of defect detection.

[0060] Step S141: Extract all pipe cross-sectional image units from the multi-view X-ray image set, and perform circumferential direction gradient enhancement processing on each pipe cross-sectional image unit to strengthen the edge profile information of the inner and outer walls of the pipe to obtain edge-enhanced cross-sectional image units.

[0061] When extracting pipe cross-sectional image units from the multi-view X-ray image set, the image type identification in the index file is used for screening. The screened cross-sectional image units are imported into image processing software for subsequent gradient enhancement processing.

[0062] Step S1411: Traverse all image units in the multi-view X-ray image set, and screen all pipe cross-sectional image units according to the view angle identification tag to establish a cross-sectional image sequence.

[0063] During the traversal, the metadata of each image unit is read one by one, and the image type identifier therein is checked. If the identifier is a cross-sectional image, the image unit is added to the cross-sectional image sequence. When the sequence is established, the image units are arranged in the order of the acquisition time sequence, and the cumulative displacement step value corresponding to each image unit is recorded to reflect its position on the pipeline.

[0064] For the image units that are blurred or damaged in the sequence, a mark is made and the image units are removed to avoid affecting the subsequent processing results. If the number of removed image units is large, reacquisition of the images of the relevant region needs to be considered.

[0065] Step S1412: performing gray scale normalization processing on each pipeline cross-sectional image unit in the cross-sectional image sequence, calculating a horizontal direction gradient image and a vertical direction gradient image using a Sobel operator in the normalized pipeline cross-sectional image unit, and converting the gradient image into a polar coordinate gradient image based on polar coordinate transformation, wherein the radial coordinate of the polar coordinate gradient image corresponds to the radial direction of the pipeline, and the angular coordinate corresponds to the circumferential direction.

[0066] The gray scale normalization processing uses a linear transformation method to map the gray scale value of the image to the range of 0-255. The minimum gray scale value and the maximum gray scale value of the image are calculated, and the gray scale value of each pixel is converted by the formula (gray scale value-minimum gray scale value) / (maximum gray scale value-minimum gray scale value) x 255. The above processing can eliminate the gray scale difference between different images and make the contrast of the image more consistent.

[0067] When the Sobel operator is used to calculate the gradient image, the Sobel operator template in the horizontal direction and the Sobel operator template in the vertical direction are respectively convolved with the image. During the convolution operation process, each pixel point is calculated to obtain the gradient values in the horizontal and vertical directions. The horizontal direction gradient image can highlight the edges in the horizontal direction of the image, and the vertical direction gradient image can highlight the edges in the vertical direction.

[0068] During the polar coordinate transformation, the center of the image is taken as the pole, and the pixel coordinates (x, y) in the rectangular coordinate system are converted into polar coordinates (r, θ), wherein r is the radial coordinate and θ is the angular coordinate. The conversion formula is r=(x²+y²)1 / 2, θ=arctan2(y, x). Through the above transformation, the circumferential edge of the pipeline cross-section is expressed as an angular change in the polar coordinate gradient image, which facilitates the gradient enhancement processing in the circumferential direction.

[0069] Step S1413: Gaussian filtering is performed on the angle direction of the polar coordinate gradient image, the gradient amplitude and the gradient direction of the filtered polar coordinate gradient image are calculated, the pixel points with gradient amplitude greater than a preset threshold are marked as edge candidate points, adjacent edge candidate points are connected to form a closed contour line, and an edge-enhanced cross-section image unit is obtained.

[0070] In the Gaussian filtering process, the standard deviation of the Gaussian function is determined according to the noise level of the image. The greater the noise, the greater the standard deviation, and the more obvious the filtering effect, but at the same time, the edge information may become blurred. Therefore, in actual operation, the noise level of the polar coordinate gradient image needs to be evaluated first. The noise level can be judged by calculating the gray variance of the image. The greater the gray variance, the more noise the image has. According to the noise evaluation result, a suitable standard deviation is selected from a preset standard deviation sequence. For example, when the gray variance is in a small range, a small standard deviation is selected; when the gray variance is large, a large standard deviation is selected.

[0071] The specific operation of Gaussian filtering is to slide and convolve the filter template generated by the Gaussian function in the angle direction of the polar coordinate gradient image. The size of the filter template is determined according to the resolution and detail richness of the image. If the template is too large, the image may be excessively blurred, and if the template is too small, the noise cannot be effectively filtered out. In the convolution process, the gray value of each pixel point is replaced by the weighted average value of the gray values of the surrounding pixel points, and the weight is determined by the Gaussian function. The closer the pixel point to the center, the greater the weight.

[0072] After Gaussian filtering is completed, the gradient amplitude and the gradient direction are calculated. The gradient amplitude is obtained by taking the square root of the sum of the squares of the horizontal direction gradient value and the vertical direction gradient value, and the gradient direction is determined by taking the inverse tangent value of the vertical direction gradient value and the horizontal direction gradient value. The gradient amplitude reflects the strength of the edge change at the pixel point, and the gradient direction indicates the direction of the edge.

[0073] The determination of the preset threshold needs to consider the overall gradient distribution of the image. Otsu's method can be used to automatically determine the threshold. This method finds the best threshold by maximizing the inter-class variance of the foreground and background, which can effectively distinguish edge pixels and non-edge pixels. After marking the pixel points with gradient amplitude greater than the threshold as edge candidate points, the eight-neighbor connection method is used to connect adjacent edge candidate points. That is, for each edge candidate point, check whether the pixel points in the surrounding 8 directions are also edge candidate points, and if so, connect them. Through the above method, a closed contour line is gradually formed. The above contour line clearly outlines the edges of the inner wall and the outer wall of the pipeline, thereby obtaining an edge-enhanced cross-section image unit.

[0074] Step S142: Based on the edge-enhanced cross-sectional image unit, the inner wall region and the outer wall region of the pipeline are extracted, and the annular region width parameter between the inner wall region and the outer wall region is calculated as the pipeline wall thickness feature.

[0075] Step S1421: In the edge-enhanced cross-sectional image unit, the outermost closed contour line and the innermost closed contour line are identified as the initial outer wall contour and the initial inner wall contour, respectively.

[0076] The edge-enhanced cross-sectional image unit is subjected to contour extraction, and a chain code-based contour tracking algorithm is adopted. Starting from the top left corner of the image, the pixel points are scanned in the order from left to right and from top to bottom, and when the first edge pixel point is encountered, the tracking of the contour is started from this point. In the tracking process, the coordinates of each pixel point are recorded, and the direction of the contour is determined according to the connection relationship of the pixel points. When returning to the starting point, the tracking of a closed contour line is completed.

[0077] After obtaining all the closed contour lines, the area enclosed by each contour line is calculated. The closed contour line with the largest area is usually the outer wall contour of the pipeline, which is taken as the initial outer wall contour; the closed contour line with the smallest area and located inside the initial outer wall contour is taken as the initial inner wall contour. If there are multiple contour lines with similar areas, further judgment needs to be made in combination with the diameter parameter and the wall thickness feature of the pipeline to exclude false contour lines formed by noise or false edges.

[0078] Step S1422: The pixel points on the initial outer wall contour are taken as the region growth seed points, a gray similarity threshold is set, and a region growth operation is performed in the edge-enhanced cross-sectional image unit to obtain the outer wall region.

[0079] Multiple pixel points uniformly distributed on the initial outer wall contour are selected as seed points to ensure the uniformity of region growth. The setting of the gray similarity threshold needs to refer to the gray distribution characteristics of the image, and the threshold is set to several times the standard deviation by calculating the gray mean and standard deviation of the pixel points around the seed points. For example, the threshold is set to 1.5 times the standard deviation, and when the difference between the gray value of a pixel point and the gray value of a seed point is within the threshold range, it is included in the outer wall region.

[0080] The region growth operation is performed in an iterative manner, and each iteration adds the pixel points that meet the conditions to the outer wall region, and continues to grow with these newly added pixel points as new seed points until there are no new pixel points that meet the conditions. In the growth process, in order to avoid excessive growth of the region, the maximum area of the growth region can be set, which is calculated according to the diameter parameter of the pipeline and the scale of the image.

[0081] Step S1423: Taking the pixel points on the initial contour of the inner wall as the seed points of region growing, and using the same gray similarity threshold as the outer wall region to perform region growing operation to obtain the inner wall region.

[0082] Similar to the growth process of the outer wall region, the pixel points on the initial contour of the inner wall are selected as the seed points, and the same gray similarity threshold is used for region growing. In this way, the extraction standards of the inner wall region and the outer wall region are consistent, and the errors caused by different thresholds are reduced. During the growth process, the maximum area limit is also set to ensure the accuracy of the inner wall region. At the same time, it needs to be noted that the inner wall region cannot exceed the range of the outer wall region. If the above situation occurs, the growth process needs to be adjusted and the pixel points exceeding the range are removed.

[0083] Step S1424: Calculate the minimum circumscribed rectangle parameters of the outer wall region and the inner wall region, and align the outer wall region and the inner wall region through the rectangular center point coordinates.

[0084] When calculating the minimum circumscribed rectangle parameters, the rotating caliper method is used. For the outer wall region, by constantly rotating the angle of the caliper, the smallest rectangle that can completely surround the outer wall region is found, and the length, width, center point coordinates and rotation angle of the rectangle are recorded. The same method is used to calculate the minimum circumscribed rectangle parameters of the inner wall region.

[0085] The center point coordinates of the minimum circumscribed rectangles of the outer wall region and the inner wall region are aligned, and the images of the outer wall region and the inner wall region are translated to make the two center points coincide. In this way, the inconsistency of the region position caused by the possible offset in the image acquisition process can be eliminated, which is convenient for subsequent distance calculation.

[0086] Step S1425: In polar coordinates, radially scan the outer wall region and the inner wall region, calculate the distance value between the outer wall region boundary and the inner wall region boundary in different angle directions, and obtain the radial distance parameters in multiple angle directions.

[0087] In the polar coordinate system, taking the aligned center point as the pole, starting from 0 degrees, the two regions are radially scanned at a certain angle interval (such as 1 degree). In each angle direction, a ray is emitted outward from the pole, and the intersection coordinates of the ray with the outer wall region boundary and the inner wall region boundary are recorded respectively. The distance between the two intersection points is the radial distance parameter in that angle direction.

[0088] In order to improve the accuracy of measurement, multiple scans are performed in each angle direction, and the average value is taken as the radial distance parameter in that angle. At the same time, for the case that the ray does not intersect with the region boundary during the scanning process, the scanning angle needs to be adjusted or the accuracy of region extraction needs to be checked.

[0089] Step S1426: arithmetic average processing is performed on the radial distance parameters of the plurality of angle directions to obtain a ring region width parameter, and the ring region width parameter is taken as the pipe wall thickness feature.

[0090] The radial distance parameters of all angle directions are added and then divided by the number of angles to obtain an arithmetic average value, which is the ring region width parameter. Since the pipe can have ellipticity or local deformation, the radial distance parameters of multiple angles can differ, and arithmetic average processing can reduce the influence of these local deviations on the wall thickness feature. Comparing the ring region width parameter with the standard wall thickness of the pipe can preliminarily determine whether the pipe has defects such as wall thickness thinning.

[0091] Step S143: axial direction contrast enhancement processing is performed on the pipe longitudinal section image units in the multi-view X-ray image set to highlight the gray scale change features of the pipe weld region, to obtain the contrast-enhanced longitudinal section image units.

[0092] Step S1431: all pipe longitudinal section image units are screened from the multi-view X-ray image set, and arranged in sequence according to the acquisition position to form a longitudinal section image sequence.

[0093] Referring to the index file of the multi-view X-ray image set, the pipe longitudinal section image units are screened according to the image type identifier. These image units are sorted according to the size of the displacement step cumulative value to form a longitudinal section image sequence. During sorting, it is necessary to check whether the displacement step between adjacent image units is continuous, and if there is a jump phenomenon, the reason needs to be found and corrected to ensure the integrity and continuity of the sequence.

[0094] Step S1432: dynamic range compression processing is performed on each pipe longitudinal section image unit in the longitudinal section image sequence, and an adaptive histogram equalization algorithm is used to enhance the local contrast of the image and preserve the gray scale detail features of the pipe in the axial direction.

[0095] Dynamic range compression processing is used to solve the problem of excessively wide gray scale value distribution in the image, so that the details of the dark and bright parts can be clearly displayed. Logarithmic transformation or power law transformation methods are used for dynamic range compression, and the specific transformation function is determined according to the gray scale distribution characteristics of the image. For example, for images with overexposed bright regions, logarithmic transformation can be used to compress the high gray scale value range.

[0096] The adaptive histogram equalization algorithm divides the image into multiple non-overlapping sub-regions, and each sub-region is processed by histogram equalization. The size of the sub-region is determined according to the resolution and the richness of the image details. If the sub-region is too small, it may amplify the noise, and if the sub-region is too large, it cannot effectively enhance the local contrast. During the processing, the contrast threshold is limited to avoid over-enhancing the noise. When the cumulative distribution of the histogram of a certain sub-region exceeds the threshold, the excess part is evenly distributed to other gray levels.

[0097] Step S1433: Construct a direction-adjustable Gaussian filter template, set the direction of the Gaussian filter template to be consistent with the axial direction of the pipeline, filter the pipeline longitudinal section image unit after dynamic range compression, suppress the noise component perpendicular to the axial direction, calculate the gray level co-occurrence matrix of the filtered image, extract the energy, entropy and contrast parameters, and determine whether the image contrast meets the preset enhancement condition according to the energy, entropy and contrast parameters.

[0098] The construction of the direction-adjustable Gaussian filter template needs to determine the direction, size and standard deviation of the template. According to the direction angle of the pipeline axial direction in the pipeline longitudinal section image unit, the main axis direction of the Gaussian filter template is set to the direction angle, so that the template can better match the structural characteristics of the pipeline axial direction. The size and standard deviation of the template are determined according to the characteristics of the noise in the image and the size of the pipeline details, so as to effectively suppress the noise perpendicular to the axial direction while preserving the gray level details in the axial direction.

[0099] The filtered image after dynamic range compression is filtered, and the filtering process is similar to the Gaussian filtering of the polar coordinate gradient image, which is realized by sliding convolution. After filtering, the gray level co-occurrence matrix of the image is calculated, which reflects the co-occurrence of different gray value pixels in the image at a certain distance and direction. The direction consistent with the pipeline axial direction and the appropriate distance are selected to calculate the gray level co-occurrence matrix, and the energy, entropy and contrast parameters are extracted.

[0100] The energy parameter reflects the uniformity of the gray level distribution of the image. The greater the energy value, the more uniform the gray value distribution in the image. The entropy parameter reflects the information amount of the image. The greater the entropy value, the more information the image has. The contrast parameter reflects the difference degree of the gray value in the image. The greater the contrast value, the more obvious the light and dark changes in the image. The preset enhancement condition is a range obtained by statistical analysis of the energy, entropy and contrast parameters of a large number of high-quality pipeline longitudinal section images. When the three parameters of the filtered image are within the range, it is determined that the image contrast meets the preset enhancement condition; otherwise, further enhancement processing is needed.

[0101] Step S1434: When the image contrast does not satisfy the preset enhancement condition, performing multi-scale contrast enhancement processing on the pipe longitudinal section image unit, adjusting the reflection component weight at different scales, enhancing the gray difference between the weld area and the background area, and obtaining a longitudinal section image unit after contrast enhancement.

[0102] The multi-scale contrast enhancement processing adopts a Gaussian pyramid decomposition method to decompose the image into a plurality of sub-images at different scales. Each scale of the sub-image corresponds to different spatial frequency components, and the low-frequency component reflects the overall brightness of the image, and the high-frequency component reflects the details and edges of the image.

[0103] For each scale of the sub-image, the reflection component and the illumination component are separated, the reflection component contains the details and contrast information of the image, and the illumination component contains the overall brightness information of the image. Adjust the weight of the reflection component, for the high-frequency details that may exist in the weld area, increase its weight; for the low-frequency component of the background area, appropriately reduce its weight. The adjustment of the weight is determined according to the gray level co-occurrence matrix parameters of the image and the prior knowledge of the weld area, for example, the weld area usually has a higher entropy value and contrast, and the area that needs to be enhanced can be determined according to these characteristics.

[0104] The adjusted reflection component and the illumination component at each scale are recombined to obtain the enhanced sub-image at each scale, and then the Gaussian pyramid is reconstructed to obtain the final multi-scale contrast enhancement image. The gray difference between the weld area and the background area in the multi-scale contrast enhancement image is significantly enhanced, which is convenient for subsequent weld area recognition and defect feature extraction.

[0105] Step S144: In the contrast-enhanced longitudinal section image unit, linear structure features are detected, the position coordinates of the weld area are identified, and the gray distribution features and texture features of the weld area are extracted as weld area defect features.

[0106] Step S1441: Hough transform is used to detect the linear structure features in the contrast-enhanced longitudinal section image unit to determine the approximate position range of the weld area.

[0107] Hough transform converts a straight line in the image space into a point in the parameter space to realize the detection of the straight line. For the contrast-enhanced longitudinal section image unit, first, edge detection is performed to obtain an edge image, and then Hough transform is applied to the edge image. The angle range of the Hough transform is set to an angle close to the axial direction of the pipe to improve the accuracy of detecting the linear structure of the weld.

[0108] According to the result of the Hough transform, a line corresponding to a parameter point with a high cumulative value is selected as a candidate linear structure of the weld, and a set of these lines constitutes a rough position range of the weld region. Meanwhile, a cumulative value threshold is set, and lines with a cumulative value lower than the threshold are removed to reduce the interference of false linear structures.

[0109] Step S1442: In the rough position range of the weld region, a region growing method is used to further accurately identify the boundary of the weld region and determine the position coordinates of the weld region.

[0110] The pixel points on the linear structure detected by the Hough transform are used as seed points, and a suitable gray similarity threshold is set for region growing. Since the gray value of the weld region is usually different from that of the pipe base material region, the gray similarity threshold can be determined according to the above difference. During the growing process, the boundary pixel point coordinates of the weld region are recorded, and the polygon boundary of the weld region is obtained by fitting these boundary pixel points, and then the minimum circumscribed rectangle of the weld region is determined, and the vertex coordinates of the minimum circumscribed rectangle are the position coordinates of the weld region.

[0111] Step S1443: In the determined weld region, a gray histogram is calculated, and the gray distribution features such as gray mean, gray variance, skewness and kurtosis are extracted.

[0112] The gray histogram reflects the pixel number distribution of different gray values in the weld region. The gray mean is calculated to reflect the overall brightness level of the weld region, the gray variance reflects the dispersion degree of the gray value, the skewness reflects the asymmetry degree of the histogram, and the kurtosis reflects the sharpness of the histogram. The above features can effectively describe the gray distribution characteristics of the weld region, and if there are defects such as pores and slag, the gray distribution features will change significantly.

[0113] Step S1444: The texture features of the weld region are extracted, including the energy, entropy, contrast and correlation of the gray co-occurrence matrix, and the local binary pattern (LBP) feature.

[0114] In addition to the previously calculated gray co-occurrence matrix features, the correlation parameter is further calculated, which reflects the linear correlation of the gray values in the image. At the same time, the LBP algorithm is used to extract the texture features. The LBP feature encodes each pixel point and its surrounding pixel points into a binary number by comparing their gray values, and then the distribution of the binary numbers is counted as the texture feature. The LBP feature is not sensitive to light changes and can effectively describe the local texture structure of the weld region, which is of great significance for detecting defects such as cracks.

[0115] The extracted gray distribution features and texture features are combined to form the defect features of the weld region.

[0116] Step S145: input the pipeline wall thickness feature and the weld area defect feature into the view angle feature correlation model, calculate the spatial correlation coefficient of the features under different view angles according to the view angle identification label of each image unit, perform weighted fusion processing on the pipeline wall thickness feature and the weld area defect feature based on the spatial correlation coefficient, and generate a pipeline defect comprehensive feature set.

[0117] Step S1451: analyze the view angle identification label of each image unit, extract the ray emission angle parameter and the displacement step cumulative value, and establish a feature-view angle correlation table, which records the acquisition view angle information corresponding to each pipeline wall thickness feature and weld area defect feature.

[0118] For each pipeline wall thickness feature and weld area defect feature, the ray emission angle parameter and the displacement step cumulative value are extracted from the view angle identification label of the corresponding image unit. The identification information (such as feature number) of the feature is one-to-one corresponding to the corresponding ray emission angle parameter and displacement step cumulative value, forming a feature-view angle correlation table. The feature-view angle correlation table clearly reflects the acquisition view angle of each feature.

[0119] Step S1452: construct a pipeline three-dimensional model according to the pipeline laying path parameter in the pipeline structure parameter set, map the acquisition view angle information of each image unit to the spatial coordinate system of the pipeline three-dimensional model, and obtain the three-dimensional coordinates of the feature acquisition points.

[0120] The pipeline three-dimensional model is constructed by using the pipeline laying path parameter, such as pipeline trend, position and bending radius, and using three-dimensional modeling software. The spatial coordinate system of the three-dimensional model takes the starting point of the pipeline as the origin, the axial direction as the X axis, and the radial direction as the Y axis and the Z axis. According to the displacement step cumulative value of the image unit, its position in the axial direction of the pipeline is determined, and combined with the ray emission angle parameter, the position in the radial direction and the circumferential direction is determined. The position information is converted into the coordinates in the three-dimensional model spatial coordinate system, that is, the three-dimensional coordinates of the feature acquisition points are obtained.

[0121] Step S1453: calculate the Euclidean distance between different feature acquisition points, construct a spatial correlation matrix based on the Euclidean distance and the ray emission angle parameter, and the element value of the spatial correlation matrix represents the spatial correlation coefficient between the features corresponding to two feature acquisition points.

[0122] The calculation of the Euclidean distance is realized by the three-dimensional coordinates of the feature acquisition points. The smaller the distance, the closer the two feature acquisition points in space, and the stronger the correlation between the corresponding features. At the same time, the ray emission angle parameter is considered. If the ray emission angles of two feature acquisition points are similar, it means that they are acquired from similar view angles, and the correlation between the features may be stronger.

[0123] The calculation of the spatial correlation coefficient adopts a function of the comprehensive Euclidean distance and the difference of the ray emission angle, for example, the reciprocal of the normalized Euclidean distance is combined with the normalized processing result of the difference of the ray emission angle to obtain the spatial correlation coefficient. The spatial correlation coefficients between all the features are arranged in a matrix form, i.e. a spatial correlation matrix is obtained.

[0124] Step S1454: converting the pipeline wall thickness features and the weld area defect features into feature vector forms, and performing a weighted summation processing on all the feature vectors based on the spatial correlation matrix, the weight of each feature vector being the sum of the spatial correlation coefficients of the feature vector with other feature vectors.

[0125] The pipeline wall thickness features and the weld area defect features are respectively converted into fixed-length feature vectors, and the order and dimension of the features are kept consistent during the conversion. For each feature vector, the sum of all the elements in the corresponding row of the spatial correlation matrix is calculated to obtain the weight of the feature vector. The greater the weight, the stronger the correlation of the feature with other features, and the feature should be given more attention in the fusion process.

[0126] Each feature vector is multiplied by the corresponding weight and then summed to obtain a preliminary fused feature vector.

[0127] Step S1455: performing a dimension normalization processing on the weighted and summed feature vector to obtain a pipeline defect comprehensive feature set.

[0128] The dimension normalization processing adopts a min-max normalization method to map each dimension value of the feature vector to the range of 0-1. The minimum value and the maximum value of each dimension are calculated, and the dimension value is converted by the formula (dimension value-minimum value) / (maximum value-minimum value). The normalization processing can eliminate the dimensional difference between different features, so that the fused feature vector has better comparability and stability. The finally obtained pipeline defect comprehensive feature set contains comprehensive information of the pipeline wall thickness features and the weld area defect features under different perspectives, and each feature exists in the form of a multi-dimensional vector. For example, a certain feature vector in the pipeline defect comprehensive feature set can contain the wall thickness deviation values of different circumferential angles of the pipeline, the gray distribution difference values of different positions of the weld area, and the texture change parameters, etc. These multi-dimensional values collectively constitute a comprehensive description of the defect condition of a certain area of the pipeline.

[0129] After completing the dimension normalization process, the obtained pipeline defect comprehensive feature set also needs to be verified for effectiveness. During the verification process, the feature set corresponding to the pipeline region of some known defects is selected to check whether it can accurately reflect the existence of defects and related features. If it is found that some feature dimensions have low recognition degree for defects, the feature fusion process can be optimized by adjusting the construction method of the spatial correlation matrix or the weight calculation method of the weighted summation to improve the quality of the pipeline defect comprehensive feature set.

[0130] Step S150: generating a pipeline defect detection result report according to the pipeline defect comprehensive feature set, the pipeline defect detection result report including defect position coordinates, defect type identification and defect size parameters.

[0131] Step S151: inputting the pipeline defect comprehensive feature set into a defect recognition model, extracting local detail information of the features through the convolutional neural network layer of the defect recognition model, and generating a defect type probability distribution through the fully connected layer for defect probability prediction.

[0132] The defect recognition model is a pre-trained deep learning model, the input of which is the pipeline defect comprehensive feature set, and the output of which is the defect type probability distribution. The convolutional neural network layer of the defect recognition model includes multiple convolutional layers and pooling layers. The convolutional layers perform convolution operations on the input feature set through convolution kernels of different sizes to extract local detail information in the features, such as defect edge shape and gray scale change details. The pooling layers perform down-sampling processing on the feature maps after convolution to reduce the feature dimension while retaining important feature information.

[0133] After multiple convolution and pooling operations, the feature information is transmitted to the fully connected layer. The fully connected layer integrates the extracted local detail features, calculates the probability value of each defect type through an activation function, and generates a defect type probability distribution. For example, for a certain feature set, the model may output a probability of 0.7 for a crack, a probability of 0.2 for a gas hole, a probability of 0.05 for a slag inclusion, and a probability of 0.05 for incomplete penetration.

[0134] Step S152: determining the defect type identification corresponding to the maximum probability according to the defect type probability distribution, the defect type identification including crack, gas hole, slag inclusion and incomplete penetration.

[0135] After obtaining the defect type probability distribution, the probability values of each defect type are compared, and the defect type with the maximum probability is selected as the defect type identification corresponding to the feature set. If the maximum probability value is less than a preset confidence threshold, it is considered that there is no obvious defect in this region, or further detection and analysis are needed.

[0136] For example, when the probability of a crack is 0.7, and the probability is greater than the probability of other defect types, and is greater than the confidence threshold, the defect type of the region is identified as a crack. For the identified defect type, the corresponding probability value is recorded so as to reflect the credibility of the detection result in the report.

[0137] Step S153: Based on the spatial position parameters in the pipeline defect comprehensive feature set, the three-dimensional coordinates of the defect on the pipeline surface are calculated in combination with the pipeline three-dimensional model, and the three-dimensional coordinates are converted into pipeline mileage coordinates and circumferential angle coordinates as defect position coordinates.

[0138] The spatial position parameters in the pipeline defect comprehensive feature set include the position information of the pipeline region corresponding to the feature set in the detection process, such as displacement step cumulative value, ray emission angle, etc. In combination with the pipeline three-dimensional model, these parameters are converted into three-dimensional coordinates (X, Y, Z) of the defect on the pipeline surface through a coordinate conversion algorithm.

[0139] The pipeline three-dimensional model is constructed according to the pipeline laying path parameters, and includes the spatial trend, size and other information of the pipeline. In the conversion process, a three-dimensional coordinate system is established with the starting point of the pipeline as the origin, the position of the defect in the axial direction of the pipeline is determined according to the displacement step cumulative value, and the position of the defect in the circumferential direction of the pipeline is determined according to the ray emission angle, so as to obtain the three-dimensional coordinates.

[0140] When converting the three-dimensional coordinates into pipeline mileage coordinates, the axial distance between the defect position and the starting point of the pipeline is calculated as the mileage coordinate. The circumferential angle coordinate directly uses the angle value converted from the three-dimensional coordinates to reflect the position of the defect in the circumferential direction of the pipeline. For example, the three-dimensional coordinates of a certain defect are converted into a mileage coordinate of 100 meters and a circumferential angle coordinate of 30 degrees, indicating that the defect is located at a position 100 meters away from the starting point of the pipeline and 30 degrees in the circumferential direction.

[0141] Step S154: Extract the size feature parameters in the pipeline defect comprehensive feature set, and convert the feature parameters into actual physical sizes according to a preset size calibration coefficient to obtain defect length parameters, width parameters and depth parameters.

[0142] The size feature parameters in the pipeline defect comprehensive feature set are pixel size parameters obtained by analyzing the image features. The preset size calibration coefficient is determined according to the imaging scale of the X-ray detection equipment and the actual size of the pipeline, and is used to convert the pixel size into the actual physical size.

[0143] For example, if the calibration coefficient is 0.1 mm / pixel, and the length of a certain defect in the image is 50 pixels, then the actual length parameter is 50 x 0.1 = 5 mm. Similarly, the actual width parameter and depth parameter can be calculated according to the pixel size parameters corresponding to the width and depth, combined with the calibration coefficient.

[0144] During the calculation process, different size extraction methods may be required for different types of defects. For example, for crack defects, the length of the longest axis is extracted as the length parameter, and the maximum distance perpendicular to the longest axis is extracted as the width parameter; for pore defects, the diameter of the circumscribed circle is extracted as the size parameter, and so on.

[0145] Step S155: The defect position coordinates, defect type identifiers, and defect size parameters are arranged into structured data according to a preset format, and a pipeline defect detection result report containing a defect distribution diagram and a defect detailed parameter table is generated.

[0146] The preset format includes the arrangement order of the data, field names, units, etc. The defect position coordinates, defect type identifiers, and defect size parameters are entered into the structured data table according to the preset format, with each defect as a row of data containing the above parameters.

[0147] The defect distribution diagram is drawn according to the defect position coordinates, based on the three-dimensional model or two-dimensional development diagram of the pipeline, and the defects are marked at the corresponding positions, with the defect type identifiers also being labeled. The defect detailed parameter table contains specific parameter information of each defect, such as position coordinates, type, size, probability value, etc.

[0148] The generated pipeline defect detection result report can also contain information such as the parameters of the detection equipment, the detection time, the operator, etc., in order to trace the detection process. The report is stored in the form of an electronic document and can be printed out as needed

[0149] In addition, during the entire detection process, the collection and processing of information such as pipeline structure parameters and image data require corresponding privacy protection and anti-leakage technical means. For example, the collected data is stored in encrypted form, access permissions are set, and only authorized personnel can view and process the data; during data transmission, encrypted transmission protocols are used to prevent data from being stolen or tampered with. At the same time, data is backed up regularly to prevent data loss. For sensitive geographic information related to the area where the pipeline is located, fuzzy processing or desensitization processing is performed in the report to avoid leaking sensitive information.

[0150] Figure 2An exemplary diagram of the hardware and software components of the multi-view adaptive pipeline X-ray inspection system 100 that can implement the idea of the present application is shown. For example, a processor 120 can be used in the multi-view adaptive pipeline X-ray inspection system 100 and used to perform the functions in the present application.

[0151] The multi-view adaptive pipeline X-ray inspection system 100 can be a general server or a special purpose server, both of which can be used to implement the multi-view adaptive pipeline X-ray inspection method of the present application. Although only one server is shown in the present application, for the sake of convenience, the functions described in the present application can be implemented in a distributed manner on multiple similar platforms to balance the processing load.

[0152] For example, the multi-view adaptive pipeline X-ray inspection system 100 can include a network port 110 connected to a network, one or more processors 120 for executing program instructions, a communication bus 130, and different forms of storage media 140, such as a disk, a ROM, or a RAM, or any combination thereof. Exemplarily, the multi-view adaptive pipeline X-ray inspection system 100 can also include program instructions stored in a ROM, a RAM, or other types of non-transitory storage media, or any combination thereof. The method of the present application can be implemented according to these program instructions. The multi-view adaptive pipeline X-ray inspection system 100 also includes an I / O interface 150 between the computer and other input / output devices.

[0153] For the sake of convenience, only one processor is described in the multi-view adaptive pipeline X-ray inspection system 100. However, it should be noted that the multi-view adaptive pipeline X-ray inspection system 100 in the present application can also include multiple processors, so the steps performed by one processor described in the present application can also be jointly performed or separately performed by multiple processors. For example, if the processor of the multi-view adaptive pipeline X-ray inspection system 100 performs steps A and B, it should be understood that steps A and B can also be jointly performed by two different processors or separately performed in one processor. For example, a first processor performs step A, a second processor performs step B, or the first processor and the second processor jointly perform steps A and B.

[0154] In addition, the present application also provides a readable storage medium, in which computer executable instructions are pre-set, when the processor executes the computer executable instructions, the multi-view adaptive pipeline X-ray inspection method as described above is implemented.

[0155] It should be noted that the foregoing description of embodiments of the application has been presented for the purposes of illustration and description. It is not intended to be exhaustive or to limit the application to the precise form described, and many modifications, variations, and alternatives are possible.

Claims

1. A method for X-ray inspection of a pipe based on multi-view self-adaptation, characterized in that, The method comprises: acquiring a pipeline structure parameter set of a pipeline to be detected, the pipeline structure parameter set comprising a pipeline diameter parameter, a pipeline material parameter and a pipeline laying path parameter; generating a multi-view detection configuration parameter according to the pipeline structure parameter set, the multi-view detection configuration parameter comprising a relative distance parameter of a ray source and a pipeline surface, a ray emission angle parameter and a detection equipment displacement step parameter; controlling an X-ray detection equipment to perform a multi-angle image acquisition operation on the pipeline to be detected based on the multi-view detection configuration parameter, to obtain a multi-view X-ray image set, the multi-view X-ray image set being composed of pipeline cross-sectional image units and pipeline longitudinal cross-sectional image units under different detection angles; performing a view angle adaptive feature fusion processing on the multi-view X-ray image set to generate a pipeline defect comprehensive feature set with view angle complementarity; generating a pipeline flaw detection result report according to the pipeline defect comprehensive feature set, the pipeline flaw detection result report comprising a defect position coordinate, a defect type identifier and a defect size parameter; the view angle adaptive feature fusion processing on the multi-view X-ray image set to generate a pipeline defect comprehensive feature set with view angle complementarity comprises: extracting all pipeline cross-sectional image units from the multi-view X-ray image set, performing a circumferential direction gradient enhancement processing on each pipeline cross-sectional image unit to strengthen the edge profile information of the inner wall and the outer wall of the pipeline, to obtain an edge-enhanced cross-sectional image unit; based on the edge-enhanced cross-sectional image unit, extracting a pipeline inner wall region and a pipeline outer wall region, calculating a ring region width parameter between the inner wall region and the outer wall region as a pipeline wall thickness feature; performing an axial direction contrast enhancement processing on the pipeline longitudinal cross-sectional image units in the multi-view X-ray image set to highlight the gray scale change feature of the pipeline weld region, to obtain a contrast-enhanced longitudinal cross-sectional image unit; detecting a linear structure feature in the contrast-enhanced longitudinal cross-sectional image unit, identifying the position coordinate of the weld region, extracting the gray scale distribution feature and the texture feature of the weld region as a weld region defect feature; inputting the pipeline wall thickness feature and the weld region defect feature into a view angle feature association model, calculating a spatial correlation coefficient of the features under different view angles according to the view angle identifier label of each image unit, performing a weighted fusion processing on the pipeline wall thickness feature and the weld region defect feature based on the spatial correlation coefficient, to generate a pipeline defect comprehensive feature set; the pipeline flaw detection result report generated according to the pipeline defect comprehensive feature set comprises: inputting the pipeline defect comprehensive feature set into a defect identification model, extracting local detail information of the features through a convolutional neural network layer of the defect identification model, performing defect probability prediction through a fully connected layer, to generate a defect type probability distribution; determining a defect type identifier corresponding to a maximum probability according to the defect type probability distribution, the defect type identifier comprising a crack, a gas hole, a slag inclusion and a lack of penetration; Based on the spatial position parameters in the pipeline defect comprehensive feature set, the three-dimensional coordinates of the defects on the pipeline surface are calculated in combination with the pipeline three-dimensional model, and the three-dimensional coordinates are converted into pipeline mileage coordinates and circumferential angle coordinates as defect position coordinates; The size feature parameters in the pipeline defect comprehensive feature set are extracted, the feature parameters are converted into actual physical sizes according to a preset size calibration coefficient, and defect length parameters, width parameters and depth parameters are obtained; The defect position coordinates, defect type identifiers and defect size parameters are arranged into structured data according to a preset format, and a pipeline flaw detection result report containing a defect distribution schematic diagram and a defect detailed parameter table is generated.

2. The multi-view adaptive based tube x-ray inspection method of claim 1, wherein, The generation of the multi-view detection configuration parameters according to the pipeline structure parameter set comprises: The pipeline diameter parameters in the pipeline structure parameter set are analyzed, the ray source focal point size parameters matched with the pipeline diameter parameters are determined, and the ray source focal point size parameters are in a positive correlation with the pipeline diameter parameters; Based on the pipeline material parameters, a preset material attenuation coefficient reference table is queried to obtain the X-ray attenuation coefficient parameters corresponding to the pipeline material parameters, and the X-ray attenuation coefficient parameters are used to adjust the emission intensity parameters of the ray source; According to the pipeline laying path parameters, the spatial trend change features of the pipeline to be detected are identified, and the spatial trend change features include horizontal laying segment identifiers, vertical laying segment identifiers and curved segment identifiers; In combination with the spatial trend change features, detection equipment motion trajectory planning parameters are generated, the detection equipment motion trajectory planning parameters include straight line motion segment parameters and curve motion segment parameters, and the curve motion segment parameters match the curvature radius parameters of the curved segment identifiers; The ray source focal point size parameters, the X-ray attenuation coefficient parameters and the detection equipment motion trajectory planning parameters are input into a multi-view configuration generation model to generate multi-view detection configuration parameters including the relative distance parameters of the ray source and the pipeline surface, the ray emission angle parameters and the detection equipment displacement step parameters, and the ray emission angle parameters are dynamically adjusted by a preset angle increment in the detection area corresponding to the curved segment identifier.

3. The multi-view adaptive based tube X-ray inspection method of claim 2, wherein, The multi-angle image acquisition operation of the X-ray detection equipment on the pipeline to be detected is controlled based on the multi-view detection configuration parameters to obtain a multi-view X-ray image set, which comprises: The multi-view detection configuration parameters are sent to the motion control module of the X-ray detection equipment, and the motion control module is called to drive the detection mechanical arm to perform intermittent displacement operation according to the detection equipment displacement step parameters; At each displacement stop point, the motion control module is called to adjust the spatial position relationship between the ray source and the pipeline to be detected according to the relative distance parameters of the ray source and the pipeline surface, so that the vertical distance between the ray source focal point and the pipeline surface remains constant; The emission direction of the ray source is adjusted by the angle adjusting unit of the X-ray detection equipment according to the ray emission angle parameters, so that the X-ray beam irradiates the target detection area of the pipeline to be detected at a preset incident angle, and the target detection area includes the circumferential area of the pipeline cross section and the axial area of the pipeline longitudinal section. When the relative position and the emission angle of the ray source and the pipeline surface are adjusted, the X-ray detector is triggered to perform an image acquisition operation to obtain an original X-ray image containing internal structure information of the pipeline, and an exposure time parameter of the original X-ray image is in a positive correlation with the X-ray attenuation coefficient parameter; A view angle identification tag is added to each original X-ray image collected at each displacement stop point, the view angle identification tag containing a ray emission angle parameter value and a displacement step cumulative value, and the original X-ray images with the added view angle identification tags are combined in a sequence of acquisition time sequences to generate a multi-view X-ray image set containing pipeline cross-sectional image units and pipeline longitudinal cross-sectional image units.

4. The multi-view adaptive based tube x-ray inspection method of claim 1, wherein, The all pipeline cross-sectional image units are extracted from the multi-view X-ray image set, and a circumferential direction gradient enhancement process is performed on each pipeline cross-sectional image unit to strengthen edge profile information of inner and outer walls of the pipeline to obtain an edge-enhanced cross-sectional image unit, including: All image units in the multi-view X-ray image set are traversed, and all pipeline cross-sectional image units are filtered out according to the view angle identification tags to establish a cross-sectional image sequence; A gray scale normalization process is performed on each pipeline cross-sectional image unit in the cross-sectional image sequence, a horizontal direction gradient image and a vertical direction gradient image are calculated in the normalized pipeline cross-sectional image unit by using a Sobel operator, the gradient images are converted into polar coordinate gradient images based on polar coordinate transformation, and a radial coordinate of the polar coordinate gradient image corresponds to a pipeline radial direction and an angle coordinate corresponds to a circumferential direction; A Gaussian filter process is performed on the angle direction of the polar coordinate gradient image, a gradient amplitude and a gradient direction of the filtered polar coordinate gradient image are calculated, a pixel point with a gradient amplitude greater than a preset threshold value is marked as an edge candidate point, and adjacent edge candidate points are connected to form a closed contour line to obtain the edge-enhanced cross-sectional image unit.

5. The multi-view adaptive based tube x-ray inspection method of claim 1, wherein, Based on the edge-enhanced cross-sectional image unit, a pipeline inner wall region and a pipeline outer wall region are extracted, a ring region width parameter between the inner wall region and the outer wall region is calculated as a pipeline wall thickness feature, including: In the edge-enhanced cross-sectional image unit, an outermost closed contour line and an innermost closed contour line are identified, and the outermost closed contour line and the innermost closed contour line are respectively taken as an outer wall initial contour and an inner wall initial contour; A pixel point on the outer wall initial contour is taken as a region growth seed point, a gray scale similarity threshold value is set, and a region growth operation is performed in the edge-enhanced cross-sectional image unit to obtain an outer wall region; A pixel point on the inner wall initial contour is taken as a region growth seed point, and the same gray scale similarity threshold value as that of the outer wall region is used to perform a region growth operation to obtain an inner wall region; Minimum circumscribed rectangle parameters of the outer wall region and the inner wall region are calculated, and the outer wall region and the inner wall region are aligned through rectangular center point coordinates; In the polar coordinate, the outer wall region and the inner wall region are radially scanned to calculate distance values between outer wall region boundaries and inner wall region boundaries in different angle directions to obtain radial distance parameters in multiple angle directions. The radial distance parameters of the plurality of angle directions are arithmetically averaged to obtain a ring region width parameter, and the ring region width parameter is taken as the pipeline wall thickness feature.

6. The multi-view adaptive based tube x-ray inspection method of claim 1, wherein, The pipeline longitudinal section image units in the multi-view X-ray image set are subjected to axial direction contrast enhancement processing to highlight the gray scale change features of the pipeline weld region, to obtain the contrast-enhanced longitudinal section image units, which include: All pipeline longitudinal section image units are screened from the multi-view X-ray image set and arranged in sequence according to the acquisition positions to form a longitudinal section image sequence; Each pipeline longitudinal section image unit in the longitudinal section image sequence is subjected to dynamic range compression processing, and an adaptive histogram equalization algorithm is used to enhance the local contrast of the image and retain the gray scale detail features in the axial direction of the pipeline; A direction-adjustable Gaussian filter template is constructed, the direction of the Gaussian filter template is set to be consistent with the axial direction of the pipeline, the dynamic range compressed pipeline longitudinal section image unit is subjected to filter processing, the noise components perpendicular to the axial direction are suppressed, the gray scale co-occurrence matrix of the filtered image is calculated, the energy, entropy and contrast parameters are extracted, and it is judged whether the image contrast meets the preset enhancement condition according to the energy, entropy and contrast parameters; When the image contrast does not meet the preset enhancement condition, the pipeline longitudinal section image unit is subjected to multi-scale contrast enhancement processing, the reflection component weight at different scales is adjusted, the gray scale difference between the weld region and the background region is enhanced, and the contrast-enhanced longitudinal section image unit is obtained.

7. The multi-view adaptive based tube x-ray inspection method of claim 1, wherein, The pipeline wall thickness feature and the weld region defect feature are input into the view feature association model, the spatial association coefficients of the features under different views are calculated according to the view identification labels of each image unit, the pipeline wall thickness feature and the weld region defect feature are subjected to weighted fusion processing based on the spatial association coefficients, and a pipeline defect comprehensive feature set is generated, which includes: The view identification labels of each image unit are analyzed, the ray emission angle parameter and the displacement step cumulative value are extracted, a feature-view association table is established, and the feature-view association table records the acquisition view information corresponding to each pipeline wall thickness feature and weld region defect feature; A pipeline three-dimensional model is constructed according to the pipeline laying path parameter in the pipeline structure parameter set, the acquisition view information of each image unit is mapped to the spatial coordinate system of the pipeline three-dimensional model, and the three-dimensional coordinates of the feature acquisition points are obtained; The Euclidean distances between different feature acquisition points are calculated, a spatial association matrix is constructed based on the Euclidean distances and the ray emission angle parameters, and the element values of the spatial association matrix represent the spatial association coefficients between the features corresponding to two feature acquisition points; The pipeline wall thickness feature and the weld region defect feature are converted into feature vector form, all feature vectors are subjected to weighted summation processing based on the spatial association matrix, and the weight of each feature vector is the sum of the spatial association coefficients with other feature vectors; The feature vectors after weighted summation are subjected to dimension normalization processing to obtain the pipeline defect comprehensive feature set.

8. A multi-view adaptive based X-ray inspection system for pipeline, characterized in that, The application relates to a pipeline X-ray flaw detection method based on multi-view self-adaption, which comprises a processor and a memory, the memory is connected with the processor, the memory is used for storing programs, instructions or codes, and the processor is used for executing the programs, instructions or codes in the memory to realize the pipeline X-ray flaw detection method based on multi-view self-adaption in any one of claims 1-7.

Citation Information

Patent Citations

  • Ultrahigh-temperature refractory high-entropy alloy with double-high-entropy effect, preparation method and application

    CN117778855A

  • X-ray-based nondestructive testing method and system for internal defects of power supply equipment

    CN118566266A

Cited By

  • Casting size and type self-adaptive multi-angle X-ray imaging control method and system

    CN121540732A