High-precision gas leakage detection method
Through FILR infrared camera and image processing technology, combined with methods such as edge extraction, frame subtraction integration method and adaptive gamma transformation, the problem of difficulty in detecting very small gas leaks with existing technology is solved, and high-precision detection and detection of gas leaks are achieved. Real-time traffic direction monitoring improves the completeness and accuracy of detection.
Patent Information
- Application Number
- CN202410730778.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-06
- Publication Date
- 2024-09-06
AI Technical Summary
Existing gas leak detection methods are difficult to detect leaks of extremely small amounts of dangerous combustible gases, especially leaks below 0.3L/min, and cannot detect gas flow and direction in real time.
Using FILR infrared camera combined with image enhancement and gas area prediction algorithms, the detection of very small gas leaks is achieved through technologies such as edge extraction of infrared video images, frame subtraction integration method, adaptive gamma transformation, hierarchical clustering and grayscale conversion. and real-time traffic and direction monitoring.
It achieves high-precision detection of very small gas leaks, can identify gas leaks at night, detect leaks with small flow rates, determine the flow direction of gas leaks, improves the integrity and accuracy of detection, and is suitable for complex environments.
Smart Images

Figure CN118609050A
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of gas detection, in particular to a high-precision gas leakage detection method. Background Art
[0002] During the use and production of combustible gas, leakage may occur, causing disasters such as fire and explosion, and causing damage to society, people's property and life. From the perspective of public safety management, the monitoring and detection of combustible gas leakage deserves special attention (Aldhafeeri T, Tran MK, Vrolyk R, et al. A review of methane gas detection sensors: Recent developments and future perspectives [J]. Inventions, 2020, 5 (3): 28.).
[0003] Many researchers have been working on the detection of gas leaks and have demonstrated the feasibility of using passive infrared gas imaging systems to detect gases, especially those that are invisible to the naked eye. Thomas (McRae TG, Altpeter LLT. Natural gas leak dispersion studies using an infrared gas-imaging system [C] / / Optical Instrumentation for Gas Emissions Monitoring and Atmospheric Measurements. SPIE, 1995, 2366) used an infrared gas imaging system to conduct natural gas leak analysis. Li Jiakang (Li J, Wang L, Zhang C, et al. Gas cloud infrared image enhancement based on anisotropic diffusion [C] / / Advanced Environmental, Chemical, and Biological Sensing Technologies VIII. SPIE, 2011, 8024: 197-204) considered more factors and established a gas imaging detection model. Wang Meirong (Wang M, Wang L, Li J, et al. Spatial concentration distribution model for short-range continuous gas leakage of small amount [C] / / Thermosense: Thermal Infrared Applications XXXIV. SPIE, 2012, 8354: 351-359) designed a wind tunnel experiment and established a concentration distribution model for short-range continuous gas leakage of small amount. However, it has been verified that the existing methods cannot detect the leakage of very small amounts of dangerous flammable gas, such as 0.3L / minute gas leakage. Summary of the invention
[0004] The purpose of the present invention is to monitor and detect combustible gas using a FILR infrared camera to address the problems of the prior art, propose an image enhancement and gas area prediction algorithm, and use it to analyze the video image captured by the infrared camera. Compared with the existing algorithm, the algorithm can detect the leakage of a smaller amount of gas. At the same time, the present invention can detect the gas flow and direction in real time after the gas area prediction, which is different from the single-frame detection method.
[0005] The technical solution to achieve the purpose of the present invention is: a high-precision gas leakage detection method, the method comprising:
[0006] Step 1, frame the infrared video, and perform edge extraction on the framed image to obtain edge information;
[0007] Step 2, take frames of the infrared video and extract gas information using the frame subtraction integral method;
[0008] Step 3, for the result of the frame subtraction integral method, the contrast is enhanced by adaptive gamma transformation, and the edge information extracted by the edge is used to suppress the noise generated by the edge of the object;
[0009] Step 4, using a hierarchical clustering algorithm to determine the gas location prediction area;
[0010] Step 5: stretch the grayscale level of the gas position prediction area through grayscale conversion, and then extract the real-time gas leakage information through frame subtraction.
[0011] Furthermore, in step 1, the Robert operator is used to perform edge extraction.
[0012] Furthermore, the infrared video is framed in step 2, and the gas information is extracted using the frame subtraction integral method, which specifically includes:
[0013] Step 2-1, initialization, including setting the integration window size and threshold;
[0014] Step 2-2, determining the optimal frame reduction interval;
[0015] Step 2-3, taking frames of the infrared video according to the optimal frame reduction interval;
[0016] Step 2-4, setting a frame subtraction interval, and processing the image in step 2-3 using a frame subtraction integral method to obtain a grayscale integral value within the frame subtraction interval;
[0017] Step 2-5, performing threshold processing on the image by combining the threshold and the grayscale integral value to distinguish gas from background;
[0018] Step 2-6, morphological processing is performed on the image, and then the gas information is determined by connectivity analysis, including gas leakage region and area information.
[0019] Furthermore, the optimal frame reduction interval in step 2-2 is specifically:
[0020]
[0021] Where div is the optimal frame subtraction interval, mean_gas is the average pixel intensity in the marked gas area, and mean_total is the average pixel intensity containing noise information in the marked gas area.
[0022] Furthermore, the formula of the frame subtraction integral method in step 2-4 is:
[0023]
[0024] in, is the result of the frame subtraction integration method, i.e., the image or signal after the frame subtraction integration method, q is the number of integration frames, i.e., the size of the integration window, p is a delay parameter, n is the time point when the current integration starts, I n+r-p and I n+r Represents the signals or images at time n+tp and n+t respectively.
[0025] Furthermore, in step 2-5, the image is thresholded by combining the threshold and the grayscale integral value to distinguish between gas and background. The specific formula is:
[0026]
[0027] Wherein, threshold is the threshold, B(x, y) is the image after threshold processing, 1 represents the motion area, i.e., the gas area, and 0 represents the static background.
[0028] Furthermore, in step 3, the contrast of the frame subtraction integral result is enhanced by adaptive gamma transformation, which specifically includes:
[0029] Step 3-1, calculate the average grayscale of the image:
[0030]
[0031] Where I(i,j) is the grayscale value at the coordinate (i,j) in the image, M and N are the maximum values of the horizontal and vertical coordinates of the image respectively;
[0032] Step 3-2, determine the gamma value γ:
[0033]
[0034] Where C is a preset value used to adjust the sensitivity of gamma value calculation;
[0035] Step 3-3, perform gamma transformation on the image:
[0036]
[0037] Among them, V in is the input value, i.e. the original pixel value of the image, Vout It is the output value, i.e. the pixel value after gamma transformation.
[0038] Furthermore, step 4 specifically uses an agglomerative hierarchical clustering algorithm to determine the gas location area, specifically including:
[0039] Step 4-1, initialization: each data point, i.e., pixel point in the image is considered as an independent cluster;
[0040] Step 4-2, calculate the distance: regard every two clusters as possible cluster pairs, and calculate the distances between all possible cluster pairs to form a distance matrix;
[0041] Step 4-3, merging clusters: merging the two closest clusters into a new cluster;
[0042] Step 4-4, update the distance matrix: update the distance matrix in the same manner as step 4-2;
[0043] Step 4-5, repeating steps 4-2 to 4-4 until all data points are clustered to a preset number of clusters;
[0044] Step 4-6, generate a dendrogram: generate a dendrogram according to the order of cluster merging in the above steps; the area where the information of all data points in the dendrogram is connected in the order of merging is used as the gas position prediction area.
[0045] Furthermore, the distance calculation method in step 4-2 is one or more of minimum distance calculation, maximum distance calculation, average distance and Ward method.
[0046] Furthermore, step 5 specifically includes:
[0047] Step 5-1, calculate the grayscale range of the original image: traverse all pixels in the gas position prediction area in the original image to obtain the maximum grayscale value and the minimum grayscale value;
[0048] Step 5-2, define the target grayscale range: define the required target minimum grayscale value and target maximum grayscale value;
[0049] Step 5-3, calculating the grayscale conversion function: calculating the new grayscale corresponding to each original grayscale by linear difference to obtain the grayscale conversion function;
[0050] Step 5-4, stretching the gray level of the gas position prediction area by a gray conversion function to generate an enhanced image;
[0051] Step 5-5, based on the enhanced image, extract the real-time gas leakage information by frame subtraction, including the gas leakage area and the gas leakage direction.
[0052] Compared with the prior art, the present invention has the following significant advantages:
[0053] (1) Gas leaks can be identified at night, improving the integrity of gas leak detection.
[0054] (2) It can detect gas leaks with a small flow rate and discover gas leaks as early as possible.
[0055] (3) The direction of gas leakage can be detected, making it easier to identify the source of gas leakage.
[0056] (4) The proposed adaptive gamma value transformation can achieve the best enhancement effect on gas images in different environments and backgrounds, thereby enhancing the feasibility and accuracy of the algorithm.
[0057] (5) Combining the frame subtraction method with effective image enhancement methods can improve the accuracy and robustness of target detection and is suitable for target recognition tasks in various complex environments.
[0058] The present invention is further described in detail below in conjunction with the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] Figure 1 FIG. 4 is a flow chart of a high-precision gas leakage detection method in one embodiment.
[0060] Figure 2 The flowchart of edge extraction using the Robert operator in one embodiment is shown.
[0061] Figure 3 FIG. 4 is a flow chart of a frame subtraction method in one embodiment.
[0062] Figure 4 FIG. 4 is a flowchart of an adaptive gamma transform in an embodiment.
[0063] Figure 5 The figure is a flow chart of an agglomerative hierarchical clustering method in one embodiment.
[0064] Figure 6 The figure is a grayscale conversion stretching flowchart in one embodiment.
[0065] Figure 7 FIG. 4 is an infrared image of a gas leakage scene in an embodiment.
[0066] Figure 8 FIG. 4 is an infrared image of a gas leakage scene in an embodiment.
[0067] Fig. 9 FIG. 4 is an infrared image of a gas leakage scene in an embodiment.
[0068] Fig.10 In one embodiment Figure 7The schematic diagram of the leaking gas area is obtained after the infrared image is processed by frame subtraction integral method, Robert edge extraction, adaptive gamma transform and hierarchical clustering method.
[0069] Fig.11 In one embodiment Figure 8 The schematic diagram of the leaking gas area is obtained after the infrared image is processed by frame subtraction integral method, Robert edge extraction, adaptive gamma transform and hierarchical clustering method.
[0070] Fig.12 In one embodiment Fig. 9 The schematic diagram of the leaking gas area is obtained after the infrared image is processed by frame subtraction integral method, Robert edge extraction, adaptive gamma transform and hierarchical clustering method.
[0071] Fig.13 In one embodiment Fig.10 The rendering result obtained by grayscale conversion stretching and frame difference method.
[0072] Fig.14 In one embodiment Fig.11 The rendering result obtained by grayscale conversion stretching and frame difference method.
[0073] Fig.15 In one embodiment Fig.12 The rendering result obtained by grayscale conversion stretching and frame difference method. DETAILED DESCRIPTION
[0074] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0075] It should be noted that if there are descriptions involving "first", "second", etc. in the embodiments of the present invention, the descriptions of "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such a combination of technical solutions does not exist and is not within the scope of protection required by the present invention.
[0076] According to the experiment, it can be found that when the gas flow rate is too low, it is difficult to detect gas leakage through video sequences; when the gas concentration is very high, it is difficult to detect gas leakage through a single image, but the gas leakage phenomenon can be observed through video sequences; when the gas concentration is too high, the natural background will also bring difficulties to gas detection.
[0077] In view of the above problems, in one embodiment, a combustible gas leakage detection method based on infrared images is provided, wherein the gas area is located by using the binary method and the mean shift clustering method, and after the gas area is determined, the gray level of the gas prediction area is stretched by gray conversion, and after the gray conversion is completed, the gas leakage information is extracted by frame subtraction, thereby detecting the gas leakage area and the gas leakage flow direction.
[0078] Combination Figure 1 , the method specifically comprises:
[0079] Step 1, frame the infrared video, and perform edge extraction on the framed image to obtain edge information;
[0080] Step 2, take frames of the infrared video and extract gas information using the frame subtraction integral method;
[0081] Step 3, for the result of the frame subtraction integral method, the contrast is enhanced by adaptive gamma transformation, and the edge information extracted by the edge is used to suppress the noise generated by the edge of the object;
[0082] Step 4, using a hierarchical clustering algorithm to determine the gas location prediction area;
[0083] Step 5: stretch the grayscale level of the gas position prediction area through grayscale conversion, and then extract the real-time gas leakage information through frame subtraction.
[0084] According to the above process, when the gas prediction area is determined, the flow direction of the gas can be detected through real-time enhanced video, and it can be determined whether there is actually a gas leak.
[0085] Further preferably, in one embodiment, in step 1, edge extraction is performed using but not limited to Robert operator. Figure 2 , the specific implementation steps of Robert operator are as follows:
[0086] (1) Image grayscale: Convert a color image to a grayscale image. Here, edge detection is usually performed on grayscale images because they are easier to process.
[0087] (2) Define Robert operator: The Robert operator consists of two 2×2 convolution kernels, which are applied to the horizontal and vertical directions of the image respectively.
[0088] Horizontal operator:
[0089] Vertical Operator:
[0090] (3) Convolution operation: Apply Robert operator convolution kernels in horizontal and vertical directions to the grayscale image. Slide the convolution kernel over the image and calculate the convolution operation at each position.
[0091] (4) Calculate the gradient amplitude according to the following formula:
[0092]
[0093] Where Gx and Gy are the results of horizontal and vertical convolution operations respectively. Magnitude corresponds to the gradient magnitude at each pixel position.
[0094] (5) Threshold processing: Depending on the application scenario, you can choose to use threshold processing to further extract edges.
[0095] (6) Edge detection result: The final result is a binary image representing the edge, where edge pixels are set to white (or 1) and non-edge pixels are set to black (or 0).
[0096] Further, in one embodiment, in combination Figure 3 , the infrared video is framed as described in step 2, and the gas information is extracted using the frame subtraction integral method, specifically including:
[0097] Step 2-1, initialization, including setting the integration window size and threshold;
[0098] Step 2-2, determine the optimal frame reduction interval, specifically:
[0099]
[0100] Where div is the optimal frame subtraction interval, mean_gas is the average pixel intensity in the marked gas area, and mean_total is the average pixel intensity containing noise information in the marked gas area;
[0101] Here, the optimal frame reduction interval is selected by maximizing the effective information ratio.
[0102] Step 2-3, taking frames of the infrared video according to the optimal frame reduction interval; for example, if the optimal frame reduction interval is 2 seconds, taking frames at intervals of 2 seconds.
[0103] Step 2-4, setting a frame subtraction interval, and processing the image in step 2-3 using a frame subtraction integral method to obtain a grayscale integral value within the frame subtraction interval;
[0104] The formula of the frame subtraction method is:
[0105]
[0106] in, is the result of the frame subtraction integration method, i.e., the image or signal after the frame subtraction integration method, q is the number of integration frames, i.e., the size of the integration window, p is a delay parameter, which indicates the frame interval when calculating the difference, the offset relative to the current time considered, n is the time point when the current integration starts, I n+r-p and I n+r Represents the signals or images at time n+tp and n+t respectively.
[0107] Here, the image features related to gas leakage can be enhanced by integrating a certain number of frame subtraction results. The purpose of integration is to increase the pixel intensity of the gas leakage area, making it more visually obvious.
[0108] Here preferably, the number of integration frames is 60 and p is 5.
[0109] Step 2-5, threshold processing is performed on the image in combination with the threshold and grayscale integral value to distinguish gas from background; the specific formula is:
[0110]
[0111] Wherein, threshold is the threshold, B(x, y) is the image after threshold processing, 1 represents the motion area, i.e., the gas area, and 0 represents the static background.
[0112] Here, preferably, the threshold value is 15%.
[0113] Step 2-6, morphological processing is performed on the image, and then the gas information is determined by connectivity analysis, including gas leakage region and area information.
[0114] Furthermore, in one of the embodiments, a new adaptive gamma transform is proposed. According to the example of analyzing the frame subtraction integral result under experimental conditions, the result still contains strong noise. Through the adaptive gamma transform method, a denoised image is obtained.
[0115] The adaptive gamma transform method is generally based on the grayscale, contrast or color distribution of the input image. The traditional gamma transform method is to determine a specific gamma value, but this method is likely to cause more noise in scenes with complex background changes. Therefore, this method proposes to dynamically adjust the gamma value based on the statistics of the image and dynamically adjust the gamma value based on the change of grayscale value, so that the gamma transform can achieve the best enhancement effect.
[0116] Combination Figure 4In step 3, the frame subtraction integral result is used to enhance the contrast through adaptive gamma transformation, which specifically includes:
[0117] Step 3-1, calculate the average grayscale of the image:
[0118]
[0119] Where I(i,j) is the grayscale value at the coordinate (i,j) in the image, M and N are the maximum values of the horizontal and vertical coordinates of the image respectively;
[0120] Step 3-2, determine the gamma value γ:
[0121]
[0122] Where C is a preset value used to adjust the sensitivity of gamma value calculation; this value can be adjusted according to different application scenarios to achieve the best gamma conversion effect;
[0123] Step 3-3, perform gamma transformation on the image:
[0124]
[0125] Among them, V in is the input value, i.e. the original pixel value of the image, V out It is the output value, i.e. the pixel value after gamma transformation.
[0126] Here, the adaptive gamma transform proposed in this method dynamically adjusts the gamma value by comparing the average gray value, thereby optimizing the grayscale and contrast of the image under different background environments, and then optimizing the subsequent gas detection algorithm. This method is suitable for scenes with large background changes, such as chemical parks, etc. By adjusting the value of C, a balance can be found in the process of enhancing the image.
[0127] Further, in one embodiment, in combination Figure 5 , step 4 specifically uses agglomerative hierarchical clustering algorithm to determine the gas location area, specifically including:
[0128] Step 4-1, initialization: each data point, i.e., pixel point in the image is considered as an independent cluster;
[0129] Step 4-2, calculate the distance: regard every two clusters as possible cluster pairs, and calculate the distances between all possible cluster pairs to form a distance matrix;
[0130] Step 4-3, merging clusters: merging the two closest clusters into a new cluster;
[0131] Step 4-4, update the distance matrix: update the distance matrix in the same manner as step 4-2;
[0132] Step 4-5, repeating steps 4-2 to 4-4 until all data points are clustered to a preset number of clusters;
[0133] Step 4-6, generate a dendrogram: generate a dendrogram according to the order of cluster merging in the above steps; the area where the information of all data points in the dendrogram is connected in the order of merging is used as the gas position prediction area.
[0134] Here, preferably, the method of calculating the distance in step 4-2 is one or more of minimum distance calculation, maximum distance calculation, average distance and Ward method.
[0135] 1. Minimum distance calculation:
[0136] d(S,T)=min{d(x,y)x∈S,y∈T}
[0137] 2. Maximum distance calculation:
[0138] d(S,T)=max{d(x,y)x∈S,y∈T}
[0139] 3. Average distance:
[0140]
[0141] 4.Ward method:
[0142]
[0143] Furthermore, in one of the embodiments, the gas area prediction algorithm can only indicate that there may be a gas leak in the area. The prediction result is an area without information such as the direction of the gas flow. Sometimes the gas leak is too microscopic to be detected from a single captured infrared image. Therefore, it is necessary to enhance the gas information in the predicted area to show the flow direction of the gas so that the gas leak can be more easily observed from the infrared video sequence. Figure 6 , step 5 specifically includes:
[0144] Step 5-1, calculate the grayscale range of the original image: traverse all pixels in the gas position prediction area in the original image to obtain the maximum grayscale value and the minimum grayscale value;
[0145] Step 5-2, define the target grayscale range: define the required target minimum grayscale value and target maximum grayscale value;
[0146] Step 5-3, calculating the grayscale conversion function: calculating the new grayscale corresponding to each original grayscale by linear difference to obtain the grayscale conversion function;
[0147] Grayscale conversion is expressed as:
[0148]
[0149] Among them, I input ,I output are the pixels before and after grayscale transformation, g min The minimum gray value in the gas position prediction area;
[0150] Step 5-4, stretching the gray level of the gas position prediction area by a gray conversion function to generate an enhanced image;
[0151] Step 5-5, based on the enhanced image, extract the real-time gas leakage information by frame subtraction, including the gas leakage area and the gas leakage direction.
[0152] For example, the grayscale average value of a certain prediction area is 238, the maximum grayscale value of the prediction area is 255, and the minimum grayscale value is 190. After testing, this step takes about 0.03 seconds per frame. For a video with 30 frames per second, real-time airflow detection can be performed.
[0153] In one embodiment, a gas leakage detection system is provided, the system comprising:
[0154] The first module is used to take frames of infrared video and perform edge extraction on the framed images to obtain edge information;
[0155] The second module is used to take frames of infrared video and extract gas information using frame subtraction integration method;
[0156] The third module is used to enhance the contrast of the frame subtraction integral method results through adaptive gamma transformation, and to suppress the noise generated by the edge of the object using the edge information extracted by the edge;
[0157] A fourth module is used to determine the gas location prediction area using a hierarchical clustering algorithm;
[0158] The fifth module is used to stretch the gray level of the gas position prediction area through grayscale conversion, and then extract the real-time gas leakage information through frame subtraction.
[0159] For the specific definition of the gas leakage detection system, please refer to the definition of the gas leakage detection method above, which will not be repeated here. Each module in the above-mentioned gas leakage detection system can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0160] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the following is achieved:
[0161] Step 1, frame the infrared video, and perform edge extraction on the framed image to obtain edge information;
[0162] Step 2, take frames of the infrared video and extract gas information using the frame subtraction integral method;
[0163] Step 3, for the result of the frame subtraction integral method, the contrast is enhanced by adaptive gamma transformation, and the edge information extracted by the edge is used to suppress the noise generated by the edge of the object;
[0164] Step 4, using a hierarchical clustering algorithm to determine the gas location prediction area;
[0165] Step 5: stretch the grayscale level of the gas position prediction area through grayscale conversion, and then extract the real-time gas leakage information through frame subtraction.
[0166] For the specific limitations of each step, please refer to the limitations of the gas leakage detection method above, which will not be repeated here.
[0167] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the computer program implements:
[0168] Step 1, frame the infrared video, and perform edge extraction on the framed image to obtain edge information;
[0169] Step 2, take frames of the infrared video and extract gas information using the frame subtraction integral method;
[0170] Step 3, for the result of the frame subtraction integral method, the contrast is enhanced by adaptive gamma transformation, and the edge information extracted by the edge is used to suppress the noise generated by the edge of the object;
[0171] Step 4, using a hierarchical clustering algorithm to determine the gas location prediction area;
[0172] Step 5: stretch the grayscale level of the gas position prediction area through grayscale conversion, and then extract the real-time gas leakage information through frame subtraction.
[0173] For the specific limitations of each step, please refer to the limitations of the gas leakage detection method above, which will not be repeated here.
[0174] As a specific example, in one of the embodiments, the present invention is further verified and explained. The infrared video image of the gas leakage environment is as follows: Figure 7 , Figure 8 and Fig. 9 As shown in the figure, the leaking gas areas obtained after processing by frame subtraction integral method, Robert edge extraction, adaptive gamma transform and hierarchical clustering method are as follows: Fig.10 , Fig.11 , Fig.12 The final rendering results obtained by grayscale conversion stretching and frame difference method are as follows Fig.13 , Fig.14 , Fig.15 As shown. It can be seen that the method proposed in the present invention can accurately locate the position of the leakage point and mark the leakage interval and the leaked gas. Compared with the previous scheme, the present invention uses a hierarchical clustering method instead of a traditional morphological filtering method when processing the real-time information of the gas leakage image, which can maintain good accuracy while reducing the algorithm complexity and operation time.
[0175] The above shows and describes the basic principles, main features and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited by the above embodiments, and the above embodiments and descriptions are only for explaining the principles of the present invention. Without departing from the spirit and scope of the present invention, any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A high-precision gas leak detection method, characterized in that: The method comprises: Step 1, frame the infrared video, and perform edge extraction on the framed image to obtain edge information; Step 2, take frames of the infrared video and extract gas information using the frame subtraction integral method; Step 3, for the result of the frame subtraction integral method, the contrast is enhanced by adaptive gamma transformation, and the edge information extracted by the edge is used to suppress the noise generated by the edge of the object; Step 4, using a hierarchical clustering algorithm to determine the gas location prediction area; Step 5: stretch the grayscale level of the gas position prediction area through grayscale conversion, and then extract the real-time gas leakage information through frame subtraction.
2. The high-precision gas leakage detection method according to claim 1, characterized in that: In step 1, Robert operator is used for edge extraction.
3. The high-precision gas leakage detection method according to claim 1, characterized in that: In step 2, the infrared video is framed and the gas information is extracted using the frame subtraction integral method, which specifically includes: Step 2-1, initialization, including setting the integration window size and threshold; Step 2-2, determining the optimal frame reduction interval; Step 2-3, taking frames of the infrared video according to the optimal frame reduction interval; Step 2-4, setting a frame subtraction interval, and processing the image in step 2-3 using a frame subtraction integral method to obtain a grayscale integral value within the frame subtraction interval; Step 2-5, performing threshold processing on the image by combining the threshold and the grayscale integral value to distinguish gas from background; Step 2-6, morphological processing is performed on the image, and then the gas information is determined by connectivity analysis, including gas leakage region and area information.
4. The high-precision gas leakage detection method according to claim 3, characterized in that: The optimal frame reduction interval in step 2-2 is specifically: Where div is the optimal frame subtraction interval, mean_gas is the average pixel intensity in the marked gas area, and mean_total is the average pixel intensity containing noise information in the marked gas area.
5. The high-precision gas leakage detection method according to claim 3, characterized in that: The formula for the frame subtraction method in step 2-4 is: in, is the result of the frame subtraction integration method, i.e., the image or signal after the frame subtraction integration method, q is the number of integration frames, i.e., the size of the integration window, p is a delay parameter, n is the time point when the current integration starts, I n+r-p and I n+r Represents the signals or images at time n+tp and n+t respectively.
6. The high-precision gas leakage detection method according to claim 3, characterized in that: In step 2-5, the image is thresholded by combining the threshold and grayscale integral value to distinguish gas from background. The specific formula is: Wherein, threshold is the threshold, B(x, y) is the image after threshold processing, 1 represents the motion area, i.e., the gas area, and 0 represents the static background.
7. The high-precision gas leakage detection method according to claim 1, characterized in that: In step 3, the contrast of the frame subtraction integral result is enhanced by adaptive gamma transformation, which specifically includes: Step 3-1, calculate the average grayscale of the image: Where I(i,j) is the grayscale value at the coordinate (i,j) in the image, M and N are the maximum values of the horizontal and vertical coordinates of the image respectively; Step 3-2, determine the gamma value γ: Where C is a preset value used to adjust the sensitivity of gamma value calculation; Step 3-3, perform gamma transformation on the image: Among them, V in is the input value, i.e. the original pixel value of the image, V out It is the output value, i.e. the pixel value after gamma transformation.
8. The high-precision gas leakage detection method according to claim 1, characterized in that: Step 4 specifically uses an agglomerative hierarchical clustering algorithm to determine the gas location area, including: Step 4-1, initialization: each data point, i.e., pixel point in the image is considered as an independent cluster; Step 4-2, calculate the distance: regard every two clusters as possible cluster pairs, and calculate the distances between all possible cluster pairs to form a distance matrix; Step 4-3, merging clusters: merging the two closest clusters into a new cluster; Step 4-4, update the distance matrix: update the distance matrix in the same manner as step 4-2; Step 4-5, repeating steps 4-2 to 4-4 until all data points are clustered to a preset number of clusters; Step 4-6, generate a dendrogram: generate a dendrogram according to the order of cluster merging in the above steps; the area where the information of all data points in the dendrogram is connected in the order of merging is used as the gas position prediction area.
9. The high-precision gas leakage detection method according to claim 8, characterized in that: The distance calculation method in step 4-2 is one or more of minimum distance calculation, maximum distance calculation, average distance and Ward method.
10. The high-precision gas leakage detection method according to claim 1, characterized in that: Step 5 specifically includes: Step 5-1, calculate the grayscale range of the original image: traverse all pixels in the gas position prediction area in the original image to obtain the maximum grayscale value and the minimum grayscale value; Step 5-2, define the target grayscale range: define the required target minimum grayscale value and target maximum grayscale value; Step 5-3, calculating the grayscale conversion function: calculating the new grayscale corresponding to each original grayscale by linear difference to obtain the grayscale conversion function; Step 5-4, stretching the gray level of the gas position prediction area by a gray conversion function to generate an enhanced image; Step 5-5, based on the enhanced image, extract the real-time gas leakage information by frame subtraction, including the gas leakage area and the gas leakage direction.
Citation Information
Patent Citations
Face-based image clustering
CN101523412A
Gas infrared video enhancement method and device and storage medium
CN109727202A
Image contrast enhancement implementation method based on local adaptive gamma correction
CN110599415A
Cited By
Intelligent monitoring and early warning method for under-pressure workover operation site
CN120747829A
An intelligent monitoring and early warning method for on-site work of a pressurized well repair
CN120747829B
