An image processing system and method for natural gas pipeline leak detection

By collecting and analyzing infrared images of natural gas pipelines, a visualized image of the leak area is generated, solving the problem of difficulty in analyzing the spread range of natural gas pipeline leaks in existing technologies, and improving the accuracy and reliability of leak detection.

CN120833338BActive Publication Date: 2026-03-03BEIJING INST OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-19
Publication Date
2026-03-03

AI Technical Summary

Technical Problem

Existing methods for detecting leaks in natural gas pipelines are insufficient for accurately analyzing and quantitatively assessing the extent of natural gas diffusion after a leak, especially in identifying the leak area, and thus cannot provide effective support for determining the level of leakage and emergency response.

Method used

By acquiring infrared images of natural gas pipelines, extracting pipeline temperature and boundary features, generating a natural gas leak diffusion layer, and using thermal friction diffusion vectors to generate leak location and area images, combined with flow and pressure, a visualized leak area image is generated.

Benefits of technology

It enables a visual representation of the extent of natural gas pipeline leaks, improving the accuracy and reliability of leak detection and supporting leak level assessment and emergency response.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120833338B_ABST
    Figure CN120833338B_ABST
Patent Text Reader

Abstract

The application provides an image processing system and method for natural gas pipeline leakage detection. Firstly, the natural gas pipeline infrared image is collected, and the pipeline boundary feature is extracted according to the natural gas pipeline image. The natural gas pipeline infrared image is subjected to layer feature extraction according to the pipeline boundary feature, and the natural gas leakage diffusion layer of the natural gas pipeline infrared image is obtained. The heat friction diffusion vector set is obtained by extracting the heat friction diffusion vector according to the natural gas leakage diffusion layer, and the pipeline leakage point image is generated through the heat friction diffusion vector set. The diffusion characteristic quantity corresponding to each pipeline leakage point in the pipeline leakage point image is extracted, the pipeline leakage area image is generated through the natural gas pipeline flow pressure and the diffusion characteristic quantity corresponding to each pipeline leakage point, and the friction heat effect between the high-pressure natural gas and the natural gas pipeline leakage port can be analyzed according to the heat friction diffusion vector, so that the visual pipeline leakage area image is generated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technology, and more specifically, to an image processing system and method for detecting leaks in natural gas pipelines. Background Technology

[0002] For long-distance natural gas pipelines, leaks can pollute soil, water, and air, impacting the ecological environment and human health. Furthermore, leaks can disrupt natural gas production, causing significant economic losses. From a safety perspective, leaks can trigger fires, explosions, and other accidents, seriously threatening the lives and property of workers and nearby residents. Therefore, high-precision, rapid-response detection and early warning systems for long-distance natural gas pipeline leaks are crucial.

[0003] Existing methods for detecting natural gas pipeline leaks primarily rely on monitoring equipment to collect images of the pipeline and then using artificial intelligence image recognition algorithms to analyze and determine the presence of leaks. However, these methods typically only identify suspected leak locations and lack analysis of the extent of natural gas diffusion after a leak, resulting in poor accuracy and reliability of the detection results. Furthermore, existing methods generally struggle to quantitatively assess the leak area, particularly in identifying the leak area, failing to provide effective support for leak severity assessment and emergency response area delineation. Therefore, how to quickly identify the leak area of ​​a natural gas pipeline has become an urgent problem to be solved. Summary of the Invention

[0004] This application provides an image processing system and method for detecting leaks in natural gas pipelines, which can analyze the frictional heat effect between high-pressure natural gas and the leak point of the natural gas pipeline based on the thermal friction diffusion vector, thereby generating a visualized image of the pipeline leak area.

[0005] In a first aspect, this application provides an image processing method for detecting leaks in natural gas pipelines. This method can be executed by a network device, or by a chip configured in the network device, and this application does not limit the execution of such method.

[0006] Specifically, the method includes:

[0007] Acquire infrared images of natural gas pipelines and extract pipeline temperature features based on the infrared images;

[0008] When the pipeline temperature characteristic is higher than the real-time leakage alarm threshold, a natural gas pipeline image is acquired, and pipeline boundary features are extracted based on the natural gas pipeline image.

[0009] Based on the pipeline boundary features, layer features are extracted from the infrared image of the natural gas pipeline to obtain the natural gas leakage diffusion layer of the infrared image of the natural gas pipeline;

[0010] Thermal friction diffusion vectors are extracted from the natural gas leak diffusion layer to obtain a set of thermal friction diffusion vectors, and a pipeline leak location image is generated using the set of thermal friction diffusion vectors.

[0011] Extract the diffusion feature quantity corresponding to each pipeline leak point in the pipeline leak point image, obtain the natural gas pipeline flow rate and pressure, and generate a pipeline leak area image using the natural gas pipeline flow rate and pressure and the diffusion feature quantity corresponding to each pipeline leak point.

[0012] The images of the pipeline leak location and the pipeline leak area are uploaded to the transmission control center of the natural gas pipeline.

[0013] In conjunction with the first aspect, in some implementations of the first aspect, before extracting pipeline temperature features based on the infrared image of the natural gas pipeline, the method further includes: performing image preprocessing on the infrared image of the natural gas pipeline.

[0014] In conjunction with the first aspect, in certain implementations of the first aspect, extracting layer features from the infrared image of the natural gas pipeline based on the pipeline boundary features to obtain the natural gas leakage diffusion layer of the infrared image of the natural gas pipeline specifically includes:

[0015] The pipeline boundary features are obtained, and the pipeline boundary features are scale-aligned with the infrared image of the natural gas pipeline based on an image registration algorithm to obtain the pipeline boundary mask region corresponding to the infrared image of the natural gas pipeline.

[0016] Threshold segmentation is performed on the infrared pixels in the pipeline boundary mask area to obtain the natural gas leakage diffusion layer of the infrared image of the natural gas pipeline.

[0017] In conjunction with the first aspect, in certain implementations of the first aspect, threshold segmentation of infrared pixels in the pipeline boundary mask region to obtain the natural gas leak diffusion layer of the natural gas pipeline infrared image specifically includes:

[0018] Obtain the infrared pixels in the mask region of the pipe boundary;

[0019] Local adaptive thresholding is used to filter the infrared pixels in the pipeline boundary mask area, and the remaining infrared pixels are used to form a natural gas leak diffusion layer of the natural gas pipeline infrared image based on pixel coordinates.

[0020] In conjunction with the first aspect, in certain implementations of the first aspect, generating a pipeline leak location image through the set of thermal friction diffusion vectors specifically includes:

[0021] Obtain a natural gas leak diffusion layer, and extract the leak direction vector corresponding to each infrared pixel in the natural gas leak diffusion layer based on the pipeline boundary features;

[0022] Obtain the thermal friction diffusion vector. For any thermal friction diffusion vector, obtain the leakage direction vector of the infrared pixel corresponding to the thermal friction diffusion vector. Based on the leakage direction vector, determine the thermal friction diffusion pole of the infrared pixel corresponding to the thermal friction diffusion vector.

[0023] All infrared pixels that meet the criteria for determining thermal friction diffusion poles are taken as thermal friction diffusion poles, and a connectivity test is performed to obtain the maximum pole connectivity region. Based on the location of the maximum pole connectivity region, a spatial projection transformation is performed to generate a pipeline leak location image.

[0024] In conjunction with the first aspect, in some implementations of the first aspect, infrared images of natural gas pipelines are acquired using an infrared thermal imaging camera.

[0025] In conjunction with the first aspect, in some implementations of the first aspect, extracting pipeline temperature features based on the infrared image of the natural gas pipeline specifically includes: extracting the maximum temperature value, the area of ​​the temperature rise region, and the temperature rise gradient of the infrared image of the natural gas pipeline to form a temperature feature vector, and using the temperature feature vector as the pipeline temperature feature.

[0026] Secondly, this application provides an image processing system for detecting leaks in natural gas pipelines, comprising a leak image processing unit, wherein the leak image processing unit includes:

[0027] The image acquisition module is used to acquire infrared images of natural gas pipelines and extract pipeline temperature features based on the infrared images of natural gas pipelines;

[0028] The threshold judgment module is used to acquire natural gas pipeline images and extract pipeline boundary features based on the natural gas pipeline images when the pipeline temperature characteristics are higher than the real-time leakage alarm threshold.

[0029] The image processing module is used to extract layer features from the infrared image of the natural gas pipeline based on the pipeline boundary features, so as to obtain the natural gas leakage diffusion layer of the infrared image of the natural gas pipeline.

[0030] The image processing module is further configured to extract thermal friction diffusion vectors based on the natural gas leak diffusion layer to obtain a set of thermal friction diffusion vectors, and generate a pipeline leak location image through the set of thermal friction diffusion vectors.

[0031] The image processing module is also used to extract the diffusion feature quantity corresponding to each pipeline leak point in the pipeline leak point image, obtain the natural gas pipeline flow rate and pressure, and generate a pipeline leak area image through the natural gas pipeline flow rate and pressure and the diffusion feature quantity corresponding to each pipeline leak point.

[0032] The image upload module is used to upload images of the pipeline leak location and the pipeline leak area to the transmission control center of the natural gas pipeline.

[0033] Thirdly, this application provides a computer terminal device, which includes a memory and a processor. The memory stores code, and the processor is configured to acquire the code and execute the image processing method described above for detecting leaks in natural gas pipelines.

[0034] Fourthly, this application provides a computer-readable storage medium storing at least one computer program, which is loaded and executed by a processor to perform the operations described above in an image processing method for detecting leaks in natural gas pipelines.

[0035] The technical solutions provided by the embodiments disclosed in this application have the following beneficial effects:

[0036] This application provides an image processing system and method for detecting leaks in natural gas pipelines. First, infrared images of the natural gas pipeline are acquired, and pipeline temperature features are extracted based on these images. When the pipeline temperature features exceed a real-time leak alarm threshold, images of the natural gas pipeline are acquired, and pipeline boundary features are extracted from these images. Layer features are extracted from the infrared images of the natural gas pipeline based on these boundary features to obtain a natural gas leak diffusion layer. Thermal friction diffusion vectors are extracted from the natural gas leak diffusion layer to obtain a set of thermal friction diffusion vectors. A pipeline leak location image is generated using this set of thermal friction diffusion vectors. Diffusion feature quantities corresponding to each leak point in the pipeline leak location image are extracted, and the natural gas pipeline flow rate and pressure are obtained. A pipeline leak area image is generated using the natural gas pipeline flow rate and pressure and the diffusion feature quantities corresponding to each leak point. The pipeline leak location image and the pipeline leak area image are then uploaded to the natural gas pipeline transmission control center.

[0037] Therefore, it can be seen that during the leakage of high-pressure natural gas, this application refers to the high-speed ejection of natural gas through the pipeline rupture point. This process is accompanied by intense friction with the rupture edge of the pipe wall, generating local high temperatures. As the natural gas flows out, it exchanges heat with the surrounding environment, causing the temperature to gradually decrease, forming a directional and gradient thermal diffusion pattern. By extracting the natural gas leakage diffusion layer from the infrared image of the natural gas pipeline through pipeline boundary features, and extracting thermal friction diffusion vectors from the infrared pixels in the natural gas leakage diffusion layer, the thermal friction diffusion vectors are used to reflect the direction and speed of frictional heat diffusion between the rupture edge of the pipe wall and the high-pressure oil and gas. Combined with the leakage direction vector, the thermal friction diffusion poles in the infrared image are selected, thereby generating a pipeline leak location image. Then, the diffusion feature quantities corresponding to the thermal friction diffusion poles are extracted. The diffusion feature quantities reflect the intensity and range of thermal diffusion. The greater the natural gas flow rate and pressure, the more intense the friction and heat release per unit area of ​​the leak point, resulting in more obvious diffusion characteristics. Based on the diffusion feature quantities corresponding to the thermal friction diffusion poles, the pipeline leak area image is output, realizing the visualization of the leak range.

[0038] In summary, this application can analyze the frictional heat effect between high-pressure natural gas and the leak in a natural gas pipeline based on the thermal friction diffusion vector, thereby generating a visualized image of the pipeline leak area. Attached Figure Description

[0039] Figure 1 This is an exemplary flowchart of an image processing method for detecting leaks in natural gas pipelines, according to some embodiments of this application.

[0040] Figure 2 This is a schematic diagram of the structure of a leak image processing unit according to some embodiments of this application;

[0041] Figure 3 This is a schematic diagram of the structure of a computer terminal device that implements an image processing method for detecting leaks in natural gas pipelines, according to some embodiments of this application. Detailed Implementation

[0042] This application acquires infrared images of natural gas pipelines and extracts pipeline temperature features based on these images. When the pipeline temperature features exceed a real-time leak alarm threshold, it acquires images of the natural gas pipeline and extracts pipeline boundary features from these images. Based on these boundary features, it extracts layer features from the infrared images of the natural gas pipeline to obtain a natural gas leak diffusion layer. It then extracts thermal friction diffusion vectors from this layer to obtain a set of thermal friction diffusion vectors, which is used to generate images of pipeline leak locations. Finally, it extracts diffusion features corresponding to each leak point in the leak location images, obtains the natural gas pipeline flow rate and pressure, and generates a pipeline leak area image using the natural gas pipeline flow rate, pressure, and diffusion features corresponding to each leak point. This allows for the analysis of the frictional heat effect between high-pressure natural gas and the leak point in the natural gas pipeline based on the thermal friction diffusion vectors, thereby generating a visualized pipeline leak area image.

[0043] To better understand the above technical solutions, a detailed description of the solutions will be provided below in conjunction with the accompanying drawings and specific implementation methods. (Reference) Figure 1 The figure is an exemplary flowchart of an image processing method for detecting leaks in natural gas pipelines, according to some embodiments of this application. The image processing method 100 for detecting leaks in natural gas pipelines mainly includes the following steps:

[0044] In step S101, an infrared image of the natural gas pipeline is acquired, and the pipeline temperature characteristics are extracted based on the infrared image of the natural gas pipeline.

[0045] Optionally, in some embodiments, infrared images of natural gas pipelines are acquired by an infrared thermal imaging camera, such as an uncooled infrared camera module in the long-wave infrared band. However, this is not a limitation. In other embodiments, other devices or equipment with infrared image acquisition capabilities can also be used, such as infrared scanners, integrated multispectral imaging modules, portable thermal imaging detectors, etc. As long as they can achieve image capture of the thermal radiation signal on the surface of the natural gas pipeline and meet the temperature resolution requirements, they can all be used as the infrared image acquisition device of the present invention. This application does not limit this.

[0046] It should be noted that before extracting the pipeline temperature features based on the infrared image of the natural gas pipeline, the process further includes: image preprocessing of the infrared image of the natural gas pipeline. Specifically, the image preprocessing process of the infrared image of the natural gas pipeline may include, but is not limited to, the following operations:

[0047] Gray-level normalization mapping: Normalize the pixel values ​​corresponding to different heat intensities in the infrared image of the natural gas pipeline to a fixed gray-level range (e.g., 0~255) to enhance the thermal difference contrast in the infrared image of the natural gas pipeline.

[0048] Image noise filtering: One of the following image smoothing algorithms, namely median filtering, Gaussian filtering, or adaptive bilateral filtering, is used to eliminate random hotspot interference caused by the low signal-to-noise ratio of the infrared image in the infrared image of the natural gas pipeline, and to suppress the interference of background noise on subsequent temperature analysis.

[0049] Preferably, in some embodiments, extracting pipeline temperature features based on the infrared image of the natural gas pipeline specifically includes: extracting the maximum temperature, the area of ​​the temperature rise region, and the temperature rise gradient from the infrared image of the natural gas pipeline to form a temperature feature vector, and using the temperature feature vector as the pipeline temperature feature. The maximum temperature in the infrared image of the natural gas pipeline is the maximum temperature value in the infrared image of the natural gas pipeline, used to determine whether there is a local high-temperature leak source in the natural gas pipeline; the area of ​​the temperature rise region is the number of pixels in the image representing a continuous region with a temperature higher than the normal temperature reference value, converted to an actual area based on the image resolution; the temperature rise gradient is the gradient value of the temperature of the calibrated pipeline edge pixels as it diffuses from the hot spot to the surrounding area, used to reflect the leakage diffusion trend.

[0050] In step S102, when the pipeline temperature characteristic is higher than the real-time leakage alarm threshold, a natural gas pipeline image is acquired, and pipeline boundary features are extracted based on the natural gas pipeline image.

[0051] It should be noted that the determination condition for "pipeline temperature characteristics exceeding the real-time leak alarm threshold" mentioned in this application is as follows: any feature index of pipeline temperature characteristics (such as maximum temperature, area of ​​temperature rise region, or temperature rise gradient) in the temperature feature vector extracted from the infrared image of the natural gas pipeline exceeds the corresponding preset real-time leak alarm threshold, thus triggering a suspected leak event. This preset threshold can be configured based on pipeline operating parameters, historical operating data, and pipeline material type, and can also be dynamically updated through machine learning to improve the accuracy of the determination.

[0052] Optionally, in some embodiments, images of natural gas pipelines can be acquired by a visible light imaging device coaxial with an infrared thermal imager. In specific implementations, the visible light image acquisition device can preferably be an industrial-grade camera, a miniature vision module, or a multispectral imaging device. The preferred acquisition device can simultaneously support the linkage setting of image resolution, exposure time, and infrared thermal imager parameters.

[0053] Preferably, in some embodiments of the present invention, when the pipeline temperature characteristics exceed a preset real-time leak alarm threshold, the system initiates synchronous acquisition of visible light images of the natural gas pipeline, and extracts pipeline boundary features in the natural gas pipeline images by combining edge detection algorithms or deep learning object detection models; the pipeline boundary features include, but are not limited to: boundary contour point sets, boundary region coordinate frames, central axis direction, geometric shape parameters, etc., which are used for subsequent layer mapping and ROI restriction of the leak layer in the infrared image of the natural gas pipeline, thereby improving the spatial accuracy of leak area extraction and image alignment accuracy.

[0054] In some other embodiments of this application, when any indicator in the pipeline temperature feature vector exceeds a preset alarm threshold, the system immediately activates a visible light image acquisition module synchronized with the infrared image of the natural gas pipeline to acquire a real-time visible light image of the target area (i.e., the natural gas pipeline image). Based on this image, the system uses an edge detection algorithm (preferably Canny edge extraction) or a trained deep learning model (preferably a YOLO recognition model or a Mask R-CNN network) to identify and extract boundary features of the natural gas pipeline area.

[0055] Specifically, the pipe boundary features include, but are not limited to:

[0056] Boundary contour point set: Obtain the complete boundary curve point set through contour extraction algorithm;

[0057] Boundary region coordinate frame: that is, the coordinates of the smallest bounding rectangle of the target region;

[0058] Central axis direction: The main direction vector of the pipe is obtained by fitting the contour geometric axis;

[0059] Geometric parameters: such as pipe outer diameter, aspect ratio, edge curvature and other spatial structure information.

[0060] Furthermore, to achieve accurate identification of the leak heat layer in subsequent infrared images, the extracted pipeline boundary features can be used as layer constraint regions and spatially aligned and fused with the natural gas pipeline infrared image. Specifically, this includes:

[0061] Based on the time synchronization and pixel registration information of infrared and visible light images;

[0062] The boundary mask is mapped onto the infrared image coordinate system through perspective transformation or affine transformation.

[0063] In step S103, layer features are extracted from the infrared image of the natural gas pipeline based on the pipeline boundary features to obtain the natural gas leakage diffusion layer of the infrared image of the natural gas pipeline.

[0064] Preferably, in some embodiments, extracting layer features from the infrared image of the natural gas pipeline based on the pipeline boundary features to obtain a natural gas leakage diffusion layer of the infrared image of the natural gas pipeline specifically includes:

[0065] The pipeline boundary features are obtained, and the pipeline boundary features are scale-aligned with the infrared image of the natural gas pipeline based on an image registration algorithm to obtain the pipeline boundary mask region corresponding to the infrared image of the natural gas pipeline.

[0066] Threshold segmentation is performed on the infrared pixels in the pipeline boundary mask area to obtain the natural gas leakage diffusion layer of the infrared image of the natural gas pipeline.

[0067] In specific implementation, the pipeline boundary features include spatial structure information such as the pipeline contour point set, boundary coordinate frame, and central axis direction extracted from the visible light image, and feature construction is performed based on the boundary feature template; then, image registration technology is used to accurately map the pipeline boundary features in the visible light image to the infrared image coordinate system. Preferably, the registration algorithm may include: homography matrix or affine matrix transformation based on manual calibration or marker points (such as calibration targets, thermocouple positioning points); or automatic registration may be achieved based on feature point matching (such as SIFT feature point set) combined with the RANSAC algorithm; in some other embodiments of this application, a preset mapping relationship may also be used under the condition of synchronous infrared and visible light image acquisition equipment, which is not limited in this application. After registration, the connected region of the mapped edge feature points is the pipeline boundary mask region, which is also the region of interest defined in the infrared image in this application.

[0068] Preferably, in some embodiments, thresholding the infrared pixels in the pipeline boundary mask region to obtain the natural gas leak diffusion layer of the natural gas pipeline infrared image specifically includes:

[0069] Obtain the infrared pixels in the mask region of the pipe boundary;

[0070] Local adaptive thresholding is used to filter the infrared pixels in the pipeline boundary mask area, and the remaining infrared pixels are used to form a natural gas leak diffusion layer of the natural gas pipeline infrared image based on pixel coordinates.

[0071] In some embodiments, the local adaptive threshold may be determined using the local mean method, which will not be elaborated upon in this application.

[0072] It should be noted that the natural gas leakage diffusion layer described in this application is a pixel layer composed of the pixel position and shape information of the characteristic temperature area of ​​natural gas in the pipeline in the infrared image. This layer has the characteristics of spatial position being limited by the pipeline structure boundary, eliminating background interference; clear thermal characteristics, highlighting the significant area of ​​natural gas transmission temperature.

[0073] Optionally, in some embodiments, to further improve the segmentation accuracy of the natural gas leak diffusion layer described in this application, morphological processing, such as corrosion, dilation, and opening / closing operations, can be performed on the initially extracted natural gas leak diffusion layer region in the specific implementation, in order to eliminate pixel noise, connect broken areas, and smooth boundaries of the natural gas leak diffusion layer.

[0074] In step S104, thermal friction diffusion vectors are extracted based on the natural gas leak diffusion layer to obtain a set of thermal friction diffusion vectors, and a pipeline leak location image is generated using the set of thermal friction diffusion vectors.

[0075] Preferably, in some embodiments, extracting the thermal friction diffusion vector based on the natural gas leak diffusion layer specifically includes: obtaining the natural gas leak diffusion layer, and for any infrared pixel in the natural gas leak diffusion layer, extracting the eight-directional pixel gradients of the infrared pixel to form the thermal friction diffusion vector of the infrared pixel.

[0076] In specific implementation, for any infrared pixel in the layer, an eight-neighborhood pixel structure is constructed with that pixel as the center, and the heat gradient in each direction is calculated based on the infrared grayscale value in the neighborhood. For example, the pixel gradient between the pixel and its neighboring pixels in eight directions (up, down, left, right, upper left, upper right, lower left, lower right) is calculated, and the pixel gradient values ​​in the above eight directions are combined into the thermal friction diffusion vector of the current pixel. The thermal friction diffusion vector is used to describe the direction and intensity of heat energy diffusion at the edge of the pipeline during the high-pressure natural gas leak.

[0077] Preferably, in some embodiments, generating a pipeline leak location image using the set of thermal friction diffusion vectors specifically includes:

[0078] Obtain a natural gas leak diffusion layer, and extract the leak direction vector corresponding to each infrared pixel in the natural gas leak diffusion layer based on the pipeline boundary features;

[0079] Obtain the thermal friction diffusion vector. For any thermal friction diffusion vector, obtain the leakage direction vector of the infrared pixel corresponding to the thermal friction diffusion vector. Based on the leakage direction vector, determine the thermal friction diffusion pole of the infrared pixel corresponding to the thermal friction diffusion vector.

[0080] All infrared pixels that meet the criteria for determining thermal friction diffusion poles are taken as thermal friction diffusion poles, and a connectivity test is performed to obtain the maximum pole connectivity region. Based on the location of the maximum pole connectivity region, a spatial projection transformation is performed to generate a pipeline leak location image.

[0081] In practice, within the natural gas leak diffusion layer, the geometric features of the pipeline boundary in the infrared image (such as the direction of the central axis and the orientation of the bounding box) are combined to determine the leakage direction vector corresponding to each infrared pixel, that is, assuming that the natural gas diffuses away from the pipeline boundary normal after the leak.

[0082] It should be noted that the leakage direction vector described in this application can be represented as a unit vector pointing to a possible leakage path for each pixel; if the pipe is a straight line, the leakage direction vector can be approximated as a vector perpendicular to the boundary; if the pipe is a curve or an irregular structure, the direction vector field can be dynamically generated through curvature calculation or boundary gradient calculation.

[0083] In its specific implementation, this application, for each vector in the set of thermal friction diffusion vectors, finds the leakage direction vector of its corresponding infrared pixel and performs thermal friction diffusion pole determination. It should be noted that the principle of thermal friction diffusion pole determination is as follows: High-pressure natural gas at the leak point experiences localized temperature increases due to friction with the rupture edge. As it diffuses outwards, it exchanges heat with the air or surrounding environment, gradually decreasing in temperature. Therefore, a trend of gradually decreasing temperature along the leakage direction will appear along the leakage path. The thermal friction diffusion pole in this application is the local temperature maximum point along this leakage direction. The determination condition is: if... If the thermal friction diffusion vector of a certain infrared pixel is basically consistent with the leakage direction vector (the included angle is within the threshold range), and its temperature value in the leakage direction is a local maximum (relative to several pixels before and after in that direction), then this pixel is determined to be a thermal friction diffusion pole. Then, all pixels that meet the thermal friction diffusion pole condition are marked as thermal friction diffusion poles, and connected component analysis is performed. Using a connected component marking algorithm, the largest pole connected region is detected as the largest pole connected region. The largest pole connected region is projected and mapped to the corresponding spatial coordinates in the infrared image coordinate system to obtain the pipeline leakage point image.

[0084] In step S105, the diffusion feature quantities corresponding to each pipeline leak point in the pipeline leak location image are extracted, the natural gas pipeline flow rate and pressure are obtained, and a pipeline leak area image is generated by the natural gas pipeline flow rate and pressure and the diffusion feature quantities corresponding to each pipeline leak point.

[0085] Preferably, in some embodiments, extracting the diffusion feature quantity corresponding to each pipeline leak point in the pipeline leak location image specifically includes:

[0086] Obtain each pipeline leak point in the pipeline leak location image;

[0087] For any pipeline leak point, trace back its composition information in the natural gas leak diffusion layer to obtain the thermal friction diffusion pole and leakage direction vector corresponding to the pipeline leak point. Extract the average pixel gradient of the thermal friction diffusion pole in the direction corresponding to each leakage direction vector and use it as the diffusion feature quantity corresponding to the pipeline leak point.

[0088] The diffusion feature quantities corresponding to each pipeline leak point in the pipeline leak location image are extracted using the same method.

[0089] In specific implementation, during the process of obtaining each pipeline leak point in the pipeline leak point image, this application first analyzes the pipeline leak point image generated in the previous steps to identify all marked or detected leak point regions. Each leak point can be represented by the center coordinates of the connected region of its corresponding maximum diffusion pole, or it can be located based on the centroid of the connected region. Each leak point is individually numbered and marked for subsequent feature extraction and matching. Then, for any pipeline leak point, its composition information in the diffusion layer is traced back to obtain the set of thermal friction diffusion poles it contains. For each pole pixel, its leakage direction vector is extracted, that is, the possible diffusion direction of its location under the pipeline structure reference. For multiple diffusion poles contained in each leak point, a one-dimensional pixel gradient path is constructed along their respective leakage direction vectors to extract the temperature change trend in that direction. Specifically, a first-order gradient calculation method can be used, taking the absolute value of the gradient of several consecutive pixels along that direction and averaging it as the diffusion feature of the leak point.

[0090] Optionally, in some embodiments, to improve robustness, the gradient values ​​extracted in the diffusion direction can be smoothed or outliers can be removed; at the same time, time series analysis can be introduced to dynamically track the diffusion characteristics of the same leak point in consecutive frames and extract its growth trend to determine the degree of leak deterioration; finally, the diffusion characteristics can be further correlated with pipe parameters such as material and wall thickness of the pipe section where the leak point is located to improve the accuracy of leak area estimation, which is not limited in this application.

[0091] Preferably, in some embodiments, generating a pipeline leak area image using the natural gas pipeline flow rate and pressure and the diffusion characteristics corresponding to each pipeline leak point specifically includes:

[0092] The flow rate and pressure of the natural gas pipeline are obtained, and the diffusion feature quantities corresponding to each pipeline leak point are used to form a diffusion learning vector.

[0093] Feature learning is performed based on the natural gas pipeline flow rate and pressure and the diffusion learning vector to generate the pipeline leakage area, and a pipeline leakage area image is generated based on the pipeline leakage area.

[0094] In practical implementation, this application can retrieve natural gas flow and pressure data at the current moment or when the leak occurs from the pipeline transmission control system or on-site monitoring nodes, including but not limited to instantaneous pressure values, average flow velocity, pressure fluctuation amplitude, etc., and can establish a historical data model of flow and pressure for a specific pipeline section through a moving average autoregressive model to eliminate the impact of short-term measurement errors on the estimation of the leak area; then, extract the corresponding diffusion feature quantity for each pipeline leak point, and form a multi-dimensional vector by sequentially organizing all diffusion feature quantities according to the leak point number; based on the diffusion learning vector and the corresponding pipeline flow and pressure values, a machine learning algorithm or mathematical model is used to perform joint feature modeling.

[0095] It should be noted that when the pipeline flow rate and pressure are high, the leak point is usually small, resulting in stronger thermal friction per unit area and more drastic temperature changes, leading to a larger diffusion feature value. Conversely, if the diffusion feature value is small but the flow rate and pressure are also small, it corresponds to a larger leak area but insufficient energy density. In some specific embodiments of this application, the pipeline leak area can be generated by performing feature learning on the natural gas pipeline flow rate and pressure and the diffusion learning vector through a single hidden layer neural network.

[0096] The following is a specific embodiment of this application that uses a single hidden layer neural network to perform feature learning on the flow rate and pressure of the natural gas pipeline and the diffusion learning vector to generate the pipeline leakage area:

[0097] First, the current flow rate and pressure values ​​of the natural gas pipeline are combined with the extracted diffusion features corresponding to each pipeline leak point to form an input data vector, which is then input into a single-hidden-layer neural network. The hidden layer of the single-hidden-layer neural network includes multiple activation function nodes, used for feature aggregation and nonlinear mapping learning of the input data vector; the output layer of the network outputs the corresponding leak area prediction result, forming the final pipeline leak area estimate.

[0098] During the training phase, multiple pre-collected or simulated data samples with actual measured values ​​of flow rate, pressure, diffusion characteristics, and leakage area are used as the training set. Each set of samples is input into the single hidden layer neural network for classification and regression training. The activation function of the hidden layer can be the ReLU function, depending on the actual data distribution and convergence.

[0099] During training, a loss function, such as mean squared error, is calculated based on the error between the predicted area of ​​the output layer and the actual leakage area corresponding to the sample. The backpropagation algorithm is then used to optimize and update the neural network parameters. The training process ends when the error between the estimated output area and the actual area is below a preset error threshold, or when the loss function converges to its minimum value.

[0100] In practical inference applications, the system can input the flow and pressure data acquired at any time and the diffusion characteristics of the leak point into the trained neural network, output the area estimation result of each leak point, and combine the spatial location and image rendering strategy to form a pipeline leak area image, thereby realizing the visualization of the leak range.

[0101] Through the above methods, the neural network model can establish a nonlinear mapping relationship between input features and leakage area, enabling intelligent assessment and rapid inference of leakage area without the need for explicit physical model building, effectively improving the system's responsiveness to complex leakage behavior and the accuracy of image representation.

[0102] In step S106, the image of the pipeline leak location and the image of the pipeline leak area are uploaded to the transmission control center of the natural gas pipeline.

[0103] It should be noted that the transmission control center is the core system platform in a natural gas or long-distance natural gas pipeline system used for centralized management, monitoring, and scheduling of oil and gas flow. It is typically located in the pipeline operator's command and dispatch building or remote cloud service center. In the process of uploading the pipeline leak location image and the pipeline leak area image to the transmission control center of the natural gas pipeline, the pipeline leak location image and the pipeline leak area image can be uniformly processed into PNG format, and each image can be associated with metadata such as image generation time, pipeline segment number, coordinate location, and image type label. The pipeline leak location image and the pipeline leak area image can be uploaded via wired or wireless communication modules (such as 4G / 5G, satellite link, Wi-Fi, LoRa).

[0104] Furthermore, in another aspect of this application, in some embodiments, this application provides an image processing system for detecting leaks in natural gas pipelines, the system including a leak image processing unit, referencing... Figure 2 The figure is a schematic diagram of the exemplary hardware and / or software structure of a leaked image processing unit according to some embodiments of this application. The leaked image processing unit 200 includes: an image acquisition module 201, a threshold judgment module 202, an image processing module 203, and an image uploading module 204, which are described below:

[0105] Image acquisition module 201 is used to acquire infrared images of natural gas pipelines and extract pipeline temperature features based on the infrared images of natural gas pipelines;

[0106] The threshold judgment module 202 is used to acquire natural gas pipeline images and extract pipeline boundary features based on the natural gas pipeline images when the pipeline temperature characteristics are higher than the real-time leakage alarm threshold.

[0107] Image processing module 203 is used to extract layer features from the infrared image of the natural gas pipeline based on the pipeline boundary features, and obtain the natural gas leakage diffusion layer of the infrared image of the natural gas pipeline.

[0108] The image processing module 203 is further configured to extract thermal friction diffusion vectors based on the natural gas leak diffusion layer to obtain a thermal friction diffusion vector set, and generate a pipeline leak location image through the thermal friction diffusion vector set;

[0109] The image processing module 203 is also used to extract the diffusion feature quantity corresponding to each pipeline leak point in the pipeline leak point image, obtain the natural gas pipeline flow rate and pressure, and generate a pipeline leak area image through the natural gas pipeline flow rate and pressure and the diffusion feature quantity corresponding to each pipeline leak point.

[0110] The image upload module 204 is used to upload the image of the pipeline leak location and the image of the pipeline leak area to the transmission control center of the natural gas pipeline.

[0111] The foregoing has provided a detailed example of an image processing system and method for detecting leaks in natural gas pipelines, as provided in the embodiments of this application. It is understood that the corresponding apparatus includes hardware structures and / or software modules for performing each function in order to achieve the above-mentioned functions.

[0112] Those skilled in the art should readily recognize that, based on the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a certain function in the application is executed in a manner that drives hardware or computer software depends on the specific application and design constraints of the technical solution. Therefore, those skilled in the art can use different methods to implement the described function for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0113] In addition, this application also provides a computer terminal device, which includes a memory and a processor. The memory stores code, and the processor is configured to acquire the code and execute the above-described image processing method for detecting leaks in natural gas pipelines.

[0114] In some embodiments, reference Figure 3 The figure is a schematic diagram of the structure of a computer terminal device implementing an image processing method for natural gas pipeline leak detection, according to some embodiments of this application. The image processing method for natural gas pipeline leak detection described in the above embodiments can... Figure 3 The computer terminal device 300 shown is used to implement this, and the computer terminal device 300 includes at least one communication bus 301, communication interface 302, processor 303 and memory 304.

[0115] The processor 303 may be a general-purpose central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more devices used to control the execution of an image processing method for detecting leaks in natural gas pipelines as described in this application.

[0116] The communication bus 301 may include a path for transmitting information between the aforementioned components.

[0117] Memory 304 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions, random access memory (RAM) or other type of dynamic storage device capable of storing information and instructions, or electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disks or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto. Memory 304 may exist independently and be connected to processor 303 via communication bus 301. Memory 304 may also be integrated with processor 303.

[0118] The memory 304 stores program code for executing the scheme of this application, and its execution is controlled by the processor 303. The processor 303 executes the program code stored in the memory 304. The program code may include one or more software modules. In the above embodiments, the determination of the thermal friction diffusion vector can be achieved by the processor 303 and one or more software modules in the program code in the memory 304.

[0119] Communication interface 302 uses any transceiver-like device for communicating with other devices or communication networks, such as Ethernet, radio access network (RAN), wireless local area networks (WLAN), etc.

[0120] Optionally, the computer terminal device 300 may also include a power supply 305 for providing power to various devices or circuits in the real-time computer terminal device.

[0121] In a specific implementation, as one example, a computer terminal device may include multiple processors, each of which may be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor. Here, a processor may refer to one or more devices, circuits, and / or processing cores used to process data (e.g., computer program instructions).

[0122] The aforementioned computer terminal device can be a general-purpose computer terminal device or a dedicated computer terminal device. In specific implementations, the computer terminal device can be a desktop computer, a portable computer, a network server, a handheld computer (PDA), a mobile phone, a tablet computer, a wireless terminal device, a communication device, or an embedded device. This application does not limit the type of computer terminal device.

[0123] In addition, other aspects of this application provide a computer-readable storage medium storing at least one computer program that is loaded and executed by a processor to perform the operations described above in an image processing method for detecting leaks in natural gas pipelines.

[0124] In summary, the image processing system and method for detecting leaks in natural gas pipelines disclosed in this application first acquires infrared images of the natural gas pipeline and extracts pipeline temperature features based on these images. When the pipeline temperature features exceed a real-time leak alarm threshold, a new image of the natural gas pipeline is acquired, and pipeline boundary features are extracted from the image. Layer features are extracted from the infrared image of the natural gas pipeline based on the pipeline boundary features to obtain a natural gas leak diffusion layer. Thermal friction diffusion vectors are extracted from the natural gas leak diffusion layer to obtain a set of thermal friction diffusion vectors. A pipeline leak location image is generated using this set of thermal friction diffusion vectors. Diffusion feature quantities corresponding to each leak point in the pipeline leak location image are extracted to obtain the natural gas pipeline flow rate and pressure. A pipeline leak area image is generated using the natural gas pipeline flow rate and pressure and the diffusion feature quantities corresponding to each leak point. This allows for the analysis of the frictional heat effect between high-pressure natural gas and the leak point in the natural gas pipeline based on the thermal friction diffusion vectors, thereby generating a visualized pipeline leak area image.

[0125] The above descriptions are merely embodiments of this application, and common knowledge such as specific technical solutions or characteristics in the solutions are not described in detail here. It should be noted that those skilled in the art can make several modifications and improvements without departing from the technical solutions of this application, and these should also be considered within the scope of protection of this application, without affecting the effectiveness of the implementation of this application or the practicality of the patent.

[0126] The scope of protection claimed in this application shall be determined by the content of its claims. The specific embodiments described in the specification can be used to interpret the content of the claims. Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of the invention. Therefore, if these modifications and variations of this application fall within the scope of the claims of this application and their equivalents, this application also intends to include these modifications and variations.

Claims

1. A method for image processing in natural gas pipeline leak detection, characterized in that, The method comprises the following steps: acquiring an infrared image of a natural gas pipeline, and extracting pipeline temperature features based on the infrared image of the natural gas pipeline; when the pipeline temperature features are higher than a real-time leakage alarm threshold, acquiring an image of the natural gas pipeline, and extracting pipeline boundary features based on the image of the natural gas pipeline; extracting layer features of the infrared image of the natural gas pipeline based on the pipeline boundary features, to obtain a natural gas leakage diffusion layer of the infrared image of the natural gas pipeline; extracting heat-friction diffusion vectors based on the natural gas leakage diffusion layer, to obtain a set of heat-friction diffusion vectors, and generating a pipeline leakage point image through the set of heat-friction diffusion vectors; extracting diffusion feature quantities corresponding to each pipeline leakage point in the pipeline leakage point image, acquiring a natural gas pipeline flow pressure, and generating a pipeline leakage area image through the natural gas pipeline flow pressure and the diffusion feature quantities corresponding to each pipeline leakage point; uploading the pipeline leakage point image and the pipeline leakage area image to a transmission control center of the natural gas pipeline; wherein the step of extracting heat-friction diffusion vectors based on the natural gas leakage diffusion layer specifically comprises the following steps: acquiring the natural gas leakage diffusion layer, and for any infrared pixel point in the natural gas leakage diffusion layer, extracting eight-direction pixel gradients of the infrared pixel point to form a heat-friction diffusion vector of the infrared pixel point; the step of generating a pipeline leakage point image through the set of heat-friction diffusion vectors specifically comprises the following steps: acquiring a natural gas leakage diffusion layer, and extracting leakage direction vectors corresponding to each infrared pixel point in the natural gas leakage diffusion layer based on the pipeline boundary features; acquiring the heat-friction diffusion vectors, for any heat-friction diffusion vector, acquiring a leakage direction vector of an infrared pixel point corresponding to the heat-friction diffusion vector, and judging a heat-friction diffusion pole of the infrared pixel point corresponding to the heat-friction diffusion vector based on the leakage direction vector; 2. The method of claim 1, wherein, taking all infrared pixel points meeting the heat-friction diffusion pole judgment condition as heat-friction diffusion poles, and performing a connected region test to obtain a maximum pole connected region, and performing a spatial projection transformation according to a position of the maximum pole connected region to generate a pipeline leakage point image.

3. The method of claim 1, wherein, Before the step of extracting pipeline temperature features based on the infrared image of the natural gas pipeline, the method further comprises the following step: performing image preprocessing on the infrared image of the natural gas pipeline. the step of extracting layer features of the infrared image of the natural gas pipeline based on the pipeline boundary features specifically comprises the following steps:

4. The method of claim 3, wherein, acquiring the pipeline boundary features, performing scale alignment of the pipeline boundary features and the infrared image of the natural gas pipeline based on an image registration algorithm, to obtain a pipeline boundary mask region corresponding to the infrared image of the natural gas pipeline; performing threshold segmentation on infrared pixel points in the pipeline boundary mask region, to obtain a natural gas leakage diffusion layer of the infrared image of the natural gas pipeline. the step of performing threshold segmentation on infrared pixel points in the pipeline boundary mask region, to obtain a natural gas leakage diffusion layer of the infrared image of the natural gas pipeline specifically comprises the following steps: acquiring infrared pixel points in the pipeline boundary mask region; The local adaptive threshold value is used to perform threshold value screening on the infrared pixel points in the pipeline boundary mask area, and the remaining infrared pixel points are grouped according to pixel coordinates to form a natural gas leakage diffusion layer of the natural gas pipeline infrared image.

5. The method of claim 1, wherein, An infrared thermal imaging camera is used to collect the natural gas pipeline infrared image.

6. The method of claim 1, wherein, The pipeline temperature feature is extracted based on the natural gas pipeline infrared image, specifically including: extracting a temperature maximum value, a temperature rise area and a temperature rise gradient of the natural gas pipeline infrared image to form a temperature feature vector, and taking the temperature feature vector as the pipeline temperature feature.

7. An image processing system for natural gas pipeline leak detection, comprising a leak image processing unit for performing the image processing method for natural gas pipeline leak detection according to any one of claims 1 to 6, characterized in that, The leakage image processing unit includes: An image collection module is configured to collect a natural gas pipeline infrared image, and extract a pipeline temperature feature based on the natural gas pipeline infrared image. A threshold value judgment module is configured to collect a natural gas pipeline image when the pipeline temperature feature is higher than a real-time leakage alarm threshold value, and extract a pipeline boundary feature based on the natural gas pipeline image. An image processing module is configured to extract a natural gas leakage diffusion layer of the natural gas pipeline infrared image based on the pipeline boundary feature. The image processing module is further configured to extract a thermal friction diffusion vector set based on the natural gas leakage diffusion layer, and generate a pipeline leakage point image based on the thermal friction diffusion vector set. The image processing module is further configured to extract diffusion feature quantities corresponding to each pipeline leakage point in the pipeline leakage point image, obtain a natural gas pipeline flow pressure, and generate a pipeline leakage area image based on the natural gas pipeline flow pressure and the diffusion feature quantities corresponding to each pipeline leakage point. An image uploading module is configured to upload the pipeline leakage point image and the pipeline leakage area image to a transmission control center of the natural gas pipeline.

8. A computer terminal device, characterized by The computer terminal device includes a memory and a processor, the memory stores a code, and the processor is configured to obtain the code and execute an image processing method for natural gas pipeline leakage detection according to any one of claims 1 to 6.

9. A computer-readable storage medium storing at least one computer program, characterized in that, The computer program is loaded and executed by the processor to implement the operations performed by the image processing method for natural gas pipeline leakage detection according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Natural gas pipeline leakage monitoring system based on thermal infrared imager

    CN115751203A

  • Method for leakage detection of underground pipeline corridor based on dynamic infrared thermal image processing

    US20190331301A1