CN-115049680-B - Sewage discharge detection method, detection device and computer readable storage medium
Abstract
The application discloses a sewage discharge detection method which comprises the steps of carrying out semantic segmentation on a picture to be detected to obtain a discharge area, converting the discharge area into an HSV color space from an RGB color space, obtaining a normalized saturation histogram and a normalized brightness histogram of the discharge area, setting a probability threshold alpha related to saturation, carrying out probability statistics on the saturation histogram according to the probability threshold alpha, setting a probability threshold beta related to brightness, carrying out probability statistics on the brightness histogram according to the probability threshold beta, setting a sewage evaluation value mu, and comparing a probability statistics result with the sewage evaluation value mu to judge whether the discharge area discharges sewage or not. The sewage discharge detection method is based on real-time processing of images, can timely and effectively automatically detect whether the discharged sewage is or not, and can save manpower through real-time detection of the images.
Inventors
- LI QIU
- ZHU GUANGQIANG
- WANG HEPING
- LUO FUZHANG
- LAI SHIWU
Assignees
- 盛视科技股份有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20220530
Claims (7)
- 1. A sewage discharge detection method, characterized by comprising: Acquiring a picture to be detected, and performing semantic segmentation on the picture to be detected to obtain an emission area; Converting the discharge area from an RGB color space to an HSV color space; Acquiring a normalized saturation histogram and a normalized brightness histogram of the emission area; setting a probability threshold value alpha for saturation and probability statistics of the saturation histogram according to the probability threshold value alpha, setting a probability threshold value beta for brightness and probability statistics of the brightness histogram according to the probability threshold value beta, and The normalized saturation histogram is: Wherein, the The normalized brightness histogram is: Wherein, the Wherein s 0 ,s 1 ,s 2 ,...,s L is the discrete saturation level, X s is the random variable of the discrete saturation, X s ∈{s 0 ,s 1 ,s 2 ,...,s L },t i is the number of occurrences of the saturation s i of the ith level after the saturation of all pixels of the discharge area is discrete, and p (X s =s i ) is the frequency of the level s i ; v s random variable of saturation after discretization for brightness level after discretization M i is the number of occurrences of brightness v i of the ith level after the brightness of all pixels of the emission area is discretized, p (X v =v i ) is the frequency of the level v j , L is the total number of saturation levels after discretization or the total number of brightness levels after discretization; probability statistics of the saturation histogram according to the probability threshold α is: The probability statistics of the brightness histogram according to the probability threshold beta is as follows: Wherein, the Is the sum of all probabilities p (X s =s i ) with a saturation level less than or equal to the probability threshold α; the sum of all probabilities p (X v =v i ) that are brightness levels greater than or equal to the probability threshold β; Setting a sewage evaluation value mu, and comparing the probability statistical result with the sewage evaluation value mu to judge whether the sewage is discharged from the discharge area, wherein the sewage is discharged from the discharge area if at least one of two statistical results of P (X s is less than or equal to alpha) and P (X v is less than or equal to beta) is less than or equal to mu.
- 2. The wastewater discharge detection method according to claim 1, wherein the probability threshold α is 0.2 and the probability threshold β is 0.8.
- 3. The sewage discharge detection method as claimed in claim 1, wherein the sewage evaluation value μ is 0.8.
- 4. The sewage discharge detection method according to claim 1, wherein converting the discharge area from RGB color space to HSV color space is specifically: The saturation value of any pixel point (x, y) of the discharge area is: the brightness value of any pixel point (x, y) of the emission area is: v(x,y)=Cmax,v(x,y)∈[0,1]; Wherein 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; Wherein R (x, y), G (x, y) and B (x, y) are respectively red, green and blue three-channel values of the pixel point (x, y), cmax is the maximum value of R '(x, y), G' (x, y) and B '(x, y), cmin is the minimum value of R' (x, y), G '(x, y) and B' (x, y).
- 5. The wastewater discharge detection method according to claim 1, wherein the picture to be detected is semantically segmented using BiSeNet segmentation network and LeakyReLU activation function.
- 6. A sewage discharge detection device, characterized by comprising a camera, a memory, a processor and a monitoring platform, wherein the camera is used for acquiring pictures to be detected, the processor is connected with the memory, the camera and the monitoring platform, the memory is used for storing executable codes and the processor is used for executing the executable codes of the memory, and the steps of the sewage discharge detection method according to any one of claims 1 to 5 are realized when the processor tries on the executable codes.
- 7. A computer readable storage medium, characterized in that the computer readable medium stores a program code which, when run on a computer, causes the computer to perform the sewage discharge detection method according to any one of claims 1 to 5.
Description
Sewage discharge detection method, detection device and computer readable storage medium Technical Field The present application relates to the field of image processing, and more particularly, to a sewage discharge detection method, a detection apparatus, and a computer-readable storage medium. Background With the development of society, the country has paid more and more attention to environmental protection, and in particular, the protection of water resources has been promoted to the national strategy. Therefore, the sewage discharge becomes a national powerful striking behavior. The total fresh water resources in China are in front of the world, but the occupation of the water resources is at the world end level due to the factors of population, distribution difference and the like, and the occupation of the water resources is only 2300 cubic meters, which is less than one quarter of the water resources of the world. In order to improve the water utilization rate and protect fresh water resources with little surplus, necessary monitoring and management are indispensable. The water resource has a great significance for human beings, the water pollution problem is a problem which is necessary to be solved by national development, and a method for rapidly and accurately investigating and monitoring the water pollution condition is necessary. Conventional sewage monitoring is mainly carried out by means of on-site sampling, indoor analysis and test and the like, but due to the complexity of water pollution, the sewage monitoring can only be carried out by a large amount of sampling methods, automatic detection cannot be carried out, labor consumption is huge, positioning is often inaccurate, and whether sewage is discharged cannot be effectively detected in time or not Disclosure of Invention Aiming at the prior art, the application solves the technical problem of providing a sewage discharge detection method, a detection device and a computer readable storage medium which can effectively and automatically detect sewage discharge and save manpower. To solve the above technical problem, in a first aspect, the present application provides a sewage discharge detection method, which includes: Acquiring a picture to be detected, and performing semantic segmentation on the picture to be detected to obtain an emission area; Converting the discharge area from an RGB color space to an HSV color space; Acquiring a normalized saturation histogram and a normalized brightness histogram of the emission area; setting a probability threshold value alpha for saturation and probability statistics of the saturation histogram according to the probability threshold value alpha, setting a probability threshold value beta for brightness and probability statistics of the brightness histogram according to the probability threshold value beta, and Setting a sewage evaluation value mu, and comparing the probability statistical result with the sewage evaluation value mu to judge whether the sewage is discharged from the discharge area. In one possible implementation, the normalized saturation histogram is: Wherein, the The normalized brightness histogram is: Wherein, the Wherein s 0,s1,s2,...,sL is the discrete saturation level, X s is the random variable of the discrete saturation, X s∈{s0,s1,s2,...,sL},ti is the number of occurrences of the saturation s i of the ith level after the saturation of all pixels of the discharge area is discrete, and p (X s=si) is the frequency of the level s i; v s random variable of saturation after discretization for brightness level after discretization M i is the number of occurrences of the i-th level of brightness v i after the brightness of all pixels of the emission area is discretized, p (X v=vi) is the frequency of the level v j, and L is the total number of the saturation levels after discretization or the total number of the brightness levels after discretization. In one possible implementation, probability statistics of the saturation histogram according to the probability threshold α is: The probability statistics of the brightness histogram according to the probability threshold beta is as follows: Wherein, the Is the sum of all probabilities p (X s=si) with a saturation level less than or equal to the probability threshold α; Is the sum of all probabilities p (X v=vi) that the brightness level is greater than or equal to the probability threshold β. In one possible implementation, the probability statistics are compared with the sewage evaluation μ to determine whether the sewage is discharged from the discharge area, specifically: If at least one of the two statistical results of P (X s. Ltoreq.alpha.) and P (X v. Gtoreq.) is smaller than or equal to mu, the sewage is discharged from the discharge area. In one possible implementation, the probability threshold α is 0.2 and the probability threshold β is 0.8. In one possible implementation, the sewage evaluation μ is 0.8. In one possibl