Pipeline steam leakage detection method and device, electronic equipment and storage medium

By using the RGB pixel values ​​of pipeline video images and a region growing algorithm, steam pixel regions are identified. Combined with cross-union calibration, the problems of high cost and low accuracy in pipeline steam leak detection are solved, achieving efficient and accurate steam leak detection.

CN115546112BActive Publication Date: 2026-06-09ANHUI CHIZHOU JIUHUA POWER GENERATION CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ANHUI CHIZHOU JIUHUA POWER GENERATION CO LTD
Filing Date
2022-09-14
Publication Date
2026-06-09

AI Technical Summary

Technical Problem

In existing methods for detecting steam leaks in pipelines, manual inspections are time-consuming and labor-intensive, while automatic detection relies on deep learning, which requires a large amount of hard-to-obtain training data, resulting in high costs and poor performance.

Method used

By acquiring video images of the pipeline, determining the RGB pixel values ​​of multiple frames, using a region growing algorithm to identify steam pixel regions, and combining this with cross-union calibration, it is determined whether there is a steam leak in the pipeline.

Benefits of technology

No training dataset needs to be built, which reduces detection costs and improves the accuracy and efficiency of steam leak detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115546112B_ABST
    Figure CN115546112B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a pipeline steam leakage detection method and device, electronic equipment and storage medium, and relates to the technical field. The present disclosure first acquires a video image of a to-be-detected pipeline, determines a plurality of to-be-detected images from the video image, secondly acquires the RGB pixel value of each pixel point in the to-be-detected image, thirdly determines the first undetermined steam pixel region corresponding to each to-be-detected image according to the RGB pixel value of each pixel point in the plurality of to-be-detected images, and then determines a preset number of second undetermined steam pixel regions according to the plurality of first undetermined steam pixel regions corresponding to the plurality of to-be-detected images. Whether the to-be-detected pipeline has steam leakage is determined according to the preset number of second undetermined steam pixel regions. In this way, the video image of the to-be-detected pipeline can be used to accurately detect pipeline steam leakage, and a training data set does not need to be constructed, thereby reducing the detection cost of pipeline steam leakage.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the industrial field, and more particularly to a method, apparatus, electronic device, and storage medium for detecting pipeline steam leaks. Background Technology

[0002] Existing methods for detecting pipeline steam leaks can be divided into two categories: manual inspection and automatic detection. Manual inspection is time-consuming, labor-intensive, and has high human resource costs, while automatic detection methods generally use deep learning methods. These methods typically require a large amount of pipeline steam leak training data to train the deep learning model. However, training datasets for pipeline steam leaks are difficult to obtain, and building a dataset yourself is costly and does not yield good training results for deep learning models. Summary of the Invention

[0003] To overcome the problems existing in related technologies, this disclosure provides a method, apparatus, electronic device and storage medium for detecting pipeline steam leakage.

[0004] According to a first aspect of the present disclosure, a method for detecting pipeline steam leakage is provided, the method comprising:

[0005] Acquire video images of the pipe under test, and determine multiple frames of the test image from the video images;

[0006] Obtain the RGB pixel value of each pixel in the image to be tested;

[0007] The first undetermined steam pixel region corresponding to each frame of the test image is determined based on the RGB pixel value of each pixel in the multi-frame test image.

[0008] A preset number of second undetermined steam pixel regions are determined based on the multiple first undetermined steam pixel regions corresponding to the multiple frames of images to be tested.

[0009] The presence of steam leakage in the pipeline under test is determined based on the preset number of second undetermined steam pixel regions.

[0010] Optionally, determining the first undetermined steam pixel region corresponding to each frame of the test image based on the RGB pixel values ​​of each pixel in the multiple frames of the test image includes:

[0011] Based on a specified step size, determine the historical images to be tested corresponding to each frame of the image to be tested from the video images;

[0012] The first undetermined steam pixel region corresponding to the test image is determined based on the first RGB pixel value of each pixel in each frame of the test image and the second RGB pixel value of each pixel in the corresponding historical test image, so as to obtain the first undetermined steam pixel region corresponding to each frame of the test image.

[0013] Optionally, determining the first undetermined steam pixel region corresponding to the test image based on the first RGB pixel value of each pixel in each frame of the test image and the second RGB pixel value of each pixel in the corresponding historical test image, to obtain the first undetermined steam pixel region corresponding to each frame of the test image, includes:

[0014] For each frame of the image to be tested, a first undetermined pixel is determined based on the first RGB pixel value and the corresponding second RGB pixel value. The difference between the first RGB pixel value and the second RGB pixel value of the first undetermined pixel is within a preset color change threshold range, and the gradient between the first undetermined pixel and its neighboring pixels is within a preset gradient threshold range. The difference between the maximum and minimum values ​​of the first RGB pixel values ​​is within a preset difference range. The gradient represents the difference between the third RGB pixel value and the fourth RGB pixel value of the first undetermined pixel. The third RGB pixel value represents the maximum value among the minimum RGB pixel values ​​of each of the neighboring pixels, and the fourth RGB pixel value represents the minimum value among the minimum RGB pixel values ​​of each of the neighboring pixels.

[0015] For each first undetermined pixel, if the number of first undetermined pixels within a preset first neighborhood range is greater than or equal to a preset threshold for the number of first neighborhood pixels, the first undetermined pixel is determined to be a second undetermined pixel.

[0016] According to the preset first region growth rule, the first growth point value of each second undetermined pixel is determined by the region growth algorithm;

[0017] The first growth point value and the RGB pixel value of each second undetermined pixel in each frame of the image to be tested are used as the first undetermined steam pixel region.

[0018] Optionally, determining a preset number of second undetermined steam pixel regions based on the plurality of first undetermined steam pixel regions corresponding to the multiple frames of images to be tested includes:

[0019] For each pixel in each of the first undetermined steam pixel regions, the first growth point sum value of the pixels in the preset second neighborhood range is obtained. If the first growth point sum value is within the preset sum value threshold range, the pixel in the first undetermined steam pixel region is determined as the third undetermined pixel.

[0020] The multiple frames of images to be tested are divided into multiple groups of images to be tested. For each third undetermined pixel in each group of images to be tested, the second growth point and value corresponding to the multiple first growth point values ​​in the group of images to be tested are obtained. Based on the second growth point and value, one or more first circumscribed regions including the third undetermined pixel are determined. The third undetermined pixel in any image to be tested in the first circumscribed region in each group of images to be tested is taken as the fourth undetermined pixel corresponding to the group of images to be tested. The area of ​​the first circumscribed region is greater than or equal to a first preset area threshold.

[0021] For each of the fourth undetermined pixels, if the number of fourth undetermined pixels within a preset third neighborhood is greater than or equal to the number of preset second neighborhood pixels, the fourth undetermined pixel is determined to be the fifth undetermined pixel.

[0022] According to the preset second region growth rule, the region growth algorithm is used to determine the second growth point value of each of the fifth undetermined pixels;

[0023] The second growth point value and the RGB pixel value of each fifth undetermined pixel are used as the second undetermined steam pixel region corresponding to each group of images to be tested.

[0024] Optionally, determining whether the pipe under test has a steam leak based on the preset number of second undetermined steam pixel regions includes:

[0025] Based on the preset number of RGB pixel values ​​and corresponding growth point values ​​in the second undetermined steam pixel regions, the reference steam pixel region corresponding to the image under test is obtained;

[0026] The reference steam pixel area is calibrated to determine whether there is a steam leak in the pipeline under test.

[0027] Optionally, obtaining the reference steam pixel region corresponding to the image under test based on the RGB pixel value and the corresponding growth point value of each of the preset number of second undetermined steam pixel regions includes:

[0028] For each pixel in the second undetermined steam pixel region, if the number of pixels in the fourth neighboring region is greater than or equal to the number of pixels in the third neighboring region, the pixel in the second undetermined steam pixel region is determined as the sixth undetermined pixel.

[0029] Obtain the third growth point sum value for each of the sixth undetermined pixels in different second undetermined vapor pixel regions;

[0030] Based on the third growth point and value, one or more second outer regions including the sixth undetermined pixel are determined, and the reference vapor pixel region is determined from the second outer region, wherein the area of ​​the reference vapor pixel region is greater than or equal to the area threshold of the second preset region.

[0031] Optionally, calibrating the reference steam pixel area to determine whether there is a steam leak in the pipe under test includes:

[0032] Determine multiple calibration images from the video images following the multiple frames of images to be tested;

[0033] Obtain the RGB pixel value of each pixel in the calibration image;

[0034] The first calibration vapor pixel region corresponding to each frame of calibration image is determined based on the RGB pixel value of each pixel in the multi-frame calibration image;

[0035] Multiple second calibration vapor pixel regions are determined based on multiple first calibration vapor pixel regions corresponding to the multiple frames of calibration images;

[0036] According to a preset calibration sequence, the reference steam pixel area is calibrated based on multiple second calibration steam pixel areas to determine whether there is a steam leak in the pipeline under test.

[0037] Optionally, the step of calibrating the reference steam pixel region according to a preset calibration sequence based on multiple second calibration steam pixel regions to determine whether the pipe under test has a steam leak includes:

[0038] The current second calibration vapor pixel region is determined according to the preset calibration sequence;

[0039] Obtain the cross-over ratio (COP) of the current second calibration vapor pixel region and the reference vapor pixel region;

[0040] If the cross-connection ratio is greater than a preset first cross-connection ratio threshold, the current second calibration vapor pixel region is taken as the reference vapor pixel region;

[0041] The cross-union ratio is updated based on the cross-union ratio, the cross-union ratio count and the cross-union ratio mean, the cross-union ratio mean represents the average cross-union ratio of the plurality of calibrated second calibration vapor pixel regions with the reference vapor pixel region, and the cross-union ratio count represents the number of the plurality of calibrated second calibration vapor pixel regions;

[0042] According to the preset calibration sequence, the next second calibration steam pixel region is taken as the new current second calibration steam pixel region. The process of obtaining the cross-connection ratio of the current second calibration steam pixel region and the reference steam pixel region is repeated. If the cross-connection ratio is greater than the preset first cross-connection ratio threshold, the current second calibration steam pixel region is taken as the reference steam pixel region. The steps of updating the cross-connection ratio count and the cross-connection ratio mean are performed according to the cross-connection ratio until it is determined whether there is a steam leak in the pipeline under test based on the cross-connection ratio count and the cross-connection ratio mean.

[0043] Optionally, determining whether the pipeline under test has a steam leak based on the number of cross-combination ratios and the average cross-combination ratio includes:

[0044] If the number of cross-connection ratios is greater than a preset first cross-connection ratio threshold and the average cross-connection ratio is less than a second cross-connection ratio threshold, it is determined that there is no steam leakage in the pipeline under test.

[0045] Optionally, determining whether the pipeline under test has a steam leak based on the number of cross-connection ratios and the average cross-connection ratio includes:

[0046] If the number of cross-connection ratios is greater than a preset second cross-connection ratio threshold, and the average cross-connection ratio is greater than a third cross-connection ratio threshold, it is determined that the pipeline under test has a steam leak.

[0047] Optionally, the method further includes:

[0048] If it is determined that there is a steam leak in the pipeline under test, the reference steam pixel area is used as the target steam pixel area.

[0049] According to a second aspect of the present disclosure, a detection device for pipeline steam leakage is provided, the device comprising:

[0050] The first acquisition module is configured to acquire video images of the pipeline under test and determine multiple frames of images under test from the video images;

[0051] The second acquisition module is configured to acquire the RGB pixel value of each pixel in the image to be tested;

[0052] The first determining module is configured to determine the first undetermined steam pixel region corresponding to each frame of the test image based on the RGB pixel value of each pixel in the multi-frame test image;

[0053] The second determining module is configured to determine a preset number of second undetermined steam pixel regions based on the multiple first undetermined steam pixel regions corresponding to the multiple frames of images to be tested.

[0054] The detection module is configured to determine whether there is a steam leak in the pipeline under test based on the preset number of second undetermined steam pixel regions.

[0055] Optionally, the first determining module is further configured to:

[0056] Based on a specified step size, determine the historical images to be tested corresponding to each frame of the image to be tested from the video images;

[0057] The first undetermined steam pixel region corresponding to the test image is determined based on the first RGB pixel value of each pixel in each frame of the test image and the second RGB pixel value of each pixel in the corresponding historical test image, so as to obtain the first undetermined steam pixel region corresponding to each frame of the test image.

[0058] Optionally, the first determining module is further configured to:

[0059] For each frame of the image to be tested, a first undetermined pixel is determined based on the first RGB pixel value and the corresponding second RGB pixel value. The difference between the first RGB pixel value and the second RGB pixel value of the first undetermined pixel is within a preset color change threshold range, and the gradient between the first undetermined pixel and its neighboring pixels is within a preset gradient threshold range. The difference between the maximum and minimum values ​​of the first RGB pixel values ​​is within a preset difference range. The gradient represents the difference between the third RGB pixel value and the fourth RGB pixel value of the first undetermined pixel. The third RGB pixel value represents the maximum value among the minimum RGB pixel values ​​of each of the neighboring pixels, and the fourth RGB pixel value represents the minimum value among the minimum RGB pixel values ​​of each of the neighboring pixels.

[0060] For each first undetermined pixel, if the number of first undetermined pixels within a preset first neighborhood range is greater than or equal to a preset threshold for the number of first neighborhood pixels, the first undetermined pixel is determined to be a second undetermined pixel.

[0061] According to the preset first region growth rule, the first growth point value of each second undetermined pixel is determined by the region growth algorithm;

[0062] The first growth point value and the RGB pixel value of each second undetermined pixel in each frame of the image to be tested are used as the first undetermined steam pixel region.

[0063] Optionally, the second determining module is further configured to:

[0064] For each pixel in each of the first undetermined steam pixel regions, the first growth point sum value of the pixels in the preset second neighborhood range is obtained. If the first growth point sum value is within the preset sum value threshold range, the pixel in the first undetermined steam pixel region is determined as the third undetermined pixel.

[0065] The multiple frames of images to be tested are divided into multiple groups of images to be tested. For each third undetermined pixel in each group of images to be tested, the second growth point and value corresponding to the multiple first growth point values ​​in the group of images to be tested are obtained. Based on the second growth point and value, one or more first circumscribed regions including the third undetermined pixel are determined. The third undetermined pixel in any image to be tested in the first circumscribed region in each group of images to be tested is taken as the fourth undetermined pixel corresponding to the group of images to be tested. The area of ​​the first circumscribed region is greater than or equal to a first preset area threshold.

[0066] For each of the fourth undetermined pixels, if the number of fourth undetermined pixels within a preset third neighborhood is greater than or equal to the number of preset second neighborhood pixels, the fourth undetermined pixel is determined to be the fifth undetermined pixel.

[0067] According to the preset second region growth rule, the region growth algorithm is used to determine the second growth point value of each of the fifth undetermined pixels;

[0068] The second growth point value and the RGB pixel value of each fifth undetermined pixel are used as the second undetermined steam pixel region corresponding to each group of images to be tested.

[0069] Optionally, the detection module is further configured to:

[0070] Based on the RGB pixel value of each RGB pixel in the second undetermined steam pixel region and the corresponding growth point value, the reference steam pixel region corresponding to the image under test is obtained;

[0071] The reference steam pixel area is calibrated to determine whether there is a steam leak in the pipeline under test.

[0072] Optionally, the detection module is further configured to:

[0073] For each pixel in the second undetermined steam pixel region, if the number of pixels in the fourth neighboring region is greater than or equal to the number of pixels in the third neighboring region, the pixel in the second undetermined steam pixel region is determined as the sixth undetermined pixel.

[0074] Obtain the third growth point sum value for each of the sixth undetermined pixels in different second undetermined vapor pixel regions;

[0075] Based on the third growth point and value, one or more second outer regions including the sixth undetermined pixel are determined, and the reference vapor pixel region is determined from the second outer region, wherein the area of ​​the reference vapor pixel region is greater than or equal to the area threshold of the second preset region.

[0076] Optionally, the detection module is further configured to:

[0077] Determine multiple calibration images from the video images following the multiple frames of images to be tested;

[0078] Obtain the RGB pixel value of each pixel in the calibration image;

[0079] The first calibration vapor pixel region corresponding to each frame of calibration image is determined based on the RGB pixel value of each pixel in the multi-frame calibration image;

[0080] Multiple second calibration vapor pixel regions are determined based on multiple first calibration vapor pixel regions corresponding to the multiple frames of calibration images;

[0081] According to a preset calibration sequence, the reference steam pixel area is calibrated based on multiple second calibration steam pixel areas to determine whether there is a steam leak in the pipeline under test.

[0082] Optionally, the detection module is further configured to:

[0083] The current second calibration vapor pixel region is determined according to the preset calibration sequence;

[0084] Obtain the cross-over ratio (COP) of the current second calibration vapor pixel region and the reference vapor pixel region;

[0085] If the cross-connection ratio is greater than a preset first cross-connection ratio threshold, the current second calibration vapor pixel region is taken as the reference vapor pixel region;

[0086] The cross-union ratio is updated based on the cross-union ratio, the cross-union ratio count and the cross-union ratio mean, the cross-union ratio mean represents the average cross-union ratio of the plurality of calibrated second calibration vapor pixel regions with the reference vapor pixel region, and the cross-union ratio count represents the number of the plurality of calibrated second calibration vapor pixel regions;

[0087] According to the preset calibration order, the next second calibration vapor pixel region is taken as the new current second calibration vapor pixel region. The process of obtaining the intersection-over-union ratio (IoU) of the current second calibration vapor pixel region and the reference vapor pixel region is repeated. If the IoU is greater than a preset first IoU threshold, the current second calibration vapor pixel region is taken as the reference vapor pixel region.

[0088] The steps of updating the cross-connection ratio count and the average cross-connection ratio based on the cross-connection ratio continue until it is determined whether there is a steam leak in the pipeline under test based on the cross-connection ratio count and the average cross-connection ratio.

[0089] Optionally, the detection module is further configured to:

[0090] If the number of cross-connection ratios is greater than a preset first cross-connection ratio threshold and the average cross-connection ratio is less than a second cross-connection ratio threshold, it is determined that there is no steam leakage in the pipeline under test.

[0091] Optionally, the detection module is further configured to:

[0092] If the number of cross-connection ratios is greater than a preset second cross-connection ratio threshold, and the average cross-connection ratio is greater than a third cross-connection ratio threshold, it is determined that the pipeline under test has a steam leak.

[0093] Optionally, the detection module is further configured to:

[0094] If it is determined that there is a steam leak in the pipeline under test, the reference steam pixel area is used as the target steam pixel area.

[0095] According to a third aspect of the present disclosure, an electronic device is provided, comprising:

[0096] A memory on which computer programs are stored;

[0097] A processor for executing the computer program in the memory to implement the steps of the method of any one of the first aspects.

[0098] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided that stores computer program instructions thereon, which, when executed by a processor, implement the steps of the method described in any of the first aspects.

[0099] The technical solutions provided by the embodiments of this disclosure may include the following beneficial effects:

[0100] This disclosure first acquires video images of the pipeline under test, determines multiple frames of test images from the video images, then acquires the RGB pixel values ​​of each pixel in the test images, and further determines a first undetermined steam pixel region corresponding to each frame of the test images based on the RGB pixel values ​​of each pixel in the multiple test images. Then, a preset number of second undetermined steam pixel regions are determined based on the multiple first undetermined steam pixel regions corresponding to the multiple test images. Finally, the presence of steam leakage in the pipeline under test is determined based on the preset number of second undetermined steam pixel regions. In this way, steam leakage in the pipeline can be accurately detected using video images of the pipeline under test without the need to construct a training dataset, which helps reduce the detection cost of steam leakage in pipelines and effectively ensures the accuracy of the detection results.

[0101] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure.

[0102] Other features and advantages of this disclosure will be described in detail in the following detailed description section. Attached Figure Description

[0103] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure, but do not constitute a limitation thereof.

[0104] Figure 1 This is a flowchart illustrating a method for detecting steam leakage in a pipeline according to an exemplary embodiment.

[0105] Figure 2 This is a flowchart illustrating another method for detecting pipeline steam leaks according to an exemplary embodiment.

[0106] Figure 3 This is a flowchart illustrating yet another method for detecting pipeline steam leakage according to an exemplary embodiment.

[0107] Figure 4 This is a flowchart illustrating yet another method for detecting pipeline steam leakage according to an exemplary embodiment.

[0108] Figure 5 This is a flowchart illustrating yet another method for detecting pipeline steam leakage according to an exemplary embodiment.

[0109] Figure 6 This is a block diagram illustrating a pipeline steam leak detection device according to an exemplary embodiment.

[0110] Figure 7 This is a block diagram illustrating an electronic device according to an exemplary embodiment. Detailed Implementation

[0111] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims. It should be understood that the specific embodiments described herein are for illustrative and explanatory purposes only and are not intended to limit the scope of this disclosure.

[0112] The present disclosure will now be described in conjunction with specific embodiments.

[0113] Figure 1 This is a flowchart illustrating a method for detecting steam leakage in a pipeline according to an exemplary embodiment, such as... Figure 1 As shown, the method may include the following steps:

[0114] In step S101, a video image of the pipe under test is acquired, and multiple frames of the test image are determined from the video image.

[0115] For example, the video image can be acquired by an image acquisition device (e.g., a camera) of the pipe under test. After acquiring the video image, multiple frames of the image under test can be determined from the video image (e.g., the number of the images under test can be 100 frames).

[0116] In step S102, the RGB pixel value of each pixel in the image to be tested is obtained.

[0117] For example, each of the above-mentioned test images may include M×N pixels, and each pixel includes 3 RGB pixel values, which respectively represent the brightness of red (R), green (G) and blue (B) in the three primary colors corresponding to the pixel.

[0118] In step S103, the first undetermined steam pixel region corresponding to each frame of the test image is determined based on the RGB pixel value of each pixel in the multi-frame test image.

[0119] The first undetermined steam pixel region represents the first suspected steam leak area in the image under test, and includes multiple pixels.

[0120] In step S104, a preset number of second undetermined steam pixel regions are determined based on the multiple first undetermined steam pixel regions corresponding to the multiple frames of images to be tested.

[0121] In some embodiments, the number of test images can be 100 frames, and the preset number can be 10. In some possible implementations, the test images can be divided into a preset number of groups (e.g., 10 groups), and a second undetermined steam pixel region corresponding to each group of test images is determined based on multiple first undetermined steam pixel regions corresponding to the test images in each group. The second undetermined steam pixel region represents a second suspected steam leak region determined based on multiple first suspected steam leak regions corresponding to the test images in the group.

[0122] In step S105, the presence of steam leakage in the pipeline under test is determined based on the preset number of second undetermined steam pixel regions.

[0123] The above-mentioned method can accurately detect pipeline steam leaks using video images of the pipeline under test, without the need to build a training dataset, thus reducing the detection cost of pipeline steam leaks.

[0124] Figure 2 This is a flowchart illustrating another method for detecting pipeline steam leaks according to an exemplary embodiment, such as... Figure 2 As shown, step S103 may include the following steps:

[0125] In step S1031, the historical test image corresponding to each frame of the test image is determined from the video images according to the specified step size.

[0126] For example, the specified step size can be 10 frames. In the case that the image to be tested is the nth frame of a video image, the historical image to be tested corresponding to the image to be tested is the (n-10)th frame of the video image.

[0127] In step S1032, the first undetermined steam pixel region corresponding to the test image is determined based on the first RGB pixel value of each pixel in each frame of the test image and the second RGB pixel value of each pixel in the historical test image corresponding to the test image, so as to obtain the first undetermined steam pixel region corresponding to each frame of the test image.

[0128] In some embodiments, for each frame of the image to be tested, the first undetermined vapor pixel region corresponding to each frame of the image to be tested can be obtained by the following steps.

[0129] Step 11: Determine the first undetermined pixel point based on the first RGB pixel value and the corresponding second RGB pixel value.

[0130] Among them, the difference between the first RGB pixel value and the second RGB pixel value of the first undetermined pixel is within the preset color change threshold range, and the gradient between the first undetermined pixel and its neighboring pixels is within the preset gradient threshold range. The difference between the maximum and minimum values ​​of the first RGB pixel values ​​is within the preset difference range. The gradient represents the difference between the third RGB pixel value and the fourth RGB pixel value of the first undetermined pixel. The third RGB pixel value represents the maximum value among the minimum RGB pixel values ​​of each neighboring pixel, and the fourth RGB pixel value represents the minimum value among the minimum RGB pixel values ​​of each neighboring pixel.

[0131] In some possible implementations, under the condition that the difference between the first RGB pixel value and the second RGB pixel value of the pixel point is within the preset color change threshold range, the following formula is satisfied.

[0132] (Formula 1)

[0133] in, For the j-th first RGB pixel value, Let j be the value of the j-th second RGB pixel, where j = 0~2, representing the three RGB pixel values ​​corresponding to each pixel. This is the preset minimum color change threshold. This is a preset maximum color variation threshold. In this way, by comparing the first RGB pixel value and the second RGB pixel value, pixels that do not change much in the image under test and historical images under test (such as unchanged background images) can be excluded, as can the influence of random factors in the image under test (such as flying birds).

[0134] In the image to be tested, each pixel can include up to 8 neighboring pixels. Each neighboring pixel includes three RGB pixel values. Under the condition of satisfying the following Formula 2, it is determined that the gradient of the pixel with its neighboring pixels is within the preset gradient threshold range.

[0135] (Formula 2)

[0136] in, This represents the minimum value among the three RGB pixel values ​​of the i-th neighboring pixel. This represents the gradient of that pixel. The preset minimum gradient threshold, This is the preset maximum gradient threshold.

[0137] In some possible implementations, under the condition that Formula 3 is satisfied, the difference between the maximum and minimum values ​​of the first RGB pixel values ​​of the pixel is determined to be within a preset difference range.

[0138] (Formula 3)

[0139] in, The preset difference threshold, It is the j-th RGB pixel value of this pixel, where j = 0~2.

[0140] Step 12: For each first undetermined pixel, if the number of first undetermined pixels within a preset first neighborhood range is greater than or equal to a preset threshold for the number of first neighborhood pixels, then the first undetermined pixel is determined as a second undetermined pixel.

[0141] In some possible implementations, the first neighborhood range can be determined based on a rectangle of a preset size (in pixels) centered on the first undetermined pixel. This first neighborhood range may not include the first undetermined pixel. If the number of first undetermined pixels within the preset first neighborhood range is greater than or equal to a preset threshold for the number of first neighboring pixels, the first undetermined pixel is determined as a second undetermined pixel. This removes relatively isolated pixels from the first undetermined pixel range, further improving the detection accuracy of pipeline steam leaks.

[0142] Step 13: According to the preset first region growth rule, use the region growth algorithm to determine the first growth point value of each second undetermined pixel.

[0143] Among them, the region growth algorithm is a region-based image segmentation algorithm. Region growth can continuously combine pixels or small regions into larger regions according to predefined growth rules.

[0144] In some possible implementations, the growth direction of the region growing algorithm can be one of the four directions: up, down, left, and right of the second undetermined pixel, and the growth area of ​​each second undetermined pixel is smaller than a preset region growth range threshold (excluding the second undetermined pixel). The first region growing rule may include the difference between the RGB pixel values ​​of the growth point (i.e., the second undetermined pixel within the growth area of ​​the second undetermined pixel) and the seed point (i.e., the second undetermined pixel) being less than a preset first growth difference threshold.

[0145] It should be noted that, unless otherwise specified, the differences between RGB pixel values ​​in this application are all absolute values ​​of the differences.

[0146] After completing the region growing algorithm for the second undetermined pixel, the number of successfully grown points can be used as the first growth point value for the second undetermined pixel.

[0147] For a detailed description of the specific region growing algorithm, please refer to the descriptions in the relevant technical documents; it will not be repeated here.

[0148] Step 14: Take the first growth point value and the RGB pixel value of each second undetermined pixel in each frame of the image to be tested as the first undetermined vapor pixel region.

[0149] For example, the first undetermined vapor pixel region includes a plurality of second undetermined pixels, each second undetermined pixel including RGB pixel values ​​and a first growth point value.

[0150] The above-mentioned method can accurately detect pipeline steam leaks using video images of the pipeline under test, without the need to build a training dataset, thus reducing the detection cost of pipeline steam leaks.

[0151] Figure 3 This is a flowchart illustrating yet another method for detecting pipeline steam leakage according to an exemplary embodiment, such as... Figure 3 As shown, step S104 may include the following steps:

[0152] In step S1041, for each pixel in each first undetermined steam pixel region, the first growth point sum value of the pixel in the preset second neighborhood range is obtained. If the first growth point sum value is within the preset sum value threshold range, the pixel in the first undetermined steam pixel region is determined as the third undetermined pixel.

[0153] In some possible implementations, the second neighborhood range can be determined based on a rectangle of a preset size (the unit can be the number of pixels) centered on the pixel. The second neighborhood range may not include the pixel. The size of the second neighborhood range may be the same as or different from the size of the first neighborhood range, and this disclosure does not limit this.

[0154] In some possible implementations, the pixel in the first undetermined vapor pixel region is determined as the third undetermined pixel if the following formula four is satisfied.

[0155] (Formula 4)

[0156] in, is the first growth point value of the i-th pixel within the second neighborhood, and m is the number of pixels within the second neighborhood. The first growth point and value, This is the preset threshold for the number of successful growth points.

[0157] In step S1042, the multiple frames of images to be tested are divided into multiple groups of images to be tested. For each third undetermined pixel in each group of images to be tested, the second growth point and value of the multiple first growth point values ​​corresponding to the third undetermined pixel in the group of images to be tested are obtained. Based on the second growth point and value, one or more first circumscribed regions including the third undetermined pixel are determined. The third undetermined pixel in the first circumscribed region of any image to be tested in each group of images to be tested is taken as the fourth undetermined pixel corresponding to the group of images to be tested.

[0158] Wherein, the area of ​​the first outer region is greater than or equal to the area threshold of the first preset region.

[0159] For example, if the number of test images is 100, the test images can be divided into 10 groups of test images, with each group containing 10 frames.

[0160] In some possible implementations, the second growth point and value can be determined using the following formula five.

[0161] (Formula 5)

[0162] in, Let be the first growth point value of the i-th third undetermined pixel in the k-th image of the test group, and n be the number of images in the test group. Let be the second growth point and value of the i-th third undetermined pixel in the set of images to be tested.

[0163] In some embodiments, a second growth point and value map can be generated based on the positions of the second growth point and value and the corresponding third undetermined pixel. One or more first bounding regions of the third undetermined pixel can then be obtained from the second growth point and value map. In some possible implementations, one or more first bounding regions can be extracted from the second growth point and value map using the findcontours function in OpenCV (Open Source Computer Vision Library). Specific technical solutions can be found in the technical descriptions of related technologies, and will not be elaborated upon here.

[0164] After obtaining one or more first bounding regions of the third undetermined pixel, the third undetermined pixel in the first bounding region of any image in each group of test images is taken as the fourth undetermined pixel corresponding to that group of test images. For example, the group of test images includes 10 test images. Any one of the 10 test images, such as the 10th test image, can be obtained. The third undetermined pixel in one or more first bounding regions can be taken as the fourth undetermined pixel. Then, based on the position of the fourth undetermined pixel, the RGB pixel value corresponding to each fourth undetermined pixel on the 10th test image is obtained.

[0165] In step S1043, for each fourth undetermined pixel, if the number of fourth undetermined pixels within the preset third neighborhood is greater than or equal to the preset number of second neighborhood pixels, the fourth undetermined pixel is determined as the fifth undetermined pixel.

[0166] In some possible implementations, the third neighborhood range can be determined based on a rectangle of a preset size (in pixels) centered on the fourth undetermined pixel. This third neighborhood range may not include the fourth undetermined pixel. If the number of fourth undetermined pixels within the preset third neighborhood range is greater than or equal to a preset threshold for the number of pixels in the second neighborhood, the fourth undetermined pixel is determined as the fifth undetermined pixel. This removes relatively isolated pixels from the fourth undetermined pixel range, further improving the detection accuracy of pipeline steam leaks. The size of the third neighborhood range can be the same as or different from the size of the first neighborhood range, and the size of the third neighborhood range can be the same as or different from the size of the second neighborhood range; this disclosure does not impose any limitations on this comparison.

[0167] In step S1044, the second growth point value of each fifth undetermined pixel is determined by a region growth algorithm according to the preset second region growth rule.

[0168] In some possible implementations, the growth direction of the region growing algorithm is the four directions of up, down, left, and right of the fifth undetermined pixel, and the growth area of ​​each fifth undetermined pixel is smaller than a preset region growth range threshold (excluding the fifth undetermined pixel). The second region growing rule may include the difference between the RGB pixel values ​​of the growth point (i.e., the fifth undetermined pixel within the growth area of ​​the fifth undetermined pixel) and the seed point (i.e., the fifth undetermined pixel) being less than a preset second growth difference threshold.

[0169] In step S1045, the second growth point value and the RGB pixel value of each fifth undetermined pixel point are used as the second undetermined vapor pixel region corresponding to each group of test images.

[0170] For example, each group of images to be tested (e.g., 10) corresponds to a second undetermined vapor pixel region, which includes multiple fifth undetermined pixels, each of which includes RGB pixel values ​​and a second growth point value.

[0171] The above-mentioned method can accurately detect pipeline steam leaks using video images of the pipeline under test, without the need to build a training dataset, thus reducing the detection cost of pipeline steam leaks.

[0172] Figure 4 This is a flowchart illustrating yet another method for detecting pipeline steam leakage according to an exemplary embodiment, such as... Figure 4 As shown, step S105 may include the following steps:

[0173] In step S1051, the reference steam pixel region corresponding to the image to be tested is obtained based on the RGB pixel value of each of the preset number of second undetermined steam pixel regions and the corresponding growth point value.

[0174] In some embodiments, the reference steam image region corresponding to the image to be tested can be obtained through the following steps.

[0175] Step 21: For each pixel in the second undetermined steam pixel region, if the number of pixels in the fourth neighborhood is greater than or equal to the preset threshold range of the number of pixels in the third neighborhood, the pixel in the second undetermined steam pixel region is determined as the sixth undetermined pixel.

[0176] In some possible implementations, the fourth neighborhood range can be determined based on a rectangle of a preset size (in pixels) centered on the pixel. This fourth neighborhood range may not include the pixel. If the number of pixels within the preset fourth neighborhood range is greater than or equal to a preset threshold for the number of pixels in the third neighborhood, the pixel is determined as the sixth undetermined pixel. This removes relatively isolated pixels from the second undetermined steam pixel region, further improving the detection accuracy of steam leaks. The size of the fourth neighborhood range can be the same as any one of the sizes of the first, second, and third neighborhood ranges, or it can be different from all three. This disclosure does not impose any limitations on this.

[0177] Step 22: Obtain the third growth point and value of each sixth undetermined pixel in different second undetermined vapor pixel regions.

[0178] In some possible implementations, the third growth point and value can be determined using the following formula six.

[0179] (Formula 6)

[0180] in, Let l be the growth point value of the i-th sixth undetermined pixel in the k-th second undetermined steam pixel region, and l be the number of second undetermined steam pixel regions. Let be the third growth point and value of the i-th sixth undetermined pixel in multiple second undetermined vapor pixel regions.

[0181] Step 23: Based on the third growth point and value, determine one or more second outer regions including the sixth undetermined pixel point, and determine the reference vapor pixel region from the second outer region. The area of ​​the reference vapor pixel region is greater than or equal to the second preset region area threshold.

[0182] In some embodiments, a third growth point and value map can be generated based on the position of the third growth point and value and the corresponding sixth undetermined pixel. One or more second bounding regions of the sixth undetermined pixel can then be obtained from this map. In some possible implementations, one or more second bounding regions can be extracted from the third growth point and value map using the findcontours function in OpenCV (Open Source Computer Vision Library). Specific technical solutions can be found in the technical descriptions of related technologies, and will not be elaborated upon here.

[0183] In some possible implementations, the largest second bounding region among one or more second bounding regions can be used as the target bounding region, and the pixel of any second undetermined steam pixel region within the target bounding region can be used as the pixel of the reference steam pixel region. For example, if there are 100 frames of images to be tested, they can be divided into 10 groups of images, each group containing 10 frames. Each group corresponds to one second undetermined steam pixel region, and the multiple frames of images include a total of 10 second undetermined steam pixel regions. The pixel of any second undetermined steam pixel region (e.g., the 10th) within the target bounding region can be used as the pixel of the reference steam pixel region.

[0184] In step S1052, the reference steam pixel area is calibrated to determine whether there is a steam leak in the pipe under test.

[0185] In some embodiments, the target vapor pixel region can be obtained through the following steps.

[0186] Step 31: Determine the multi-frame calibration image from the video image after the multi-frame test image.

[0187] For example, the video image can be acquired by an image acquisition device (e.g., a camera) of the pipe under test. After determining multiple frames of the image under test from the video image, multiple frames of calibration images can be acquired.

[0188] Step 32: Obtain the RGB pixel value of each pixel in the calibration image.

[0189] For example, each of the above calibration images may include M×N pixels, and each pixel includes 3 RGB pixel values, which respectively represent the brightness of red (R), green (G) and blue (B) in the three primary colors corresponding to the pixel.

[0190] Step 33: Determine the first calibration vapor pixel region corresponding to each frame of calibration image based on the RGB pixel value of each pixel in the multi-frame calibration image.

[0191] For example, the first calibration vapor pixel region corresponding to each frame of calibration image can be determined by referring to step S103, which will not be elaborated here.

[0192] Step 34: Determine multiple second calibration vapor pixel regions based on multiple first calibration vapor pixel regions corresponding to multiple frames of calibration images.

[0193] For example, referring to step S104, multiple second calibration vapor pixel regions can be determined based on multiple first calibration vapor pixel regions corresponding to the multiple frame calibration images, which will not be elaborated here.

[0194] Step 35: According to the preset calibration sequence, calibrate the reference steam pixel area based on multiple second calibration steam pixel areas to determine whether there is a steam leak in the pipeline under test.

[0195] Figure 5 This is a flowchart illustrating yet another method for detecting pipeline steam leakage according to an exemplary embodiment, such as... Figure 5 As shown, step 35 may include the following sub-steps:

[0196] In step s1, the current second calibration vapor pixel region is determined according to the preset calibration sequence.

[0197] For example, the preset calibration order can be based on the chronological order of the calibration images corresponding to the second calibration vapor pixel region.

[0198] In step s2, the cross-over ratio of the current second calibration vapor pixel region and the reference vapor pixel region is obtained.

[0199] Wherein, the intersection-union ratio is the ratio of the target intersection and the target union. The target intersection is the intersection of the current second calibration vapor pixel region and the reference vapor pixel region (the unit can be the number of pixels). The target union is the union of the current second calibration vapor pixel region and the reference vapor pixel region (the unit can be the number of pixels). If the current second calibration vapor pixel region is a preset null value (i.e., the current second calibration vapor pixel region is determined to be unqualified), then the intersection-union ratio can be a preset default value (e.g., -1).

[0200] In step s3, if the cross-union ratio is greater than the preset first cross-union ratio threshold, the current second calibration vapor pixel region is used as the reference vapor pixel region.

[0201] In some possible implementations, the reference vapor pixel region is updated by using the current second calibration vapor pixel region as the new reference vapor pixel region.

[0202] In step s4, the cross-union ratio count and the mean cross-union ratio are updated based on the cross-union ratio.

[0203] Among them, the mean crossover ratio represents the arithmetic mean of the crossover ratios of multiple calibrated second calibration vapor pixel regions with the reference vapor pixel region, and the crossover ratio count represents the number of multiple calibrated second calibration vapor pixel regions.

[0204] In step s5, it is determined whether the presence or absence of steam leakage in the pipeline under test has been determined based on the number of cross-comparison ratios and the average cross-comparison ratio.

[0205] In some embodiments, the presence of steam leakage in the pipeline under test can be determined by the number of cross-combination ratios and the average cross-combination ratio as follows.

[0206] Method 1: If the number of cross-comparison ratios exceeds a preset first threshold and the average cross-comparison ratio is less than a second threshold, then it is determined that there is no steam leakage in the pipeline under test. Alternatively,

[0207] Method 2: If the number of cross-parallel ratios is greater than the preset second cross-parallel ratio threshold and the average cross-parallel ratio is greater than the third cross-parallel ratio threshold, it is determined that the pipeline under test has a steam leak.

[0208] In another embodiment, if a steam leak is determined in the pipe under test, a reference steam pixel area is used as the target steam pixel area. In some possible implementations, after determining that a steam leak exists in the pipe under test, the target steam pixel area can be displayed on the video image, and a steam leak alarm can be issued to the user, further improving the user experience of the pipe steam leak detection method.

[0209] In step s6, if the target steam pixel area is not obtained and it is not determined that the target steam pixel area is a preset null value, the next second calibration steam pixel area is taken as the new current second calibration steam pixel area according to the preset calibration order. The process of obtaining the cross-connection ratio of the current second calibration steam pixel area and the reference steam pixel area is repeated. If the cross-connection ratio is greater than the preset first cross-connection ratio threshold, the current second calibration steam pixel area is taken as the reference steam pixel area and the cross-connection ratio is updated according to the cross-connection ratio. The process continues until it is determined whether there is a steam leak in the pipeline under test based on the cross-connection ratio count and the cross-connection ratio average.

[0210] The above-mentioned method can accurately detect pipeline steam leaks using video images of the pipeline under test, without the need to build a training dataset, thus reducing the detection cost of pipeline steam leaks.

[0211] Figure 6 This is a block diagram illustrating a pipeline steam leak detection device according to an exemplary embodiment, such as... Figure 6 As shown, the pipeline steam leak detection device 600 includes:

[0212] The first acquisition module 601 is configured to acquire video images of the pipeline under test and determine multiple frames of images under test from the video images;

[0213] The second acquisition module 602 is configured to acquire the RGB pixel value of each pixel in the image to be tested;

[0214] The first determining module 603 is configured to determine the first undetermined steam pixel region corresponding to each frame of the image under test based on the RGB pixel value of each pixel in the multi-frame image under test.

[0215] The second determining module 604 is configured to determine a preset number of second undetermined steam pixel regions based on multiple first undetermined steam pixel regions corresponding to multiple frames of images to be tested.

[0216] The detection module 605 is configured to determine whether there is a steam leak in the pipeline under test based on the preset number of second undetermined steam pixel regions.

[0217] Optionally, the first determining module 603 is also configured to:

[0218] Determine the historical images to be tested corresponding to each frame of the image to be tested from the video images according to the specified step size;

[0219] The first undetermined steam pixel region corresponding to the test image is determined based on the first RGB pixel value of each pixel in each frame of the test image and the second RGB pixel value of each pixel in the corresponding historical test image, so as to obtain the first undetermined steam pixel region corresponding to each frame of the test image.

[0220] Optionally, the first determining module 603 is also configured to:

[0221] For each frame of the image to be tested, a first undetermined pixel is determined based on the first RGB pixel value and the corresponding second RGB pixel value. The difference between the first RGB pixel value and the second RGB pixel value of the first undetermined pixel is within a preset color change threshold range, and the gradient between the first undetermined pixel and its neighboring pixels is within a preset gradient threshold range. The difference between the maximum and minimum values ​​of the first RGB pixel values ​​is within a preset difference range. The gradient represents the difference between the third RGB pixel value and the fourth RGB pixel value of the first undetermined pixel. The third RGB pixel value represents the maximum value among the minimum RGB pixel values ​​of each neighboring pixel, and the fourth RGB pixel value represents the minimum value among the minimum RGB pixel values ​​of each neighboring pixel.

[0222] For each first undetermined pixel, if the number of first undetermined pixels within a preset first neighborhood is greater than or equal to a preset threshold for the number of first neighborhood pixels, then the first undetermined pixel is determined to be a second undetermined pixel.

[0223] According to the preset first region growth rule, the first growth point value of each second undetermined pixel is determined by the region growth algorithm;

[0224] The first growth point value and the RGB pixel value of each second undetermined pixel in each frame of the image to be tested are used as the first undetermined vapor pixel region.

[0225] Optionally, the second determining module 604 is also configured to:

[0226] For each pixel in each first undetermined steam pixel region, the first growth point sum value of the pixels in the preset second neighborhood range is obtained. If the first growth point sum value is within the preset sum value threshold range, the pixel in the first undetermined steam pixel region is determined as the third undetermined pixel.

[0227] The multiple frames of images to be tested are divided into multiple groups of images to be tested. For each third undetermined pixel in each group of images to be tested, the second growth point and value of the multiple first growth point values ​​corresponding to the third undetermined pixel in the group of images to be tested are obtained. One or more first circumscribed regions including the third undetermined pixel are determined according to the second growth point and value. The third undetermined pixel in the first circumscribed region of any image to be tested in each group of images to be tested is taken as the fourth undetermined pixel corresponding to the group of images to be tested. The area of ​​the first circumscribed region is greater than or equal to the first preset area threshold.

[0228] For each fourth undetermined pixel, if the number of fourth undetermined pixels within the preset third neighborhood is greater than or equal to the preset number of second neighborhood pixels, the fourth undetermined pixel is determined as the fifth undetermined pixel.

[0229] According to the preset second region growth rule, the second growth point value of each fifth undetermined pixel is determined by the region growth algorithm;

[0230] The second growth point value and the RGB pixel value of each fifth undetermined pixel point are used as the second undetermined vapor pixel region corresponding to each group of test images.

[0231] Optionally, the detection module 605 is also configured to:

[0232] Based on the RGB pixel value of each RGB pixel in the second undetermined vapor pixel region and the corresponding growth point value, obtain the reference vapor pixel region corresponding to the image under test;

[0233] The reference steam pixel area is calibrated to determine whether there is a steam leak in the pipeline under test.

[0234] Optionally, the detection module 605 is also configured to:

[0235] For each pixel in the second undetermined steam pixel region, if the number of pixels in the fourth neighboring region is greater than or equal to the preset threshold range of the number of pixels in the third neighboring region, the pixel in the second undetermined steam pixel region is determined as the sixth undetermined pixel.

[0236] Obtain the third growth point sum value for each sixth undetermined pixel in different second undetermined vapor pixel regions;

[0237] Based on the third growth point and value, one or more second outer regions including the sixth undetermined pixel are determined, and a reference vapor pixel region is determined from the second outer regions. The area of ​​the reference vapor pixel region is greater than or equal to the area threshold of the second preset region.

[0238] Optionally, the detection module 605 is also configured to:

[0239] Determine multiple calibration images from multiple frames of test images in a video image;

[0240] Obtain the RGB pixel value of each pixel in the calibration image;

[0241] The first calibration vapor pixel region corresponding to each frame of calibration image is determined based on the RGB pixel value of each pixel in the multi-frame calibration image.

[0242] Multiple second calibration vapor pixel regions are determined based on multiple first calibration vapor pixel regions corresponding to multiple frames of calibration images;

[0243] According to the preset calibration sequence, the reference steam pixel area is calibrated based on multiple second calibration steam pixel areas to determine whether there is a steam leak in the pipeline under test.

[0244] Optionally, the detection module 605 is also configured to:

[0245] The current second calibration vapor pixel region is determined according to the preset calibration sequence;

[0246] Obtain the cross-union ratio of the current second calibration vapor pixel region and the reference vapor pixel region;

[0247] If the cross-union ratio is greater than the preset first cross-union ratio threshold, the current second calibration vapor pixel region is taken as the reference vapor pixel region;

[0248] The cross-union ratio (CUNR) is updated based on the cross-union ratio (CUNR) count and the CUNR mean. The CUNR mean represents the average cross-union ratio of the multiple calibrated second calibration vapor pixel regions with the reference vapor pixel region, and the CUNR count represents the number of multiple calibrated second calibration vapor pixel regions.

[0249] According to the preset calibration sequence, the next second calibration steam pixel area is taken as the new current second calibration steam pixel area. The process of obtaining the cross-connection ratio of the current second calibration steam pixel area and the reference steam pixel area is repeated. If the cross-connection ratio is greater than the preset first cross-connection ratio threshold, the current second calibration steam pixel area is taken as the reference steam pixel area. The steps of updating the cross-connection ratio count and the cross-connection ratio mean are repeated until it is determined whether there is a steam leak in the pipeline under test based on the cross-connection ratio count and the cross-connection ratio mean.

[0250] Optionally, the detection module 605 is also configured to:

[0251] If the number of cross-connection ratios is greater than a preset first cross-connection ratio threshold and the average cross-connection ratio is less than a second cross-connection ratio threshold, it is determined that there is no steam leakage in the pipeline under test.

[0252] Optionally, the detection module 605 is also configured to:

[0253] If the number of cross-connection ratios is greater than a preset second cross-connection ratio threshold, and the average cross-connection ratio is greater than a third cross-connection ratio threshold, it is determined that the pipeline under test has a steam leak.

[0254] Optionally, the detection module 605 is also configured to:

[0255] If it is determined that there is a steam leak in the pipeline under test, the reference steam pixel area is used as the target steam pixel area.

[0256] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0257] The above-mentioned method can accurately detect pipeline steam leaks using video images of the pipeline under test, without the need to build a training dataset, thus reducing the detection cost of pipeline steam leaks.

[0258] Figure 7 This is a block diagram illustrating an electronic device 700 according to an exemplary embodiment. Figure 7 As shown, the electronic device 700 may include a processor 701 and a memory 702. The electronic device 700 may also include one or more of a multimedia component 703, an input / output interface 704, and a communication component 705.

[0259] The processor 701 controls the overall operation of the electronic device 700 to complete all or part of the steps in the aforementioned method for detecting pipeline steam leaks. The memory 702 stores various types of data to support the operation of the electronic device 700. This data may include, for example, instructions for any application or method operating on the electronic device 700, and application-related data such as contact data, sent and received messages, images, audio, video, etc. The memory 702 can be implemented using any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The multimedia component 703 may include a screen and audio components. The screen may be, for example, a touchscreen, and the audio component is used for outputting and / or inputting audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signals may be further stored in memory 702 or transmitted via communication component 705. The audio component also includes at least one speaker for outputting audio signals. Input / output interface 704 provides an interface between processor 701 and other interface modules, such as a keyboard, mouse, buttons, etc. These buttons may be virtual or physical buttons. Communication component 705 is used for wired or wireless communication between the electronic device 700 and other devices. Wireless communication, such as Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 3G, 4G, NB-IoT, eMTC, or other 5G technologies, or combinations thereof, is not limited here. Therefore, the corresponding communication component 705 may include: a Wi-Fi module, a Bluetooth module, an NFC module, etc.

[0260] In another exemplary embodiment, a non-transitory computer-readable storage medium including program instructions is also provided, which, when executed by a processor, implement the steps of the above-described method for detecting pipe steam leaks. For example, the computer-readable storage medium may be the memory including the program instructions described above, which can be executed by a processor of an electronic device to perform the above-described method for detecting pipe steam leaks.

[0261] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of this disclosure. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the following claims.

[0262] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.

Claims

1. A method for detecting steam leakage in pipelines, characterized in that, The method includes: Acquire video images of the pipe under test, and determine multiple frames of the test image from the video images; Obtain the RGB pixel value of each pixel in the image to be tested; The first undetermined steam pixel region corresponding to each frame of the test image is determined based on the RGB pixel value of each pixel in the multi-frame test image. A preset number of second undetermined steam pixel regions are determined based on the multiple first undetermined steam pixel regions corresponding to the multiple frames of images to be tested. The presence of steam leakage in the pipeline under test is determined based on the preset number of second undetermined steam pixel regions. The step of determining the first undetermined steam pixel region corresponding to each frame of the test image based on the RGB pixel values ​​of each pixel in the multi-frame test image includes: Based on a specified step size, determine the historical images to be tested corresponding to each frame of the image to be tested from the video images; Based on the first RGB pixel value of each pixel in the image to be tested in each frame and the second RGB pixel value of each pixel in the historical image to be tested corresponding to the image to be tested, the first undetermined steam pixel region corresponding to the image to be tested is determined, so as to obtain the first undetermined steam pixel region corresponding to each frame of the image to be tested. The step of determining the first undetermined steam pixel region corresponding to the test image based on the first RGB pixel value of each pixel in each frame of the test image and the second RGB pixel value of each pixel in the corresponding historical test image, to obtain the first undetermined steam pixel region corresponding to each frame of the test image, includes: For each frame of the image to be tested, a first undetermined pixel is determined based on the first RGB pixel value and the corresponding second RGB pixel value. The difference between the first RGB pixel value and the second RGB pixel value of the first undetermined pixel is within a preset color change threshold range, and the gradient between the first undetermined pixel and its neighboring pixels is within a preset gradient threshold range. The difference between the maximum and minimum values ​​of the first RGB pixel values ​​is within a preset difference range. The gradient represents the difference between the third RGB pixel value and the fourth RGB pixel value of the first undetermined pixel. The third RGB pixel value represents the maximum value among the minimum RGB pixel values ​​of each of the neighboring pixels, and the fourth RGB pixel value represents the minimum value among the minimum RGB pixel values ​​of each of the neighboring pixels. For each first undetermined pixel, if the number of first undetermined pixels within a preset first neighborhood range is greater than or equal to a preset threshold for the number of first neighborhood pixels, the first undetermined pixel is determined to be a second undetermined pixel. According to the preset first region growth rule, the first growth point value of each second undetermined pixel is determined by the region growth algorithm; the first region growth rule includes that the difference between the RGB pixel value of the second undetermined pixel and the second undetermined pixel in the growth region of the second undetermined pixel is less than the preset first growth difference threshold. The first growth point value and the RGB pixel value of each second undetermined pixel in each frame of the image to be tested are used as the first undetermined steam pixel region.

2. The method according to claim 1, characterized in that, The step of determining a preset number of second undetermined steam pixel regions based on the multiple first undetermined steam pixel regions corresponding to the multiple frames of images to be tested includes: For each pixel in each of the first undetermined steam pixel regions, the first growth point sum value of the pixels in the preset second neighborhood range is obtained. If the first growth point sum value is within the preset sum value threshold range, the pixel in the first undetermined steam pixel region is determined as the third undetermined pixel. The multiple frames of images to be tested are divided into multiple groups of images to be tested. For each third undetermined pixel in each group of images to be tested, the second growth point and value corresponding to the multiple first growth point values ​​in the group of images to be tested are obtained. Based on the second growth point and value, one or more first circumscribed regions including the third undetermined pixel are determined. The third undetermined pixel in any image to be tested in the first circumscribed region in each group of images to be tested is taken as the fourth undetermined pixel corresponding to the group of images to be tested. The area of ​​the first circumscribed region is greater than or equal to a first preset area threshold. For each of the fourth undetermined pixels, if the number of fourth undetermined pixels within a preset third neighborhood is greater than or equal to the number of preset second neighborhood pixels, the fourth undetermined pixel is determined to be the fifth undetermined pixel. According to the preset second region growth rule, the region growth algorithm is used to determine the second growth point value of each of the fifth undetermined pixels; The second growth point value and the RGB pixel value of each fifth undetermined pixel are used as the second undetermined steam pixel region corresponding to each group of images to be tested.

3. The method according to claim 1, characterized in that, The step of determining whether the pipeline under test has a steam leak based on the preset number of second undetermined steam pixel regions includes: Based on the preset number of RGB pixel values ​​and corresponding growth point values ​​in the second undetermined steam pixel regions, the reference steam pixel region corresponding to the image under test is obtained; The reference steam pixel area is calibrated to determine whether there is a steam leak in the pipeline under test.

4. The method according to claim 3, characterized in that, The step of obtaining the reference steam pixel region corresponding to the image under test based on the RGB pixel value and the corresponding growth point value of each of the preset number of second undetermined steam pixel regions includes: For each pixel in the second undetermined steam pixel region, if the number of pixels in the fourth neighborhood range is greater than or equal to the preset threshold range of the number of pixels in the third neighborhood range, the pixel in the second undetermined steam pixel region is determined as the sixth undetermined pixel. Obtain the third growth point sum value for each of the sixth undetermined pixels in different second undetermined vapor pixel regions; Based on the third growth point and value, one or more second outer regions including the sixth undetermined pixel are determined, and the reference vapor pixel region is determined from the second outer region, wherein the area of ​​the reference vapor pixel region is greater than or equal to the area threshold of the second preset region.

5. The method according to claim 3, characterized in that, The calibration of the reference steam pixel area to determine whether there is a steam leak in the pipe under test includes: Determine multiple calibration images from the video images following the multiple frames of images to be tested; Obtain the RGB pixel value of each pixel in the calibration image; The first calibration vapor pixel region corresponding to each frame of calibration image is determined based on the RGB pixel value of each pixel in the multi-frame calibration image; Multiple second calibration vapor pixel regions are determined based on multiple first calibration vapor pixel regions corresponding to the multiple frames of calibration images; According to a preset calibration sequence, the reference steam pixel area is calibrated based on multiple second calibration steam pixel areas to determine whether there is a steam leak in the pipeline under test.

6. The method according to claim 5, characterized in that, The step of calibrating the reference steam pixel region according to a preset calibration sequence based on multiple second calibration steam pixel regions to determine whether the pipeline under test has a steam leak includes: The current second calibration vapor pixel region is determined according to the preset calibration sequence; Obtain the cross-over ratio (COP) of the current second calibration vapor pixel region and the reference vapor pixel region; If the cross-connection ratio is greater than a preset first cross-connection ratio threshold, the current second calibration vapor pixel region is taken as the reference vapor pixel region; The cross-union ratio is updated based on the cross-union ratio, the cross-union ratio count and the cross-union ratio mean, the cross-union ratio mean represents the average cross-union ratio of the plurality of calibrated second calibration vapor pixel regions with the reference vapor pixel region, and the cross-union ratio count represents the number of the plurality of calibrated second calibration vapor pixel regions; According to the preset calibration order, the next second calibration vapor pixel region is taken as the new current second calibration vapor pixel region. The process of obtaining the intersection-over-union ratio (IoU) of the current second calibration vapor pixel region and the reference vapor pixel region is repeated. If the IoU is greater than a preset first IoU threshold, the current second calibration vapor pixel region is taken as the reference vapor pixel region. The steps of updating the cross-connection ratio count and the average cross-connection ratio based on the cross-connection ratio continue until it is determined whether there is a steam leak in the pipeline under test based on the cross-connection ratio count and the average cross-connection ratio.

7. The method according to claim 6, characterized in that, The step of determining whether the pipeline under test has a steam leak based on the number of cross-combination ratios and the average cross-combination ratio includes: If the number of cross-connection ratios is greater than a preset first cross-connection ratio threshold and the average cross-connection ratio is less than a second cross-connection ratio threshold, it is determined that there is no steam leakage in the pipeline under test.

8. The method according to claim 6, characterized in that, The step of determining whether the pipeline under test has a steam leak based on the number of cross-combination ratios and the average cross-combination ratio includes: If the number of cross-connection ratios is greater than a preset second cross-connection ratio threshold, and the average cross-connection ratio is greater than a third cross-connection ratio threshold, it is determined that the pipeline under test has a steam leak.

9. The method according to any one of claims 6 to 8, characterized in that, The method further includes: If it is determined that there is a steam leak in the pipeline under test, the reference steam pixel area is used as the target steam pixel area.

10. A device for detecting steam leakage in pipelines, characterized in that, The device includes: The first acquisition module is configured to acquire video images of the pipeline under test and determine multiple frames of images under test from the video images; The second acquisition module is configured to acquire the RGB pixel value of each pixel in the image to be tested; The first determining module is configured to determine the first undetermined steam pixel region corresponding to each frame of the test image based on the RGB pixel value of each pixel in the multi-frame test image; The second determining module is configured to determine a preset number of second undetermined steam pixel regions based on the multiple first undetermined steam pixel regions corresponding to the multiple frames of images to be tested. The detection module is configured to determine whether there is a steam leak in the pipeline under test based on the preset number of second undetermined steam pixel regions; The first determining module is specifically configured to determine the historical image to be tested corresponding to each frame of the image to be tested from the video image according to a specified step size; and to determine the first undetermined steam pixel region corresponding to the image to be tested according to the first RGB pixel value of each pixel in each frame of the image to be tested and the second RGB pixel value of each pixel in the historical image to be tested corresponding to the image to be tested, so as to obtain the first undetermined steam pixel region corresponding to each frame of the image to be tested. The first determining module is further configured to, for each frame of the image to be tested, determine a first undetermined pixel based on the first RGB pixel value and the corresponding second RGB pixel value. The difference between the first RGB pixel value and the second RGB pixel value of the first undetermined pixel is within a preset color change threshold range, and the gradient between the first undetermined pixel and its neighboring pixels is within a preset gradient threshold range. The difference between the maximum and minimum values ​​of the first RGB pixel values ​​is within a preset difference range. The gradient represents the difference between the third RGB pixel value and the fourth RGB pixel value of the first undetermined pixel. The third RGB pixel value represents the maximum value among the minimum RGB pixel values ​​of each neighboring pixel, and the fourth RGB pixel value represents the minimum value among the minimum RGB pixel values ​​of each neighboring pixel. For each first undetermined pixel, if the number of first undetermined pixels within a preset first neighborhood range is greater than or equal to a preset threshold for the number of first neighborhood pixels, the first undetermined pixel is determined to be a second undetermined pixel. According to the preset first region growth rule, the first growth point value of each second undetermined pixel is determined by the region growth algorithm; the first region growth rule includes that the difference between the RGB pixel value of the second undetermined pixel and the second undetermined pixel in the growth region of the second undetermined pixel is less than the preset first growth difference threshold. The first growth point value and the RGB pixel value of each second undetermined pixel in each frame of the image to be tested are used as the first undetermined steam pixel region.

11. An electronic device, characterized in that, include: A memory on which computer programs are stored; A processor for executing the computer program in the memory to implement the steps of the method according to any one of claims 1-9.

12. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the program implements the steps of the method described in any one of claims 1-9.