A hazardous waste leakage detection method and system based on image processing
By constructing a Gaussian mixture model background map and calculating the diffusion index, combined with environmental uncertainty, the problem of high false alarm rate in transparent hazardous waste leakage detection was solved, and accurate identification and robust detection of transparent liquid leakage was achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHAANXI HIGH TECH ENVIRONMENTAL PROTECTION TECH CO LTD
- Filing Date
- 2026-01-07
- Publication Date
- 2026-04-24
AI Technical Summary
Existing hazardous waste leakage detection methods have difficulty identifying subtle changes in light intensity in transparent or semi-transparent liquid environments and are easily affected by light and shadow, resulting in a high false alarm rate.
By constructing a background map of a Gaussian mixture model, combining the gradient ratio and the specular suppression term to calculate texture saliency, and using the diffusion index and environmental uncertainty to identify leakage areas, the confidence level is dynamically adjusted to reduce false alarms.
It improves the ability to identify transparent hazardous waste leaks, reduces the false alarm rate caused by environmental noise interference, and achieves more robust detection results.
Smart Images

Figure CN121482034B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology. More specifically, this invention relates to a method and system for detecting hazardous waste leakage based on image processing. Background Technology
[0002] In the daily operation of hazardous waste treatment plants and chemical industrial parks, hazardous waste leakage monitoring is a core link in ensuring environmental safety and production compliance. Its main task is to monitor key areas such as storage containers, pipelines and valve interfaces around the clock so that chemical or hazardous liquid leaks can be detected and alarmed in a timely manner, thereby preventing the spread of harmful substances that could cause soil pollution or safety accidents.
[0003] Existing hazardous waste leakage monitoring typically uses fixed cameras to capture images of the monitored area and applies traditional background subtraction or inter-frame subtraction methods to compare the pixel grayscale differences between the current frame and the previous frame to detect hazardous waste leakage.
[0004] However, in actual hazardous waste storage environments, hazardous waste leak detection faces extremely complex optical and physical challenges. First, many hazardous waste liquids are transparent or translucent, with optical properties similar to the ground background. When the liquid spreads on the ground, it produces only slight changes in luminosity. Furthermore, due to the surface tension of the liquid, the texture of the covered area becomes smooth. Traditional gray-scale difference methods struggle to capture these subtle texture luminosity features, easily leading to missed detections. Second, industrial environments are complex, with lighting conditions dynamically changing over time and susceptible to dynamic interference factors such as moving shadows, equipment reflections, and old stains on the ground. Existing technologies lack effective environmental perception and noise reduction mechanisms, making it difficult to distinguish between real liquid diffusion behavior with a fixed source and random environmental noise. Especially in scenarios with high light reflection or sudden changes in lighting, these methods fail to identify the core temporal characteristics of the leak area—namely, the continuous growth of the leak area and the fixed location of the source—leading to a higher false alarm rate. Summary of the Invention
[0005] To address the aforementioned technical problems of difficulty in identifying transparent hazardous waste leaks and high false alarm rates caused by environmental interference, this invention provides solutions in the following aspects.
[0006] In a first aspect, the present invention provides a hazardous waste leakage detection method based on image processing, comprising: constructing a background image from an image in a non-hazardous waste leakage state using a Gaussian mixture model, with the current frame image as the original image; obtaining the texture saliency of pixels based on the gray-level difference, gradient ratio, and specular suppression term of corresponding pixels in the background image and the original image; the specular suppression term being obtained based on the gray-level value of pixels in the original image and a gray-level threshold; binarizing the image constructed by the texture saliency using a segmentation algorithm, and identifying the connected regions with an area greater than an area threshold in the binarization result as leakage regions; and determining the leakage region based on the ratio of the area of all leakage regions in the original image to the area of all leakage regions in the previous frame image of the original image. The diffusion index is calculated based on the ratio of the overlapping area of the leakage region between the two images to the area of the leakage region in the previous frame of the original image, and the average roundness of all leakage regions in the original image. The environmental uncertainty is calculated based on the average grayscale difference between the pixels outside the leakage regions in the original image and their corresponding pixels in the background image. The product of the diffusion index of the original image and the normalized average texture saliency is used as the observation data item. The leakage confidence of the original image is obtained by weighted summation of the observation data item and the leakage confidence of the previous frame, where the weights are obtained based on the environmental uncertainty. If the leakage confidence of consecutive preset number of frames exceeds the safety threshold, the leakage level is determined and output based on the preset range of the total number of pixels in the leakage region.
[0007] This invention weakens the negative impact of subtle light intensity changes caused by transparent liquid coverage by calculating the gradient magnitude ratio of the original image and the background image and introducing a specular suppression term determined by a grayscale threshold. It enhances the detection capability for leaks in dark areas by utilizing texture smoothing features, while reducing false feature responses caused by ground reflections. By extracting the leak area and calculating the diffusion index composed of pixel area ratio, overlap area ratio, and average roundness, it captures the physical characteristic of liquid spreading outwards from the center while the source remains stationary, providing a basis for eliminating moving interference where the area changes but the source position is not fixed. It measures the stability of ambient light by using environmental uncertainty, dynamically adjusting the weight of the observed data items and the leakage confidence of the previous frame in the calculation process. When environmental fluctuations are large, it automatically increases the dependence on historical states, ensuring the robustness of the judgment logic. By judging whether the leakage confidence of a consecutive preset number of frames exceeds a safety threshold and combining it with a preset range of output levels based on the total number of pixels in the leak area, the detection results are more consistent with the physical consistency of liquid diffusion, effectively improving the difficulty of identifying transparent hazardous waste leaks and the problem of false alarms caused by environmental noise.
[0008] Preferably, the texture saliency satisfies the expression:
[0009] ;
[0010] In the formula, The texture saliency of the target pixel. This represents the grayscale value of the target pixel in the original image. This represents the grayscale value of the target pixel in the background image. This represents the gradient magnitude of the target pixel in the background image. This represents the gradient magnitude of the target pixel in the original image. This is the texture enhancement factor. This is the specular suppression coefficient. This is the grayscale threshold. To prevent constants with a denominator of zero.
[0011] This invention constructs texture saliency by fusing the grayscale difference, gradient amplitude ratio, and highlight suppression term between the background image and the original image. This facilitates the identification of transparent hazardous waste liquid leakage areas and enhances the detection capability of weak leakage features in dark areas. Based on a nonlinear mapping of grayscale thresholds, the system can effectively distinguish between ground reflections and actual hazardous waste leakage areas, improving the reliability of hazardous waste leakage detection.
[0012] Preferably, the step of binarizing the image composed of texture saliency using a segmentation algorithm includes: performing Otsu's algorithm threshold segmentation on the image composed of texture saliency of each pixel in the original image to obtain a binary image.
[0013] Preferably, the step of identifying the connected regions with an area greater than an area threshold in the binarization result as leakage regions includes: using a two-pass scanning method to mark the connected components of the binary image, obtaining all connected regions, and filtering out the connected regions with an area greater than an area threshold as leakage regions.
[0014] Preferably, the diffusion index satisfies the expression:
[0015] ;
[0016] In the formula, The diffusion index represents the diffusion index of all leakage areas in the original diagram. This represents the area of all leaking areas in the original diagram. This represents the pixel area of all leaking areas in the previous frame of the original image. This represents the overlap area between all leaking areas in the original image and all leaking areas in the previous frame of the original image. The average roundness of all leaking areas in the original diagram. To prevent constants with a denominator of zero.
[0017] This invention utilizes the physical characteristics of a continuously growing leakage area, a fixed source location, and irregularly serrated edges. By calculating a diffusion index that includes area growth, source anchoring, and morphological features, it provides a spatiotemporal evolution basis for identifying real leaks and eliminating static stains and moving light and shadow interference. This enhances the consistency between detection logic and physical laws and lays a data foundation for the accurate assessment of subsequent leakage confidence.
[0018] Preferably, the environmental uncertainty satisfies the expression:
[0019] ;
[0020] In the formula, For environmental uncertainty, This represents the total number of pixels in the non-leaking area. This is the set of pixels in the non-leaking area. This represents the grayscale value of the target pixel in the non-leaking area of the original image. This represents the grayscale value of the target pixel in the non-leaking area of the background image.
[0021] This invention obtains environmental uncertainty by calculating the average grayscale difference in non-leaking areas, which is used to measure the stability of ambient lighting. This allows it to reflect background fluctuations caused by switching lights on and off or camera shake, providing a basis for suppressing false alarms caused by sudden environmental changes.
[0022] Preferably, the leakage confidence level satisfies the expression:
[0023] ;
[0024] In the formula, The original diagram shows the leakage confidence level. This is the environmental regulation coefficient. For environmental uncertainty, Let be the spatial prior probability value for all leakage areas. The diffusion index represents the diffusion index of all leakage areas in the original diagram. The average texture saliency after normalization for all leakage areas in the original image. This represents the leakage confidence level in the previous frame of the original image.
[0025] This invention calculates the observed data item by combining spatial prior probability values, diffusion index, and normalized average texture saliency. It then dynamically allocates weights between the observed data item and the leakage confidence level in the previous frame of the original image using environmental uncertainty, thus calculating the leakage confidence level of the original image. This method achieves dual verification of real-time observations and historical states: when the environment is stable, increasing the observation weights enhances the detection sensitivity for actual leakage behavior; when the environment fluctuates drastically, increasing the historical weights maintains the system's state from the previous frame, thereby suppressing numerical fluctuations caused by sudden environmental changes. This fusion-based judgment mechanism effectively distinguishes between transient environmental disturbances and confirmed hazardous waste leakage, providing a robust basis for subsequent temporal consistency verification and hierarchical assessment.
[0026] Preferably, the step of determining and outputting the leakage level based on a preset range of the total number of pixels in the leakage area includes: when the total number of pixels in the leakage area is greater than or equal to A1 and less than A2, it is determined to be a level 1 minor dripping leak; when the total number of pixels in the leakage area is greater than or equal to A2 and less than A3, it is determined to be a level 2 significant liquid accumulation; when the total number of pixels in the leakage area is greater than or equal to A3, it is determined to be a level 3 severe diffusion, where A1 is the threshold for the number of pixels in level 1, A2 is the threshold for the number of pixels in level 2, and A3 is the threshold for the number of pixels in level 3.
[0027] Secondly, the present invention provides a hazardous waste leakage detection system based on image processing, including a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the above-mentioned hazardous waste leakage detection method based on image processing is implemented.
[0028] By adopting the above technical solution, a computer program is generated from the above-mentioned image processing-based hazardous waste leakage detection method and stored in the memory so that it can be loaded and executed by the processor. In this way, a terminal device can be made based on the memory and the processor for convenient use.
[0029] The beneficial effects of this invention are as follows: By calculating the gradient magnitude ratio of the original image and the background image and introducing a highlight suppression term determined by a grayscale threshold, this invention weakens the negative impact of the difficulty in capturing subtle changes in light intensity caused by transparent liquid coverage. It also improves the detection sensitivity for leakage in dark areas by utilizing texture smoothing features, while reducing false feature responses generated by high-light areas on the ground. By extracting the leakage area and calculating the diffusion index composed of the area growth rate, the overlap area ratio, and the average roundness, this invention can capture the spatiotemporal evolution of liquid spreading outwards from the center while the source remains stationary, providing a logical basis for eliminating interference from moving shadows whose area changes but whose position is not fixed. Furthermore, by using environmental uncertainty to measure illumination stability and dynamically adjusting the weight of observed data items and historical accumulated states in the leakage confidence update, this invention automatically reduces dependence on current observations when environmental fluctuations are large, ensuring the robustness of the judgment logic. By judging the leakage confidence of a consecutive preset number of frames and combining it with the total number of pixels in the leakage area to output the level, the detection results are more consistent with the physical consistency of liquid diffusion, improving the difficulty in identifying transparent hazardous waste leakage and the frequent false alarms caused by environmental noise. Attached Figure Description
[0030] Figure 1 This is a flowchart illustrating an image processing-based hazardous waste leakage detection method according to the present invention;
[0031] Figure 2 This is a schematic illustration of the original diagram in this invention;
[0032] Figure 3 This is a schematic diagram illustrating the binarized image of the leakage area in this invention. Detailed Implementation
[0033] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0034] The specific embodiments of the present invention will now be described in detail with reference to the accompanying drawings.
[0035] This invention discloses an image processing-based method for detecting hazardous waste leakage, referring to... Figure 1 This includes steps S1-S4:
[0036] S1. Collect images of the monitoring site and calculate the texture saliency by fusing photometric and gradient features.
[0037] It should be noted that when transparent hazardous waste liquid leaks onto the ground, the imaging effect shows obvious regional differences. In dark areas, due to the small difference in grayscale between the liquid and the background, the leakage characteristics are easily drowned out by background texture noise, resulting in missed detection. In bright areas, the inherent texture of the ground and the smooth changes caused by the liquid interfere with each other, causing the leakage area to be misjudged as normal texture undulations or reflections. In order to accurately identify the real hazardous waste leakage area, this invention must perform detection that can simultaneously identify changes in light intensity and texture smoothness features.
[0038] Specifically, 30 frames of images were acquired under conditions of no hazardous waste leakage, and a background image was constructed using a Gaussian mixture model. Images from the monitoring screen were acquired and converted to grayscale to obtain the original image. Any pixel in the original image was selected as the target pixel. The gradient magnitude of the target pixel in the background image and the target pixel in the original image were calculated using the Sobel operator. A specular suppression term was obtained by performing a nonlinear mapping based on the difference between the grayscale value of the target pixel in the original image and a defined grayscale threshold. The texture saliency of the target pixel was calculated based on the difference in grayscale values between the original and background images, combined with the gradient magnitudes of the target pixels in the original and background images and the specular suppression term of the target pixel in the original image.
[0039] Specifically, the texture saliency of the target pixel satisfies the expression:
[0040] ;
[0041] In the formula, The texture saliency of the target pixel. This represents the grayscale value of the target pixel in the original image. This represents the grayscale value of the target pixel in the background image. This represents the gradient magnitude of the target pixel in the background image. This represents the gradient magnitude of the target pixel in the original image. This is the texture enhancement factor. This is the specular suppression coefficient. This is the grayscale threshold. To prevent constants with a denominator of zero, in this embodiment... Set as Gray threshold The number is 200, and the implementers can adjust it according to the actual situation. and .
[0042] In this embodiment, parameters and Used to adjust the sensitivity to the difference between the original image and the background image during texture saliency calculation. The empirical value range is [1, 3]. The empirical value range is [0,1]. In this embodiment, Set to 2, Set to 0.5. In other embodiments, implementers can adjust the above parameters according to the actual implementation situation. For example, when the transparency of the monitored object is extremely high, resulting in extremely weak texture smoothing features, the parameter can be appropriately increased. To enhance the nonlinear amplification capability of subtle differences; when there are many high-frequency subtle noise points in the monitoring background, adjustments can be made appropriately. The characteristic signal is to balance the noise suppression effect and prevent background noise from being amplified.
[0043] in, This represents the basic photometric difference term. The larger the value, the greater the difference between the grayscale value of the target pixel in the original image and the grayscale value in the background image, and the higher the probability that the target pixel is in an abnormal area. The larger S is, the higher the probability that the area where the target pixel is located is identified as a hazardous waste leakage area. The smaller the value, the smaller the difference between the grayscale value of the target pixel in the original image and the grayscale value in the background image, and the higher the probability that the target pixel is in the normal background. The smaller S is, the lower the probability that the area where the target pixel is located is misidentified as a hazardous waste leakage area.
[0044] This represents the texture smoothing gain term. When transparent or semi-transparent hazardous waste liquid covers the ground, the surface tension of the liquid smooths the covered area, causing the gradient magnitude of the target pixels in that area in the original image to be smaller than the gradient magnitude of the target pixels in the background image. Therefore, when... A value greater than 1 better matches the smooth texture characteristics of hazardous waste leakage areas, making... The larger the value, the higher the probability that the area where the target pixel is located is identified as a hazardous waste leakage area; The closer the value is to 1, the more likely the texture roughness at the target pixel is to remain unchanged, the less it conforms to the smooth texture characteristics of a hazardous waste leakage area, and the greater the likelihood that it belongs to a non-liquid-covered area. The smaller the value, the lower the probability that the area where the target pixel is located will be misidentified as a hazardous waste leakage area.
[0045] This refers to the specular suppression term. When specular reflection occurs, the grayscale value of the target pixel in the original image will exceed the grayscale threshold. ,at this time, The value will approach 0, making the S value smaller to prevent reflective or high-gloss areas on the ground from being misjudged as hazardous waste leakage areas; when The closer the value is to 1, the more likely the gradient magnitude of the target pixel in the original image is to be within the normal range, and the smaller the impact on the S value, thus preserving the true hazardous waste leakage characteristic response.
[0046] S2. Extract all leakage areas and calculate the diffusion index, which characterizes the dynamic evolution.
[0047] It should be noted that in the process of hazardous waste leakage detection, static stains have single-frame texture and photometric features similar to those of real hazardous waste leakage, while moving shadows exhibit random walk characteristics with varying areas but unfixed source locations, leading to a high false alarm rate in traditional single-frame detection methods. To accurately identify real hazardous waste leakage and reduce the false alarm rate, this invention constructs a diffusion index by combining the area growth rate and spatial continuity of all leakage areas in adjacent frames. This fully utilizes the core characteristics of real hazardous waste leakage, where the area increases over time and the source location remains fixed.
[0048] Specifically, the Otsu algorithm is used to threshold segment the image based on the texture saliency of each pixel in the original image to obtain a binary image. A two-pass scanning method is used to label the connected components of the binary image, obtaining all connected regions. Connected regions with areas greater than a threshold are selected as leakage regions. The ratio of the overlapping area of all leakage regions in the original image and the previous frame to the total area of leakage regions in the previous frame of the original image is calculated. The average roundness of all leakage regions in the original image is calculated based on the connected components of the hazardous waste leakage regions in the binary image. The diffusion index of all leakage regions in the original image is calculated based on the ratio of the areas of all leakage regions in the original image and the previous frame, the overlapping area ratio, and the average roundness of all leakage regions in the original image.
[0049] In this embodiment, the area threshold is set to 50 pixels. Implementers can modify the area threshold according to the actual situation.
[0050] Specifically, the diffusion index satisfies the expression:
[0051] ;
[0052] In the formula, The diffusion index represents the diffusion index of all leakage areas in the original diagram. This represents the area of all leaking areas in the original diagram. This represents the pixel area of all leaking areas in the previous frame of the original image. This represents the overlap area between all leaking areas in the original image and all leaking areas in the previous frame of the original image. This represents the average roundness of all leaking areas in the original diagram. To prevent constants with a denominator of zero, in this embodiment, The implementers can adjust according to the actual situation. .
[0053] in, This represents the area increase term for all leaking areas in the original diagram. The larger the value is than 1, the stronger it is in the original graph. The increasing trend in the area of all leaking zones indicates that all leaking zones in the original diagram more closely match the physical characteristics of continuous diffusion of hazardous waste leachate. The larger the value, the more the leakage areas in the original image conform to the spatiotemporal evolution of real hazardous waste leakage, and the greater the possibility of hazardous waste leakage. A value equal to or less than 1 indicates that the area of all leakage regions in the original diagram is more static or contracted, meaning that the leakage regions in the original diagram do not conform to the physical characteristics of continuous liquid diffusion. The smaller the value, the more likely all leakage areas in the original diagram are due to interference from static or moving areas, and the lower the probability of hazardous waste leakage.
[0054] The source anchoring term represents all leakage areas in the original diagram. The closer the value is to 1, the more the leaking areas in the previous frame of the original image are contained within the leaking areas in the original image, making... The higher the value, the more it conforms to the diffusion characteristics of liquid spreading outward from the center while the source remains stationary, and the greater the possibility of hazardous waste leakage. The closer the value is to 0, the more likely that all leakage areas in the original image have undergone overall displacement compared to all leakage areas in the previous frame of the original image. The smaller the value, the more likely all leakage areas in the original image are moving light and shadow, and the lower the probability of hazardous waste leakage.
[0055] This represents the morphological characteristics of all seepage areas in the original image. As the liquid spreads across the ground, it is affected by the microstructure of the terrain, and the edges often exhibit irregular jagged shapes. The larger the value, The smaller the value, the smoother the edges of all leakage areas in the original image, making... The smaller the value, the less the shape of all leakage areas in the original image conforms to the actual characteristics of hazardous waste leakage, and the more likely it is to be an object projection. The smaller the value, The larger the value, the more irregular the edges of all leakage areas, making... The larger the value, the more the shape of all leakage areas in the original image matches the characteristics of actual hazardous waste leakage, and the greater the possibility of hazardous waste leakage.
[0056] It should be noted that industrial surfaces are not perfectly flat at the microscopic level. Driven by gravity and surface tension, liquids tend to flow along local depressions, resulting in inconsistent diffusion rates at their edges and an irregular, jagged shape, thus reducing the roundness value. In contrast, on-site disturbances are mostly projections of rigid objects, whose edges are typically composed of smooth curves or straight lines, resulting in a larger roundness value. This invention utilizes this difference in fluid adaptation to terrain features and rigid projections to distinguish between actual leakage and ambient light and noise through morphological characteristics.
[0057] It should be noted that during the initial detection, there is no preceding frame image of the original image, and therefore no data on the leakage area and overlap area of the preceding frame image. Consequently, the diffusion index of all leakage areas in the original image cannot be calculated. In this case, the diffusion index in the original image during the initial detection is set to a preset initial value. In this embodiment, the preset initial value is set to 1, and the implementer can adjust this preset initial value according to the actual situation.
[0058] S3. Adaptively update the leakage confidence level of all leakage areas based on environmental uncertainty.
[0059] It should be noted that in industrial monitoring environments, the risk of hazardous waste leakage in images varies a priori across different areas, and the reliability of observational evidence is affected by environmental conditions such as sudden changes in lighting or camera shake. To distinguish between transient interference and genuine hazardous waste leakage, this invention integrates Bayesian inference and temporal accumulation, utilizing dual verification of historical data and real-time observations to improve the reliability of the judgment.
[0060] Specifically, environmental uncertainty is calculated based on the average grayscale difference between all pixels outside the leakage areas in the original image and their corresponding pixels in the background image. Regions outside all leakage areas in the binary image are defined as non-leakage areas. The normalized average saliency value of all leakage areas in the original image is calculated based on the texture saliency of each pixel in the original image.
[0061] Furthermore, leakage confidence is established for all leakage areas: For all leakage areas detected initially, the initial leakage confidence is calculated by multiplying the prior probability value of all leakage areas by the diffusion index and normalized average saliency of all leakage areas in the original image; for areas in the previous frame of the original image where leakage confidence has already been calculated, observation weight terms and historical weight terms are calculated based on environmental uncertainty. Observation data terms are calculated using spatial prior probability values, diffusion index, and normalized average texture saliency. The current leakage confidence is obtained by combining the observation data terms, observation weight terms, historical weight terms, and leakage confidence in the previous frame of the original image.
[0062] In one embodiment, the normalized average significance value of all leakage areas is obtained by linear normalization and then averaging the number of areas.
[0063] It should be noted that, depending on the detection scenario, the present invention assigns different prior probabilities to each scenario image. For example, each pixel in a high-risk area such as a pipe interface, valve, or container bottom is assigned a prior probability of 0.8, while each pixel in a low-risk area such as an open ground is assigned a prior probability of 0.4.
[0064] Specifically, the environmental uncertainty satisfies the expression:
[0065] ;
[0066] In the formula, For environmental uncertainty, This represents the total number of pixels in the non-leaking area. This is the set of pixels in the non-leaking area. This represents the grayscale value of the target pixel in the non-leaking area of the original image. This represents the grayscale value of the target pixel in the non-leaking area of the background image.
[0067] in, Used to measure the stability of ambient light. The larger the value, the more drastic the grayscale change in the background area and the more unstable the environment, such as when lights are switched on or off or when the camera shakes. In such cases, the reliance on the original image should be reduced, and more historical data should be referenced to avoid false alarms. The smaller the value, the more stable the environment, the more reliable the observation data in the original graph, and the higher the sensitivity of detecting real hazardous waste leaks.
[0068] Specifically, the leakage confidence update satisfies the expression:
[0069] ;
[0070] In the formula, The original diagram shows the leakage confidence level. This is the environmental regulation coefficient. For environmental uncertainty, Let be the spatial prior probability value for all leakage areas. The diffusion index represents the diffusion index of all leakage areas in the original diagram. The average texture saliency after normalization for all leakage areas in the original image. This represents the leakage confidence level in the previous frame of the original image.
[0071] In this embodiment, the environmental adjustment coefficient This is used to set the sensitivity of the system in dynamically allocating observation weights and historical weights based on environmental uncertainty. The empirical range is [0.6, 0.9]. In this embodiment, the environmental adjustment coefficient... Set to 0.8. In other embodiments, implementers can set this coefficient according to the actual implementation situation. For example, when the lighting conditions at the monitoring site are extremely complex or there is flicker interference, the coefficient can be appropriately increased to enhance the smoothing and suppression effect of historical weight terms on leakage confidence fluctuations; when the monitoring environment lighting is very stable, the coefficient can be appropriately decreased to improve the response speed of leakage confidence to the current observation data items.
[0072] In this embodiment, the spatial prior probability value is used to assign a basic weight to the calculation of observed data items based on the risk level differences of the detection scenario. In this embodiment, the spatial prior probability value is preset to 0.8 for high-risk areas such as pipe interfaces, valves, and container bottoms; and to 0.4 for low-risk areas such as open ground. In other embodiments, implementers can set this value according to the actual implementation situation. For example, when the monitoring point is located in a core critical equipment area and the tolerance for missed detection risk is extremely low, the value can be appropriately increased to improve the system's sensitivity to weak leakage characteristics; when the monitoring point is located in a non-core area and is easily affected by unrelated background interference, the value can be appropriately decreased to reduce the proportion of observed data items in the leakage confidence calculation, thereby reducing the false alarm rate.
[0073] in, As an observation weight term, it represents the system's level of confidence in the detection results in the original image; The larger the value, the more stable the environment, the more reliable the observation data in the original graph, and the more sensitive the leakage confidence update is to reflecting the current changes in the characteristics of hazardous waste leakage. The smaller the value, the more drastic the environmental fluctuations, the lower the system's confidence in the observed data in the original graph, the more the leakage confidence update depends on historical states, and the more it suppresses leakage confidence fluctuations caused by sudden environmental changes.
[0074] As a historical weighting term, it represents the degree to which the historically accumulated state is preserved. When environmental instability leads to... When the intensity is large, such as when lights are switched on or off or when the camera shakes, the brightness fluctuations in the background area are drastic, reducing the reliability of the observation data in the original image. In this case, the observation weighting term... Decrease, while historical weighting terms The system automatically reduces the influence weight of current observation data and increases the confidence level of historical leakage. The proportion of [something] is used to keep the system in the state of the previous frame and avoid false alarms caused by sudden environmental changes;
[0075] Measure the dynamic behavior of all leakage areas in the original map. The larger the value, the more continuously the area expands, the more stable the source location, the more irregular the edges, and the more consistent with the characteristics of liquid diffusion; The smaller the value, the more static, shrunken, or drifting the region is, which is mostly due to interference. This indicates the degree of static anomaly in all leakage areas of the original diagram. The larger the value, the more likely that all the seepage areas in the original image have both light intensity variation and texture smoothness characteristics, which is consistent with the characteristics of liquid coverage. The smaller the value, the weaker the difference between the texture and the background in all the seepage areas in the original image, and the more likely it is caused by changes in lighting.
[0076] This represents the observed data items in the original graph. The higher the value, the more likely the area in the original image is to be a high-risk region with significant spatiotemporal diffusion characteristics and texture anomalies, indicating a higher probability of actual hazardous waste leakage. The higher the value, the more likely it is that all leakage areas contain actual hazardous waste. The smaller the value, the lower the risk level, indicating that the target area is located in a low-risk zone and lacks the spatiotemporal diffusion characteristics and significant textural features of hazardous waste leakage, making it more likely to be a disturbance. The smaller the value, the more likely it is that all leakage areas will be identified as environmental interference.
[0077] S4. Conduct a graded assessment of hazardous waste leakage based on the area of the hazardous waste leakage zone.
[0078] It should be noted that the severity of hazardous waste leakage is directly related to the extent of liquid diffusion. To avoid false alarms in a single frame due to sudden changes in ambient light or camera shake, this invention abandons the traditional single-frame judgment mode and adopts a dual evaluation strategy of temporal consistency verification and area grading to achieve closed-loop management from leakage confirmation to graded response.
[0079] Specifically, a hazardous waste leakage safety threshold is set. If the leakage confidence score of consecutive preset number of frames exceeds the safety threshold, a confirmed hazardous waste leakage is determined to exist in the current monitoring area. A three-level risk assessment is performed based on the total number of pixels in all leakage areas, outputting the hazardous waste leakage level of the original image. When the total number of pixels in the leakage area is greater than or equal to A1 and less than A2, it is determined to be a Level 1 minor dripping leak; when the total number of pixels in the leakage area is greater than or equal to A2 and less than A3, it is determined to be a Level 2 significant liquid accumulation leak; when the total number of pixels in the leakage area is greater than or equal to A3, it is determined to be a Level 3 severe diffusion leak. A1 is the Level 1 pixel number threshold, A2 is the Level 2 pixel number threshold, and A3 is the Level 3 pixel number threshold. In this embodiment, the preset values A1, A2, and A3 are used to classify the leakage level based on the total number of pixels in the leakage area. The empirical value range is usually determined based on the resolution and imaging field of view of the monitoring camera. In this embodiment, the preset values A1 are 50, A2 are 100, and A3 are 150. In other embodiments, implementers can adjust the above parameters according to the actual implementation situation. For example, when the monitoring distance is far and the number of pixels corresponding to a unit physical area is small, the above threshold can be appropriately reduced to ensure the accuracy of the classification judgment; when there is a lot of background texture noise on the ground, the above threshold can be appropriately increased to enhance the filtering ability of small interference spots.
[0080] In this embodiment, the safety threshold is used to determine whether the calculated leakage confidence level reaches the reliability required to effectively trigger an alarm. The empirical value range is [0.6, 0.85]. In this embodiment, the safety threshold is set to 0.7. In other embodiments, implementers can set the safety threshold according to the actual implementation situation. For example, when the ambient light in the application scenario fluctuates drastically and the system's anti-interference capability is highly demanding, the threshold can be appropriately increased to reduce the false alarm rate; when the application scenario is a high-risk area and the tolerance for missed detection risk is extremely low, the threshold can be appropriately decreased to improve the system's detection sensitivity to weak leakage characteristics.
[0081] For example, Figure 2 This is the original image. Figure 3 This is a binarized image of the leakage area, where, Figure 3 The bright and medium-high brightness areas represent the morphological characteristics of transparent hazardous waste liquid spreading on the ground, and their pixel coordinates have a spatial mapping relationship with the physical leakage location in the original image; the dark areas represent the effectively suppressed background areas. Binarization segmentation achieves effective separation of the leakage target from background interference, transforming the weak texture smoothing and grayscale differences in the original image into definite geometric regions, thus providing support for subsequent leakage confidence assessment based on the diffusion index.
[0082] This invention also discloses an image processing-based hazardous waste leakage detection system, including a processor and a memory. The memory stores computer program instructions, which, when executed by the processor, implement an image processing-based hazardous waste leakage detection method according to the present invention.
[0083] The system also includes other components well known to those skilled in the art, such as communication buses and communication interfaces, the settings and functions of which are known in the art and will not be described in detail here.
Claims
1. A hazardous waste leakage detection method based on image processing, characterized in that, include: For images under conditions without hazardous waste leakage, a Gaussian mixture model is used to construct a background image, with the current frame image as the original image. The texture saliency of each pixel is obtained based on the grayscale difference, gradient ratio, and specular suppression term between corresponding pixels in the background image and the original image, satisfying the following: ; The texture saliency of the target pixel. This represents the grayscale value of the target pixel in the original image. This represents the grayscale value of the target pixel in the background image. This represents the gradient magnitude of the target pixel in the background image. This represents the gradient magnitude of the target pixel in the original image. This is the texture enhancement factor. This is the specular suppression coefficient. This is the grayscale threshold. To prevent constants with a denominator of zero; The highlight suppression term is obtained based on the grayscale values of pixels in the original image and a grayscale threshold. A segmentation algorithm is used to binarize the image composed of texture saliency, and connected regions with an area greater than the area threshold in the binarized result are considered leakage regions. The diffusion index is calculated based on the ratio of the area of all leakage regions in the original image to the area of all leakage regions in the previous frame of the original image, the proportion of the overlapping area of the leakage regions between the two images to the area of the leakage regions in the previous frame of the original image, and the average roundness of all leakage regions in the original image, satisfying the following conditions: ; The diffusion index represents the diffusion index of all leakage areas in the original diagram. This represents the area of all leaking areas in the original diagram. This represents the pixel area of all leaking areas in the previous frame of the original image. This represents the overlap area between all leaking areas in the original image and all leaking areas in the previous frame of the original image. The average roundness of all leaking areas in the original diagram. To prevent constants with a denominator of zero; The environmental uncertainty is calculated based on the average grayscale difference between pixels outside the leakage areas in the original image and their corresponding pixels in the background image, satisfying the following: ; For environmental uncertainty, This represents the total number of pixels in the non-leaking area. This is the set of pixels in the non-leaking area. This represents the grayscale value of the target pixel in the non-leaking area of the original image. This represents the grayscale value of the target pixel in the non-leaking area of the background image; The product of the diffusion index of the original image and the normalized average texture saliency is used as the observed data term. The leakage confidence of the original image is obtained by weighted summation of the observed data term and the leakage confidence of the previous frame, where the weights are obtained based on environmental uncertainty. The leakage confidence satisfies: ; The original diagram shows the leakage confidence level. This is the environmental regulation coefficient. For environmental uncertainty, Let be the spatial prior probability value for all leakage areas. The average texture saliency after normalization for all leakage areas in the original image. The initial leakage confidence score is the score of the previous frame of the original image. For all leakage areas detected for the first time, the initial leakage confidence score is calculated by multiplying the prior probability value of all leakage areas with the diffusion index and normalized average significance of all leakage areas in the original image. The diffusion index in the original image is set to a preset initial value during the first detection. If the leakage confidence of consecutive preset number of frames exceeds the safety threshold, the leakage level is determined and output based on the preset range of the total number of pixels in the leakage area.
2. The hazardous waste leakage detection method based on image processing according to claim 1, characterized in that, The step of using a segmentation algorithm to binarize the image composed of texture saliency includes: performing Otsu's algorithm threshold segmentation on the image composed of texture saliency of each pixel in the original image to obtain a binary image.
3. The hazardous waste leakage detection method based on image processing according to claim 1, characterized in that, The step of identifying the connected regions with an area greater than the area threshold in the binarized result as leakage regions includes: using a two-pass scanning method to mark the connected components of the binary image, obtaining all connected regions, and filtering out the connected regions with an area greater than the area threshold as leakage regions.
4. The hazardous waste leakage detection method based on image processing according to claim 1, characterized in that, The highlight suppression term is obtained based on the grayscale value of the pixel in the original image and the grayscale threshold, including: obtaining the highlight suppression term by performing a nonlinear mapping based on the difference between the grayscale value of the target pixel in the original image and the defined grayscale threshold.
5. The hazardous waste leakage detection method based on image processing according to claim 1, characterized in that, The step of determining and outputting the leakage level based on a preset range of the total number of pixels in the leakage area includes: when the total number of pixels in the leakage area is greater than or equal to A1 and less than A2, it is determined to be a level 1 minor dripping; when the total number of pixels in the leakage area is greater than or equal to A2 and less than A3, it is determined to be a level 2 significant liquid accumulation; when the total number of pixels in the leakage area is greater than or equal to A3, it is determined to be a level 3 severe diffusion, where A1 is the threshold for the number of pixels in level 1, A2 is the threshold for the number of pixels in level 2, and A3 is the threshold for the number of pixels in level 3.
6. A hazardous waste leakage detection system based on image processing, characterized in that, include: A processor and a memory, wherein the memory stores computer program instructions that, when executed by the processor, implement an image processing-based hazardous waste leakage detection method according to any one of claims 1-5.
Citation Information
Patent Citations
Roof leakage point intelligent positioning method and system based on machine vision
CN120563498A
Transformer equipment oil leakage monitoring method and system based on image recognition
CN121074780A