Sewage discharge detection method, detection device and computer readable storage medium

By performing semantic segmentation and HSV color space conversion on the images to be detected, and combining the probability statistics of saturation and brightness histograms, the problems of automation and accuracy in sewage discharge detection in existing technologies have been solved, realizing real-time and labor-saving sewage discharge detection.

CN115049680BActive Publication Date: 2026-05-05SHENZHEN MAXVISION TECH
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHENZHEN MAXVISION TECH
Filing Date
2022-05-30
Publication Date
2026-05-05

AI Technical Summary

Technical Problem

Existing technologies cannot achieve rapid, accurate, and automated wastewater discharge detection, resulting in huge manpower costs and inaccurate positioning, making it impossible to detect wastewater discharge in a timely and effective manner.

Method used

The image to be detected is semantically segmented, converted to HSV color space, and normalized saturation and brightness histograms of the discharge area are obtained. A probability threshold is set to statistically analyze the histograms and compare them with the wastewater assessment to determine whether the discharge area is wastewater.

Benefits of technology

It achieves automated, real-time wastewater discharge detection, saving manpower and enabling timely and effective detection of wastewater discharge, adapting to real-time adjustments in different scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115049680B_ABST
    Figure CN115049680B_ABST
Patent Text Reader

Abstract

This application discloses a wastewater discharge detection method, comprising: semantically segmenting an image to be detected to obtain a discharge area; converting the discharge area from RGB color space to HSV color space; obtaining a normalized saturation histogram and a normalized luminance histogram of the discharge area; setting a probability threshold α for saturation and performing probability statistics on the saturation histogram based on the probability threshold α; setting a probability threshold β for luminance and performing probability statistics on the luminance histogram based on the probability threshold β; and setting a wastewater assessment value μ, comparing the probability statistics results with the wastewater assessment value μ to determine whether the discharge area is discharging wastewater. This wastewater discharge detection method is based on real-time image processing, which can automatically detect whether the discharge is wastewater in a timely and effective manner, saving manpower through real-time image detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing, and more specifically, to a wastewater discharge detection method, detection device, and computer-readable storage medium. Background Technology

[0002] With societal development, the nation is placing increasing emphasis on environmental protection, particularly water resource conservation, which has been elevated to a national strategy. Consequently, wastewater discharge has become a serious issue that the government is cracking down on. While my country's total freshwater resources rank among the world's highest, due to its large population and uneven distribution, its per capita water resources are among the lowest globally, at just over 2,300 cubic meters, less than a quarter of the world average. To improve water utilization efficiency and protect the limited freshwater resources, necessary monitoring and management are indispensable.

[0003] Water resources are of paramount importance to humankind, and water pollution is a problem that must be addressed for national development. Finding methods to quickly and accurately investigate and monitor water source pollution is essential. Conventional wastewater monitoring primarily relies on on-site sampling and laboratory analysis. However, due to the complexity of water pollution, this method requires large-scale sampling, lacks automated detection capabilities, is labor-intensive, often suffers from inaccurate location tracking, and cannot promptly and effectively detect the discharge of wastewater. Summary of the Invention

[0004] In view of the prior art, the technical problem solved by this application is to provide a wastewater discharge detection method, detection device and computer-readable storage medium that can effectively and automatically detect wastewater discharge and save manpower.

[0005] To address the aforementioned technical problems, in a first aspect, this application provides a wastewater discharge detection method, comprising:

[0006] Obtain the image to be detected, and perform semantic segmentation on the image to obtain the emission region;

[0007] The emission area will be converted from the RGB color space to the HSV color space.

[0008] Obtain the normalized saturation histogram and the normalized brightness histogram of the emission area;

[0009] Set a probability threshold α for saturation and perform probability statistics on the saturation histogram based on the probability threshold α; set a probability threshold β for brightness and perform probability statistics on the brightness histogram based on the probability threshold β; and,

[0010] Set a wastewater assessment value μ, and compare the probability statistics with the wastewater assessment value μ to determine whether the discharge from the discharge area is wastewater.

[0011] In one possible implementation, the normalized saturation histogram is: in,

[0012] The normalized brightness histogram is as follows: in,

[0013] Where s0, s1, s2, ..., s L X represents the discrete saturation level. s Discrete saturation random variable and X s ∈{s0,s1,s2,...,s L},t i The saturation s of the i-th level after discretizing the saturation of all pixels in the emission region. i The number of times it appears, p(X) s =s i ) is the level s i The frequency; V represents the discrete brightness level. s Discretized saturation random variable and m i The brightness v of the i-th level after discretizing the brightness of all pixels in the emission area. i The number of times it appears, p(X) v =v i ) is level v j The frequency, L is the total number of discrete saturation levels or the total number of discrete brightness levels.

[0014] In one possible implementation, the saturation histogram is statistically analyzed based on a probability threshold α as follows:

[0015] Based on the probability threshold β, the probability statistics of the brightness histogram are as follows:

[0016] in, For all probabilities p(X) where the saturation level is less than or equal to the probability threshold α. s =s i ); p(X) represents all probabilities of brightness level being greater than or equal to the probability threshold β. v =v i ) and.

[0017] In one possible implementation, comparing the probability statistics with the wastewater assessment quantity μ to determine whether the discharge from the discharge area is wastewater specifically involves:

[0018] If P(X) s ≤α) and P(X v If at least one of the two statistical results is less than or equal to μ, then the discharge area is discharging wastewater.

[0019] In one possible implementation, the probability threshold α is 0.2 and the probability threshold β is 0.8.

[0020] In one possible implementation, the wastewater assessment value μ is 0.8.

[0021] In one possible implementation, converting the emission region from the RGB color space to the HSV color space specifically involves:

[0022] The saturation value of any pixel (x, y) in the emission region is:

[0023]

[0024] The brightness value of any pixel (x, y) in the emission area is:

[0025] v(x,y)=Cmax,v(x,y)∈[0,1];

[0026] Among them, Cmax=max(R′(x,y),G′(x,y),B′(x,y)),

[0027] Cmin=min(R′(x,y),G′(x,y),B′(x,y)), Δ=Cmax-Cmin; R′=R(x,y) / 255, B′=B(x,y) / 255, G′=G(x,y) / 255;

[0028] Where R(x,y), G(x,y) and B(x,y) are the values ​​of the red, green and blue channels of the pixel (x,y) respectively, Cmax is the maximum value among R′(x,y), G′(x,y) and B′(x,y), and Cmin is the minimum value among R′(x,y), G′(x,y) and B′(x,y).

[0029] In one possible implementation, the BiSeNet segmentation network and the LeakyReLU activation function are used to perform semantic segmentation on the image to be detected.

[0030] This application also provides a wastewater discharge detection device, which includes a camera, a memory, a processor, and a monitoring platform. The camera is used to acquire images to be detected. The processor is connected to the memory, the camera, and the monitoring platform. The memory is used to store executable code, and the processor is used to execute the executable code in the memory. When the processor executes the executable code, it implements the steps of the wastewater discharge detection method.

[0031] This application also provides a computer-readable storage medium storing program code that, when run on a computer, causes the computer to perform the steps of the wastewater discharge detection method.

[0032] In this wastewater discharge detection method, device, and computer-readable storage medium, an image to be detected is acquired, semantic segmentation is performed on the image to obtain the discharge area, and threshold probability statistics are calculated for the saturation and brightness of the discharge area. Finally, the probability statistics results are compared with the wastewater assessment value μ to determine whether the discharge area contains wastewater. This wastewater discharge detection method is based on real-time image processing and can automatically detect whether the discharge is wastewater in a timely and effective manner, saving manpower through real-time image detection. Attached Figure Description

[0033] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0034] Figure 1 This is an overall flowchart of the wastewater discharge detection method according to an embodiment of this application;

[0035] Figure 2 This is a sample image of wastewater discharge to be inspected according to an embodiment of this application.

[0036] Figure 3 Examples of embodiments of this application Figure 2 Normalized saturation histogram;

[0037] Figure 4 Examples of embodiments of this application Figure 2 Normalized brightness histogram;

[0038] Figure 5 For the purposes of this application's embodiments Figure 2 Semantic segmentation is performed to obtain the resulting map of the emission region. Detailed Implementation

[0039] To make the technical problems, technical solutions, and beneficial effects to be solved by this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and are not intended to limit the scope of this application.

[0040] It should be noted that when a component is referred to as being "fixed to" or "set on" another component, it can be directly on or indirectly on that other component. When a component is referred to as being "connected to" another component, it can be directly connected to or indirectly connected to that other component.

[0041] It should be understood that the terms "length", "width", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this application.

[0042] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, "multiple" means two or more, unless otherwise explicitly specified.

[0043] The wastewater discharge detection method, detection device, and computer-readable storage medium of this application will now be described in detail with reference to the accompanying drawings.

[0044] Please refer to Figure 1 The wastewater discharge detection method provided in this application includes the following steps:

[0045] Step S100: Obtain the image to be detected, and perform semantic segmentation on the image to be detected to obtain the emission region; the image to be detected can be obtained in real time through a monitoring camera.

[0046] Step S200: Convert the emission area from RGB color space to HSV color space.

[0047] Step S300: Obtain the normalized saturation histogram of the emission area.

[0048] Step S400: Obtain the normalized brightness histogram of the emission area.

[0049] Step S500: Set a probability threshold α for saturation and perform probability statistics on the saturation histogram based on the probability threshold α.

[0050] Step S600: Set a probability threshold β for brightness and perform probability statistics on the brightness histogram based on the probability threshold β.

[0051] Step S700: Set the wastewater assessment quantity μ, and compare the probability statistics results with the wastewater assessment quantity μ to determine whether the discharge from the discharge area is wastewater.

[0052] Further, in step S200, the discharge area is converted from the RGB color space to the HSV color space. Converting to the HSV color space is more visually appealing to the human eye in judging wastewater. Specifically, the formula for calculating the saturation value of any pixel (x, y) in the discharge area is: s(x,y)∈[0,1]; and the formula for calculating the brightness value of any pixel (x,y) in the emission area is: v(x,y)=Cmax,v(x,y)∈[0,1]. Where, Cmax=max(R′(x,y),G′(x,y),B′(x,y)), Cmin=min(R′(x,y),G′(x,y),B′(x,y)),Δ=Cmax-Cmin; R′=R(x,y) / 255,B′=B(x,y) / 255,G′=G(x,y) / 255.

[0053] In the above steps, R(x,y), G(x,y) and B(x,y) are the values ​​of the red, green and blue channels of the pixel (x,y) respectively, Cmax is the maximum value among R′(x,y), G′(x,y) and B′(x,y), and Cmin is the minimum value among R′(x,y), G′(x,y) and B′(x,y).

[0054] Further, in step S300, the normalized saturation histogram is as follows: in, Among them, s0, s1, s2, ..., s L X represents the discrete saturation level. s Discrete saturation random variable and X s ∈{s0,s1,s2,...,s L},t i The saturation s of the i-th level after discretizing the saturation of all pixels in the emission region. i The number of times it appears, p(X) s =s i ) is the level s iThe frequency of ; L is the total number of discrete saturation levels. Wherein, Figure 2 To obtain an image to be detected, Figure 3 The result is the normalized saturation histogram. Figure 3 In the diagram, the horizontal axis represents the saturation level i = 0, 1, ..., L-1, and the vertical axis represents p(X). s =s i ).

[0055] Further, in step S400, the normalized brightness histogram is as follows: in, V represents the discrete brightness level. s Discrete saturation random variable and V s ∈ m i The brightness v of the i-th level after discretizing the brightness of all pixels in the emission area. i The number of times it appears, p(X) v =v i ) is level v j The frequency of , where L is the total number of discrete brightness levels. Figure 4 The image shows the normalized brightness histogram results. Figure 4 In the diagram, the horizontal axis represents the brightness level i = 0, 1, ..., L-1, and the vertical axis represents p(X). v =v j ).

[0056] Understandably, in the above steps, the emission region obtained by semantic segmentation is first converted to HSV color space to obtain the brightness and saturation of the emission region; the saturation of the emission region is discretized to obtain the L-level saturation level, and then a normalized saturation histogram is obtained, where discretizing the saturation is the same as discretizing the result of s(x,y); at the same time, the brightness of the emission region is discretized to obtain the L-level brightness level, and then a normalized brightness histogram is obtained, where discretizing the brightness is the same as discretizing the result of v(x,y).

[0057] Further, in step S500, the saturation histogram is statistically analyzed based on the probability threshold α as follows: in, For all probabilities p(X) where the saturation level is less than or equal to the probability threshold α. s =s i ) and.

[0058] Further, in step S600, the brightness histogram is statistically analyzed based on the probability threshold β as follows: in, p(X) represents all probabilities of brightness level being greater than or equal to the probability threshold β. v =v i ) and.

[0059] In one embodiment, the probability threshold α is 0.2 and the probability threshold β is 0.8. In another embodiment, adjustments can be made based on the sewage discharge situation to better detect sewage.

[0060] Further, in step S700, if P(X) s ≤α) and P(X v If at least one of the two statistical results (≥β) is less than or equal to μ, then the discharge area is discharging wastewater. In one embodiment of the application, the wastewater assessment quantity μ is 0.8. Figure 2 The probability statistics of the image to be detected are as follows: P(X) s ≤α)≈0.6065P(X v ≥β)≈0.0068, therefore P(X) s ≤α) and P(X v ≥β) are all less than μ, therefore Figure 2 The discharge area shown is discharging wastewater.

[0061] Furthermore, in step S100, the BiSeNet segmentation network and the LeakyReLU activation function are used to perform semantic segmentation on the image to be detected. Because sewage discharge can mix with other water qualities, detecting the discharge area first helps to more accurately determine whether sewage has been discharged. When using the BiSeNet segmentation network to detect the discharge area, LeakyReLU is used as the activation function. During the backpropagation process of the BiSeNet segmentation network, gradients can be calculated for the parts of the LeakyReLU activation function input that are less than zero, instead of setting all values ​​less than zero to 0 as with the ReLU activation function. The LeakyReLU activation function ensures that information is not completely lost when the input information is less than 0.

[0062] It is worth noting that in the masking results obtained by semantic segmentation of the image to be detected using the BiSeNet segmentation network and the LeakyReLU activation function, the background region is set to 0, and the foreground region of sewage discharge is set to 1. Among these, Figure 5 To Figure 2 The discharge area is obtained after semantic segmentation. The discharge area can be understood as the drainage area of ​​a water pipe.

[0063] In the wastewater discharge detection method, within the wastewater discharge detection method, detection device, and computer-readable storage medium, an image to be detected is acquired, the image is semantically segmented to obtain the discharge area, and threshold probability statistics are performed on the saturation and brightness of the discharge area. Finally, the probability statistics result is compared with the wastewater assessment value μ to determine whether the discharge area contains wastewater. This wastewater discharge detection method performs real-time image processing, enabling timely and effective automatic detection of whether the discharge is wastewater, saving manpower through real-time image detection. Furthermore, since this wastewater discharge detection method uses two probability thresholds and a wastewater assessment threshold for wastewater detection, the threshold parameters can be adjusted in real-time, allowing the wastewater detection method to adapt to different scenarios based on actual conditions.

[0064] This application provides a wastewater discharge detection device, which includes a camera, a memory, a processor, and a monitoring platform. The camera is used to acquire images to be detected. The processor is connected to the memory, the camera, and the monitoring platform. The memory is used to store executable code, and the processor is used to execute the executable code in the memory. When the processor executes the executable code, it implements the steps of the wastewater discharge detection method.

[0065] The memory can be used to store the computer programs and / or modules. The processor implements various functions of the computer device by running or executing the computer programs and / or modules stored in the memory and calling data stored in the memory. The memory may mainly include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function, etc.; the data storage area may store data created based on the use of the mobile phone, etc. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, RAM, plug-in hard disk, smart media card (SMC), secure digital card (SD), flash card, at least one disk storage device, flash memory device, or other volatile solid-state storage device. The processor is specifically a microcontroller or DSP processor; the microcontroller may be, but is not limited to, ATMEL series microcontrollers, STM8 or STM32 microcontrollers; the DSP processor may be, but is not limited to, an AU3822UC82 signal DSP processor. The monitoring platform includes an industrial switch, computer host, display terminal, memory, and voice broadcaster.

[0066] This application also provides a computer-readable storage medium storing program code. When the computer program code is run on a computer, it causes the computer to perform the steps of the wastewater discharge detection method. The computer-readable storage medium includes various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0067] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A method for detecting wastewater discharge, characterized in that, include: Obtain the image to be detected, and perform semantic segmentation on the image to obtain the emission region; The emission area will be converted from the RGB color space to the HSV color space. Obtain the normalized saturation histogram and the normalized brightness histogram of the emission area; Set a probability threshold α for saturation and perform probability statistics on the saturation histogram based on the probability threshold α; set a probability threshold β for brightness and perform probability statistics on the brightness histogram based on the probability threshold β. as well as The normalized saturation histogram is as follows: in, The normalized brightness histogram is as follows: in, Where s0, s1, s2, ..., s L X represents the discrete saturation level. s Discrete saturation random variable and X s ∈{s0,s1,s2,...,s L },t i The saturation s of the i-th level after discretizing the saturation of all pixels in the emission region. i The number of times it appears, p(X) s =s i ) is the level s i The frequency; V represents the discrete brightness level. s Discretized saturation random variable and m i The brightness v of the i-th level after discretizing the brightness of all pixels in the emission area. i The number of times it appears, p(X) v =v i ) is level v j The frequency of L is the total number of discrete saturation levels or the total number of discrete brightness levels. Based on the probability threshold α, the probability statistics of the saturation histogram are as follows: Based on the probability threshold β, the probability statistics of the brightness histogram are as follows: in, For all probabilities p(X) where the saturation level is less than or equal to the probability threshold α. s =s i ); p(X) represents all probabilities of brightness level being greater than or equal to the probability threshold β. v =v i ); Define a wastewater assessment quantity μ, and compare the probability statistics results with the wastewater assessment quantity μ to determine whether the discharge from the discharge area is wastewater. Specifically: if P(X) s ≤α) and P(X v If at least one of the two statistical results is less than or equal to μ, then the discharge area is discharging wastewater.

2. The wastewater discharge detection method as described in claim 1, characterized in that, The probability threshold α is 0.2, and the probability threshold β is 0.

8.

3. The wastewater discharge detection method as described in claim 1, characterized in that, The wastewater assessment value μ is 0.

8.

4. The wastewater discharge detection method as described in claim 1, characterized in that, The specific steps for converting the emission area from the RGB color space to the HSV color space are as follows: The saturation value of any pixel (x, y) in the emission region is: The brightness value of any pixel (x, y) in the emission area is: v(x,y)=Cmax,v(x,y)∈[0,1]; Among them, Cmax=max(R'(x,y),G'(x,y),B'(x,y)), Cmin=min(R'(x,y),G'(x,y),B'(x,y)), Δ=Cmax-Cmin; R'=R(x,y) / 255, B'=B(x,y) / 255, G'=G(x,y) / 255; Where R(x,y), G(x,y) and B(x,y) are the values ​​of the red, green and blue channels of the pixel (x,y) respectively, Cmax is the maximum value among R'(x,y), G'(x,y) and B'(x,y), and Cmin is the minimum value among R'(x,y), G'(x,y) and B'(x,y).

5. The wastewater discharge detection method as described in claim 1, characterized in that, We use the BiSeNet segmentation network and the LeakyReLU activation function to perform semantic segmentation on the images to be detected.

6. A wastewater discharge detection device, characterized in that, The device includes a camera, a memory, a processor, and a monitoring platform. The camera is used to acquire images to be detected. The processor is connected to the memory, the camera, and the monitoring platform. The memory is used to store executable code, and the processor is used to execute the executable code in the memory. When the processor executes the executable code, it implements the steps of the wastewater discharge detection method as described in any one of claims 1 to 5.

7. A computer-readable storage medium, characterized in that, The computer-readable medium stores program code that, when executed on a computer, causes the computer to perform the wastewater discharge detection method as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • A sewage discharge detection method based on HSV color space

    CN109087363A

  • Image color processing method and device and related equipment

    CN112887582A