A pipeline leakage detection method based on video processing

Through a video processing-based method, combined with high-pass filtering and Hough linear detection technology, the problem of the existing technology being difficult to accurately detect pipe liquid leakage in outdoor environments is solved, and high-precision and high-adaptive pipeline leakage detection is achieved.

CN119323575BActive Publication Date: 2025-04-25CITIC HIC KAICHENG INTELLIGENT EQUIP CO LTD

Patent Information

Application Number
CN202411876271.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-19
Publication Date
2025-04-25
Estimated Expiration
2044-12-19

AI Technical Summary

Technical Problem

The prior art is difficult to accurately detect pipe liquid leakage in outdoor environments, especially in situations where light changes are large, resulting in low detection efficiency and high misjudgment rate.

Method used

Using a video processing-based method, through the extraction, analysis and recognition of multi-frame images, combined with high-pass filtering and Hough linear detection technology, the noise caused by background interference and light changes is filtered out to achieve accurate detection of pipeline leakage.

Benefits of technology

It improves the accuracy and adaptability of pipeline leakage detection, and can accurately detect pipeline liquid leakage under different lighting conditions, replacing manual detection, improving detection efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119323575B_ABST
    Figure CN119323575B_ABST
Patent Text Reader

Abstract

The present invention discloses a pipeline leakage detection method based on video processing, comprising the following steps: S1: performing anti-shake processing and Gaussian filtering on two consecutive frames of images, and performing difference to obtain a differential image; S2: performing high-pass filtering on the differential image; S3: accumulating L differential images after high-pass filtering; S4: binarizing the accumulated image; S5: performing an open operation on the binarized image; S6: calculating the number of bright spots in S5 and the bright spot ratio; if the bright spot ratio is not within a specified range, abandoning the recognition result; if the bright spot ratio is within a specified range, performing step S7; S7: performing Hough straight line detection, if a vertical straight line is detected, it is considered that a leakage occurs in the current second; otherwise, no leakage occurs. The present invention adopts high-pass filtering, has high accuracy in pipeline leakage detection, and has good adaptability to slight changes in light in the collected video.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and in particular to a pipeline leakage detection method based on video processing. Background Art

[0002] There are many oil pipelines in petrochemical stations. In order to ensure their safe operation, they need to be inspected. At present, pipeline inspection mainly adopts manual inspection, which has a large workload, low inspection efficiency, and the phenomenon of being unable to detect a small amount of oil leakage in time. Due to external environmental interference and pipeline aging, the joints of the transport pipeline are prone to leakage. If they cannot be discovered and repaired in time, there will be great safety hazards and even cause significant economic losses.

[0003] The patent application number is: 201710237423.9, and the patent name is "A pipeline liquid leakage monitoring method based on image processing". A pipeline liquid leakage monitoring method is proposed, but this method does not consider the impact of outdoor lighting changes on the image. It can only be applied to some indoor places with constant lighting, and its scope of use is limited. Summary of the invention

[0004] In view of the above problems, the purpose of the present invention is to provide a pipeline leakage detection method based on video processing with high accuracy, strong adaptability and the ability to replace personnel detection. The detection method uses multiple frames of images to extract, analyze and identify the leaking liquid, and performs some filtering processing on the background interference to adapt to different scenarios. The detection method can accurately detect whether there is liquid leakage in the pipeline, solving the problem of difficult and untimely detection of liquid leakage in petrochemical plants.

[0005] The present invention is achieved in that:

[0006] A pipeline leakage detection method based on video processing first collects T seconds of video at the location where the pipeline needs to detect leakage, and then analyzes, processes and identifies the collected T seconds of video. The video analysis, processing and identification process includes the following steps:

[0007] S1: Get two consecutive RGB images F1 and F2 from the video, perform anti-shake processing and Gaussian filtering on F1 and F2, and then make a difference between the two frames to obtain a differential image S;

[0008] S2: Perform high-pass filtering on the difference image S to obtain the processed image S ′ ;

[0009] S3: pass the current image to the previous frame image, read the next frame image, repeat S1 to S2, obtain L high-pass filtered difference images, accumulate all the difference images, and obtain the accumulated difference image;

[0010] S4: binarizing the accumulated difference image to obtain a binarized image B;

[0011] S5: Perform an opening operation on the binary image B to obtain B ′ , filter out the accumulated noise caused by light changes;

[0012] S6: Calculate B ′ The number of bright spots and the bright spot ratio are calculated; if the bright spot ratio is not within the specified range, it is considered that there is a large interference in the image, and the recognition result is abandoned and the next second detection is performed; if the bright spot ratio is within the specified range, step S7 is performed;

[0013] S7: Binarized image B ′ Perform Hough line detection. If a vertical line is detected, it is considered that a leak has occurred in the current second; otherwise, no leak has occurred.

[0014] Furthermore, step S1 specifically includes the following steps:

[0015] S11: for two consecutive frames of RGB images F1 and F2 obtained from the video, the orb feature points of the images are calculated respectively, and the homography matrix H of F1 and F2 is calculated by feature matching;

[0016] S12: Calculate F2 H=F'2, get the image aligned with F1;

[0017] S13: According to the set ROI area, image F'1 is intercepted from F1, image F''2 is intercepted from F'2, and F'1 and F''2 are converted into grayscale images G1 and G2.

[0018] Furthermore, the calculation method for converting the RGB image into a grayscale image in step S13 is:

[0019] Gray=R×0.299+G×0.587+B×0.114

[0020] Where Gray represents the gray value of the grayscale image; R represents the red component of the color RGB image; G represents the green component of the color RGB image; B represents the blue component of the color RGB image.

[0021] Furthermore, the calculation method of the high-pass filtering process in step S2 is:

[0022] ;

[0023] Where: S ′ (x, y) represents the image S obtained after high-pass filtering ′S(x,y) represents the grayscale value of the pixel (x,y) in the input differential image S; thresh1 represents the threshold of high-pass filtering processing, and thresh1 is a natural number ranging from 0 to 255.

[0024] Furthermore, the cumulative calculation method in step S3 is:

[0025] sum ′ (x,y)=sum(x,y)+S ′ (x,y)

[0026] Where: sum(x,y) represents the pixel value of the accumulated difference image at point (x,y), sum ′ (x, y) represents the pixel value of the final calculated accumulated difference image at the point (x, y).

[0027] Furthermore, the calculation method of the binarization process in step S4 is:

[0028] ;

[0029] Where B(x,y) represents the image after the pixel is binarized at the point (x,y); sum(x,y) represents the pixel value of the accumulated difference image at the point (x,y); thresh2 represents the threshold of the binarization process.

[0030] The beneficial effects of the present invention are:

[0031] Compared with the prior art, the pipeline leakage detection method based on video processing of the present invention has the following advantages:

[0032] (1) This detection method is easy to use. By collecting video for a period of time, it is possible to detect whether there is a pipeline liquid leak.

[0033] (2) The present invention is based on global image de-shaking processing technology and has good adaptability to slight shakes in captured video and strong adaptability.

[0034] (3) The present invention adopts high-pass filtering technology, which has high accuracy in pipeline leakage detection and good adaptability to slight changes in light in the captured video.

[0035] (4) The present invention has the characteristics of simple operation, high precision and strong adaptability, and can replace manual pipeline leakage detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 It is a flow chart of the processing method of the present invention;

[0037] Figure 2 Detection ROI area map for the present invention;

[0038] Figure 3 The present invention is leaking multiple frames of video;

[0039] Figure 4 is the inter-frame difference image of the present invention;

[0040] Figure 5 This is the frame difference accumulation image of the present invention. DETAILED DESCRIPTION

[0041] The technical scheme in the embodiment of the present invention is described clearly and completely below in conjunction with the accompanying drawings in the embodiment of the present invention. In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention can also be implemented in other ways different from those described herein, and those skilled in the art can make similar generalizations without violating the connotation of the present invention, so the present invention is not limited by the specific embodiments disclosed below.

[0042] The pipeline leakage detection method based on video processing of the present invention first collects T seconds of video at the location where the pipeline needs to detect leakage, and then analyzes, processes and identifies the collected T seconds of video. The video analysis, processing and identification process includes the following steps. For specific steps, please refer to Figure 1 Flowchart:

[0043] S1: Get two consecutive RGB images F1 and F2 from the video, perform anti-shake processing and Gaussian filtering on F1 and F2, and then make a difference between the two frames to obtain a differential image S.

[0044] Step S1 specifically includes the following steps:

[0045] S11: For two consecutive frames of RGB images F1 and F2 obtained from the video, the orb feature points of the images are calculated respectively, and the homography matrix H of F1 and F2 is calculated by feature matching.

[0046] S12: Calculate F2 H=F'2, and an image aligned with F1 is obtained. By aligning the image, leakage detection in the case of video jitter can be adapted.

[0047] S13: According to the set ROI area, image F'1 is intercepted from F1, image F''2 is intercepted from F'2, and F'1 and F''2 are converted into grayscale images G1 and G2. For the detection ROI area diagram of the present invention, please refer to Figure 2 The rectangular frame shown. The calculation method for converting the RGB image into a grayscale image in step S13 is:

[0048] Gray=R×0.299+G×0.587+B×0.114

[0049] Where Gray represents the gray value of the grayscale image; R represents the red component of the color RGB image; G represents the green component of the color RGB image; B represents the blue component of the color RGB image.

[0050] Due to lighting reasons, the edges of the two frames of images change. In order to reduce the impact of cumulative changes on detection, in this embodiment, the converted grayscale image is Gaussian filtered, and then the difference between the two frames of images is taken to obtain a differential image S. Figure 4 It is the inter-frame difference image of the present invention.

[0051] S2: Perform high-pass filtering on the difference image S to obtain the processed image S ′ The calculation method of the high-pass filtering process in step S2 is:

[0052] ;

[0053] Where: S ′ (x, y) represents the image S obtained after high-pass filtering ′ S(x,y) represents the grayscale value of the pixel (x,y) in the input differential image S; thresh1 represents the threshold of high-pass filtering processing, and thresh1 is a natural number ranging from 0 to 255.

[0054] S3: pass the current image to the previous frame image, read the next frame image, repeat S1 to S2, obtain L high-pass filtered differential images, accumulate all differential images, and obtain an accumulated differential image. Figure 3 As shown, the frame difference accumulation image can be seen in Figure 5 The cumulative calculation method in step S3 is:

[0055] sum ′ (x,y)=sum(x,y)+S ′ (x,y)

[0056] Where: sum(x,y) represents the pixel value of the accumulated difference image at point (x,y), sum ′ (x, y) represents the pixel value of the final calculated accumulated difference image at the point (x, y).

[0057] S4: Binarization processing is performed on the accumulated difference image to obtain a binary image B. The calculation method of the binary processing in step S4 is:

[0058] ;

[0059] Where B(x,y) represents the image after the pixel is binarized at the point (x,y); sum(x,y) represents the pixel value of the accumulated difference image at the point (x,y); thresh2 represents the threshold of the binarization process.

[0060] S5: Perform an opening operation on the binary image B to obtain B ′ , filtering out the accumulated noise caused by light changes.

[0061] S6: Calculate B ′ If the bright spot ratio is not within the specified range, it is considered that there is a large interference in the image, and the recognition result is abandoned and the next second detection is performed; if the bright spot ratio is within the specified range, step S7 is performed. Through steps S5 and S6, it is possible to effectively prevent misidentification caused by light changes, flying insects, etc., and reduce the misjudgment rate.

[0062] S7: Binarized image B ′ Perform Hough line detection. If a vertical line is detected, it is considered that a leak has occurred in the current second; otherwise, no leak has occurred.

[0063] Although the present invention discloses preferred specific embodiments to achieve the above-mentioned objectives, it is not intended to limit the structural features of the present invention. Any person skilled in the art should know that within the technical spirit of the present invention, any easily conceivable changes or modifications are possible and are all covered by the scope of the patent application of the present invention.

Claims

1. A pipeline leakage detection method based on video processing, characterized in that: First, collect T seconds of video at the location where the pipeline needs to detect leakage, and then analyze, process and identify the collected T seconds of video. The process of video analysis, processing and identification includes the following steps: S1: Get two consecutive RGB images F1 and F2 from the video, perform anti-shake processing and Gaussian filtering on F1 and F2, and then make a difference between the two frames to obtain a differential image S; S2: Perform high-pass filtering on the difference image S to obtain the processed image S ′ ; S3: pass the current image to the previous frame image, read the next frame image, repeat S1 to S2, obtain L high-pass filtered difference images, accumulate all the difference images, and obtain the accumulated difference image; S4: binarizing the accumulated difference image to obtain a binarized image B; S5: Perform an opening operation on the binary image B to obtain B ′ , filter out the accumulated noise caused by light changes; S6: Calculate B ′ The number of bright spots and the bright spot ratio are calculated; if the bright spot ratio is not within the specified range, it is considered that there is a large interference in the image, and the recognition result is abandoned and the next second detection is performed; if the bright spot ratio is within the specified range, step S7 is performed; S7: Binarized image B ′ Perform Hough line detection. If a vertical line is detected, it is considered that a leak has occurred in the current second; otherwise, no leak has occurred.

2. The pipeline leakage detection method based on video processing according to claim 1 is characterized in that: Step S1 specifically includes the following steps: S11: for two consecutive frames of RGB images F1 and F2 obtained from the video, the orb feature points of the images are calculated respectively, and the homography matrix H of F1 and F2 is calculated by feature matching; S12: Calculate F2 H=F'2, get the image aligned with F1; S13: According to the set ROI area, image F'1 is intercepted from F1, image F''2 is intercepted from F'2, and F'1 and F''2 are converted into grayscale images G1 and G2.

3. The pipeline leakage detection method based on video processing according to claim 2 is characterized in that: The calculation method for converting the RGB image into a grayscale image in step S13 is: Gray=R×0.299+G×0.587+B×0.114 Where Gray represents the gray value of the grayscale image; R represents the red component of the color RGB image; G represents the green component of the color RGB image; B represents the blue component of the color RGB image.

4. The pipeline leakage detection method based on video processing according to claim 1 is characterized in that: The calculation method of the high-pass filtering process in step S2 is: ; Where: S ′ (x, y) represents the image S obtained after high-pass filtering ′ S(x,y) represents the grayscale value of the pixel (x,y) in the input differential image S; thresh1 represents the threshold of high-pass filtering processing, and thresh1 is a natural number ranging from 0 to 255.

5. The pipeline leakage detection method based on video processing according to claim 4 is characterized in that: The cumulative calculation method in step S3 is: sum ′ (x,y)=sum(x,y)+S ′ (x,y) Where: sum(x,y) represents the pixel value of the accumulated difference image at point (x,y), sum ′ (x, y) represents the pixel value of the final calculated accumulated difference image at the point (x, y).

6. The pipeline leakage detection method based on video processing according to claim 5 is characterized in that: The calculation method of the binarization process in step S4 is: ; Where B(x,y) represents the image after the pixel is binarized at point (x,y); sum(x,y) represents the pixel value of the accumulated difference image at point (x,y); thresh2 represents the threshold of the binarization process.

Citation Information

Patent Citations

  • Pipeline liquid leakage monitoring method based on image processing

    CN107013811A

  • Petrochemical plant pipeline liquid leakage detection method and system based on images

    CN117152064A

  • Gas leakage detection method and device, equipment and storage medium

    CN117405303A

Cited By

  • A dual-mode fusion tubing leak adaptive video detection method

    CN122636516A