Wastewater filtering effect detection method and system
By calculating the diffusion similarity and reflection of the edge, the wastewater image is corrected and optimized, the problem of ripples and reflective interference of water moisture is solved, and the accuracy of the detection of wastewater filtration effects and the processing efficiency of the system are improved.
Patent Information
- Application Number
- CN202411896140.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-23
- Publication Date
- 2025-01-24
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The prior art fails to fully consider the interference of water ripples and water surface reflection on the detection results in the detection of wastewater filtration effect, resulting in low detection accuracy.
By calculating the diffusion similarity and reflection possibility of the edge, the wastewater image is corrected, the histogram equalization process is optimized, the noise is removed and the particle area is accurately identified, and finally the filtering effect is determined based on the particle size threshold.
It improves the accuracy of wastewater filtration effect detection and the processing efficiency of the system, reduces misjudgments and processing burdens, and enhances the reliability of detection results.
Smart Images

Figure CN119359700A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image data processing, and more specifically, to a method and system for detecting wastewater filtering effect. Background Art
[0002] With the acceleration of industrialization, wastewater discharge has become one of the main sources of environmental pollution. Especially in the manufacturing and chemical industries, wastewater often contains a large amount of harmful substances, such as heavy metals, grease, suspended particles and toxic chemicals, which seriously threaten the ecological environment of water bodies and human health. Therefore, real-time monitoring of wastewater treatment and its effects has become a key link in ensuring water resource security.
[0003] At present, the evaluation of wastewater treatment effects mainly relies on chemical analysis, physical analysis, and automatic detection methods based on image processing. Although chemical analysis is accurate, it is costly and has a long detection cycle; physical analysis methods such as turbidity detection can provide a certain reference, but can only reflect the rough condition of the water body and cannot effectively detect subtle pollutants and harmful substances in the water. Traditional image enhancement methods, such as histogram equalization, can improve image contrast, but often cannot perform targeted enhancement on different areas in wastewater images. It is easy to over-emphasize interference areas such as water surface reflections and water ripples during the enhancement process, while ignoring target areas such as pollutants and suspended matter, thereby affecting the accurate detection of wastewater filtration effects. Therefore, automatic detection methods based on image processing have gradually become a research hotspot in the field of wastewater filtration effect detection because of their advantages of being fast, non-destructive, and non-contact.
[0004] The patent application document with application publication number CN116823834A discloses a method for detecting wastewater treatment levels based on machine vision electrophoresis line discharge. The patent application document analyzes the metal debris area in the wastewater image of the cleaning pool, including the discrete degree of the debris, the number of clusters and their distribution, comprehensively evaluates the pollution degree of the wastewater, and provides a pollution analysis method with higher accuracy than turbidity judgment, thereby improving the accuracy of the detection of wastewater pollution in the cleaning pool.
[0005] However, although the above technical solution realizes the detection of wastewater treatment effects, the interference of water ripples and water surface reflections on the detection results is not fully considered during the wastewater image processing, resulting in the problem of low accuracy in the detection of wastewater filtration effects. Summary of the invention
[0006] In order to solve the problem of low accuracy in wastewater filtration effect detection raised in the above background technology, the present invention provides solutions in the following aspects.
[0007] In a first aspect, the present invention provides a method for detecting wastewater filtration effect, comprising: collecting a wastewater image, obtaining edges in the wastewater image; calculating the first The diffusion similarity and reflection possibility of the edge are The probability of grayscale appearing in the edge is positively correlated with the mean grayscale value of the pixel, and is negatively correlated with the maximum grayscale value of the pixel in the wastewater image. Diffusion similarity of edges , where is the number of edges in the wastewater image, For the The edge similarity between the jth edge and the jth edge, is the total number of pixels on the jth edge, For the The total number of pixels on the edge; the number of pixels on the edge based on the reflection possibility and diffusion similarity The gray value of the pixel point within the edge is corrected to obtain the corrected wastewater image; ; In the formula, Indicates The edge The corrected value of pixels, Indicates The edge The gray value of a pixel, For the The edge The value of a pixel after histogram equalization processing, To obtain the maximum value function, For the If the size of the particles in the corrected wastewater image is smaller than the set threshold, the filtering effect is considered qualified.
[0008] The above technical solution accurately evaluates the particle characteristics and reflection effects in the wastewater image by calculating edge similarity, diffusion similarity and reflection possibility. By correcting the grayscale value of any edge, the histogram equalization processing is optimized to make the image more in line with actual processing needs. Finally, by setting the particle size threshold, it is ensured that the filtration effect is qualified only when the particle size is qualified, thereby improving the evaluation accuracy of the wastewater filtration effect and the processing efficiency of the system.
[0009] Furthermore, the edge similarity is: ; In the formula, For the The edge similarity between the jth edge and the jth edge, For the The angle between the gradient direction of an edge and the horizontal direction, is the angle between the gradient direction of the jth edge and the horizontal direction, For the The standard deviation of the distance between the pixels corresponding to the jth edge and the jth edge, For the The mean curvature of all pixels on the edge, represents the mean curvature of all pixels on the jth edge, is a natural constant.
[0010] The above technical solution accurately evaluates the similarity between any edge and other edges in the wastewater image by introducing an edge similarity calculation method based on gradient direction, standard deviation of pixel distance and mean curvature. By combining the angular difference of gradient direction and the change of curvature, the morphological characteristics of the edge can be captured more accurately, thereby improving the accuracy of edge recognition and matching. At the same time, the standard deviation of pixel distance is used to enhance the sensitivity of similarity calculation to spatial distribution, ensuring that the evaluation of edge similarity is more refined and reliable in complex environments.
[0011] Furthermore, the reflection possibility is: ; In the formula, For the The reflectivity of the edges, For the Gray levels within the edge The probability of occurrence, is the number of gray levels, For the The mean gray value of the pixels within the edge, It is the maximum gray value of the pixel in the wastewater image.
[0012] The above technical solution quantifies the reflective characteristics of any edge by calculating the reflective possibility, taking into account the probability of grayscale distribution and the relationship between the mean and maximum values of the grayscale value. By introducing the logarithmic weighting of the grayscale and the ratio of the mean and maximum values, it can effectively reflect the light intensity and reflective characteristics in the image, especially in the processing of wastewater images, accurately evaluate the reflective area in the image. This method improves the accuracy of reflective area recognition, and by adjusting the weight of grayscale information, it captures the illumination changes in the image more carefully, providing a more accurate basis for the subsequent wastewater filtration effect analysis, thereby enhancing the robustness and accuracy of the entire image processing system.
[0013] Furthermore, it also includes clustering the edges in the wastewater image using a mean shift clustering algorithm, measuring the edge lengths, and discarding the edges whose edge lengths are less than a set length threshold.
[0014] The above technical solution clusters the edges in the wastewater image through the mean shift clustering algorithm, thereby effectively identifying and grouping similar edge features. By measuring the edge length and discarding the edges that are less than the set length threshold, it is possible to remove noise and irrelevant details in the image and retain important edge information. This method improves the accuracy and efficiency of image processing, ensures that only edges with practical significance are subsequently analyzed, thereby optimizing the edge recognition and filtering effect evaluation of wastewater images, and reducing misjudgment and processing burden.
[0015] Furthermore, the size of the particles in the corrected wastewater image is obtained, specifically: the corrected wastewater image is converted into a grayscale image and binarized; the particles in the image are marked and segmented through connected domain analysis, the independent region of each particle is identified, and the area of each particle region is calculated as the size of the particle.
[0016] The above technical solution effectively simplifies the detailed information in the image and makes the particles more prominent by converting the corrected wastewater image into a grayscale image and performing binarization processing. By marking and segmenting the particles through connected domain analysis, the independent area of each particle in the image can be accurately identified, and the area of each particle can be calculated as its size. This method not only improves the accuracy of particle detection, but also effectively distinguishes different particles in complex wastewater images, providing more reliable particle size information, and thus providing clear and accurate data support for the evaluation of wastewater filtration effects. This solution optimizes the particle analysis process and improves the system's ability to automatically detect and evaluate wastewater treatment effects.
[0017] Furthermore, a CMOS camera or a CCD camera is used to collect wastewater images.
[0018] Furthermore, the method also includes graying and denoising the wastewater image.
[0019] In a second aspect, the present invention provides a wastewater filtration effect detection system, comprising a memory and a processor, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, any one of the above wastewater filtration effect detection methods is implemented.
[0020] The beneficial effects of the present invention are: The present invention accurately evaluates the edges in the wastewater image by calculating edge similarity, diffusion similarity and reflection possibility, and corrects the grayscale value of any edge in combination with histogram equalization to ensure the processing quality of the image. Secondly, the mean shift clustering algorithm is used to remove noise and enhance the extraction of effective edge information. At the same time, the particle size is accurately measured with the help of connected domain analysis to ensure that the determination of the filtering effect is more reliable, effectively improving the automation, accuracy and reliability of wastewater filtering effect detection, and has good adaptability and engineering application. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] By reading the following detailed description with reference to the accompanying drawings, the above and other objects, features and advantages of the exemplary embodiments of the present invention will become readily understood. In the accompanying drawings, several embodiments of the present invention are shown in an exemplary and non-limiting manner, and the same or corresponding reference numerals represent the same or corresponding parts, wherein: Figure 1 is a flow chart schematically showing a method for detecting wastewater filtration effect according to an embodiment of the present invention; Figure 2 is a grayscale image schematically showing a wastewater image according to an embodiment of the present invention; Figure 3 It is a structural block diagram schematically showing a wastewater filtration effect detection system according to an embodiment of the present invention. DETAILED DESCRIPTION
[0022] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0023] The specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0024] An embodiment of a method for detecting wastewater filtration effect.
[0025] like Figure 1 As shown, a flow chart of a method for detecting wastewater filtration effect according to an embodiment of the present invention includes the following steps: S1: Collecting a wastewater image and obtaining edges in the wastewater image.
[0026] In one embodiment, the wastewater image is collected using a CMOS camera or a CCD camera, which can give full play to the characteristics of the two imaging technologies to meet the requirements of different application scenarios for imaging quality, speed and cost. CMOS cameras have the advantages of low power consumption, high-speed imaging and flexible integration, and are suitable for scenarios with high real-time requirements, such as dynamic monitoring of particle changes during wastewater filtration; at the same time, the noise suppression technology of the CMOS sensor enables it to maintain good image quality under low light conditions, which is conducive to accurately capturing the information of tiny particles in wastewater. CCD cameras have excellent detail performance in image acquisition with their high sensitivity and low noise performance, and can capture subtle differences in particles in wastewater and ensure the uniformity and stability of the image, thereby providing higher quality raw data for subsequent image processing and feature extraction. By combining the imaging characteristics of CMOS and CCD cameras, appropriate equipment can be flexibly selected according to actual needs, while taking into account image quality, acquisition efficiency and economy, providing reliable technical support for wastewater image processing, which helps to improve the accuracy and robustness of wastewater filtration effect evaluation.
[0027] In this embodiment, the wastewater image needs to be grayscaled first, and the color image is converted into a grayscale image to simplify the subsequent image analysis and improve the computational efficiency. Grayscale processing can effectively reduce the complexity of the image, so that the focus is on the brightness changes of the image, which helps to accurately extract particles and edge features. Then, a denoising algorithm is used to process the grayscale image to remove noise and irrelevant details in the image to ensure clearer image quality. Denoising processing can significantly improve the recognizability of the image and reduce the interference of noise on particle detection and filtering effect determination.
[0028] like Figure 2 As shown, a grayscale image of a wastewater image according to an embodiment of the present invention.
[0029] In one embodiment, the Sobel operator or Canny operator edge detection may be used to extract the edges in the wastewater image.
[0030] S2: Calculate the diffusion similarity and reflection possibility of any edge.
[0031] In one embodiment, the reflectivity is: ; In the formula, For the The reflectivity of the edges, For the Gray levels within the edge The probability of occurrence, is the number of gray levels, For the The mean gray value of the pixels within the edge, It is the maximum gray value of the pixel in the wastewater image.
[0032] By combining the probability distribution of grayscale with the grayscale mean of any edge area, the reflective probability is calculated, which effectively reflects the reflective characteristics of the edge area of the image. Specifically, the probability of each grayscale level appearing in any edge and its corresponding logarithmic value can capture the discreteness and complexity of the grayscale distribution in the image, and by normalizing it with the ratio of the maximum grayscale value in the image, the adaptability of this method to different lighting and grayscale range changes is enhanced. This calculation method can not only highlight the brightness difference of the reflective area, but also reduce the interference of external factors, thereby improving the accuracy and robustness of reflective detection, and is suitable for the evaluation of reflective areas in wastewater images.
[0033] In another embodiment, the reflectivity is: ; In the formula, For the The reflectivity of the edges, For the Gray levels within the edge The probability of occurrence, is the number of gray levels, For the The mean gray value of the pixels within the edge, is the maximum gray value of the pixel in the wastewater image, For the The standard deviation of the color distribution within an edge, such as the color distribution in RGB or HSV color space, is the maximum value of the standard deviation of color distribution in the wastewater image.
[0034] By introducing the standard deviation of color distribution and combining it with the grayscale distribution characteristics, the calculation accuracy of the reflection possibility is further improved. Compared with the traditional reflection calculation method that only relies on grayscale information, this scheme not only considers the distribution of grayscale levels and brightness changes in the image, but also incorporates the discrete degree of color distribution into the calculation of reflection possibility, so that it can more comprehensively capture the lighting changes and reflection effects in the image.
[0035] In one embodiment, Diffusion similarity of edges , where is the number of edges in the wastewater image, For the The edge similarity between the jth edge and the jth edge, is the total number of pixels on the jth edge, For the The total number of pixels on the edge.
[0036] The diffusion similarity is introduced to quantify the similarity and spatial distribution relationship between different edges in the wastewater image. Specifically, the diffusion similarity not only considers the similarity between any edge and other edges, but also takes the total number of pixels of each edge as a weight factor, further strengthening the consistency of the spatial distribution of the edge. By normalizing the difference in the total number of pixels, this method can effectively eliminate the influence of the edge size difference in the image on the similarity calculation, and enhance the accuracy of the similarity measurement between edges.
[0037] In one embodiment, the edge similarity is: ; In the formula, For the The edge similarity between the jth edge and the jth edge, For the The angle between the gradient direction of an edge and the horizontal direction, is the angle between the gradient direction of the jth edge and the horizontal direction, For the The standard deviation of the distance between the pixels corresponding to the jth edge and the jth edge, For the The mean curvature of all pixels on the edge, represents the mean curvature of all pixels on the jth edge, is a natural constant.
[0038] The above scheme effectively combines multi-dimensional features such as gradient direction, curvature distribution and distance between pixels to comprehensively evaluate the similarity between edges. Specifically, the cosine function is used to quantify the similarity of gradient direction to ensure that edges with higher directional consistency obtain higher similarity; the information of edge morphology and spatial distribution is further introduced through the difference in curvature mean and the standard deviation of pixel distance, and the exponential function is used to suppress the edge similarity due to large morphological differences and spatial deviations. This method significantly improves the robustness and accuracy of edge similarity calculation, especially in scenes with complex edges, it can better match any edge with similar edges, thereby improving the overall image feature analysis and processing effect.
[0039] In another embodiment, the similarity of two edges may be calculated by chamfer distance.
[0040] It should be noted that the chamfer distance is a well-known technology and will not be described in detail here.
[0041] S3: Correct the grayscale value of the pixel within any edge based on the reflection possibility and diffusion similarity.
[0042] In one embodiment, the correction formula is: ; In the formula, Indicates The edge The corrected value of pixels, Indicates The edge The gray value of a pixel, For the The edge The value of a pixel after histogram equalization processing, To obtain the maximum value function, To calculate the The possibility of reflection at each edge.
[0043] By introducing a correction formula to adjust the grayscale value of any edge pixel, the effect of histogram equalization processing is optimized. This method can dynamically adjust the change amplitude of the pixel grayscale value according to the reflection intensity and edge similarity, thereby balancing the brightness expansion effect caused by histogram equalization and effectively retaining image details. This technical solution effectively improves the image quality after histogram equalization and reduces the loss of details caused by excessive enhancement or distortion. In particular, in the reflective area and edge details of the wastewater image, the pixel grayscale value can be corrected more accurately, thereby improving the visual effect and analysis accuracy of the image, which is especially suitable for wastewater image processing in complex environments.
[0044] S4: If the size of the particles in the corrected wastewater image is smaller than the set threshold, the filtering effect is determined to be qualified.
[0045] The threshold value can be set to 5 microns. Of course, it can also be determined according to actual conditions to adapt to different wastewater treatment requirements and particle types. By accurately setting the particle size threshold, the filtering effect can be effectively quantified to ensure that the particles in the image are accurately identified and filtered out, avoiding wastewater treatment that does not meet standards due to excessively large particles.
[0046] In this embodiment, when the filtration effect is judged to be unqualified, the system can immediately notify the staff through alarms, text messages, etc., to ensure that the problem can be handled in a timely manner and appropriate measures can be taken. This real-time reminder mechanism not only improves the automation level of the wastewater treatment system, but also enhances the response speed during the treatment process, reduces potential treatment risks, and thus effectively improves the overall treatment efficiency and safety.
[0047] The solution of the present invention effectively evaluates the particle characteristics and filtering effect in the wastewater image through the comprehensive analysis of accurate edge similarity calculation, diffusion similarity and reflection possibility. The mean shift clustering algorithm is used to optimize edge recognition, discard irrelevant edges, and improve the efficiency and accuracy of image processing. By graying, denoising and calculating the particle size of the image, the particle area can be accurately identified and segmented, providing a reliable basis for the determination of the filtering effect. At the same time, the system uses CMOS or CCD cameras to collect images, ensuring high-quality input of image data, and finally realizing accurate detection and automatic evaluation of wastewater filtration effects. This technical solution greatly improves the automation level of wastewater treatment and the accuracy of effect evaluation, and has great application prospects and technical value.
[0048] A wastewater filtration effect detection system embodiment: like Figure 3 As shown, a structural block diagram of a wastewater filtration effect detection system according to an embodiment of the present invention includes a processor and a memory.
[0049] The present invention also provides a wastewater filtration effect detection system. Figure 3 As shown, the system includes a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, a method for detecting wastewater filtration effect according to the present invention described above is implemented.
[0050] The wastewater filtration effect detection system also includes other components familiar to those skilled in the art, such as a communication interface, and its settings and functions are known in the art, so they will not be described in detail here.
[0051] In the present invention, the aforementioned memory may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, apparatus or device. For example, a computer-readable storage medium may be any appropriate magnetic storage medium or magneto-optical storage medium, such as a resistive random access memory RRAM (Resistive Random Access Memory), a dynamic random access memory DRAM (Dynamic Random Access Memory), a static random access memory SRAM (Static Random-Access Memory), an enhanced dynamic random access memory EDRAM (Enhanced Dynamic Random Access Memory), a high-bandwidth memory HBM (High-Bandwidth Memory), a hybrid memory cube HMC (Hybrid Memory Cube), etc., or any other medium that can be used to store the required information and can be accessed by an application, a module, or both. Any such computer storage medium may be part of a device or accessible or connectable to a device. Any application or module described in the present invention may be implemented using computer-readable / executable instructions that may be stored or otherwise maintained by such a computer-readable medium.
[0052] In the description of this specification, "plurality" or "several" means at least two, such as two, three or more, etc., unless otherwise clearly and specifically defined.
[0053] Although this specification has shown and described a number of embodiments of the present invention, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Those skilled in the art will conceive of many modifications, changes and alternatives without departing from the ideas and spirit of the present invention. It should be understood that in the practice of the present invention, various alternatives to the embodiments of the present invention described herein may be employed.
Claims
1. A method for detecting wastewater filtration effect, characterized in that: include: Collecting a wastewater image and obtaining an edge in the wastewater image; Calculate the The diffusion similarity and reflection possibility of the edge are The probability of grayscale occurrence within an edge is positively correlated with the mean grayscale value of the pixel, and negatively correlated with the maximum grayscale value of the pixel in the wastewater image. No. Diffusion similarity of edges , where is the number of edges in the wastewater image, For the The edge similarity between the jth edge and the jth edge, is the total number of pixels on the jth edge, For the The total number of pixels on the edge; Based on the reflection possibility and diffusion similarity, the The gray value of the pixel point within the edge is corrected to obtain the corrected wastewater image; ; In the formula, Indicates The edge The corrected value of pixels, Indicates The edge The gray value of a pixel, For the The edge The value of a pixel after histogram equalization processing, To obtain the maximum value function, For the The reflectivity of each edge; If the size of the particles in the corrected wastewater image is smaller than the set threshold, the filtering effect is judged to be qualified.
2. A method for detecting wastewater filtration effect according to claim 1, characterized in that: The edge similarity is: ; In the formula, For the The edge similarity between the jth edge and the jth edge, For the The angle between the gradient direction of an edge and the horizontal direction, is the angle between the gradient direction of the jth edge and the horizontal direction, For the The standard deviation of the distance between the pixels corresponding to the jth edge and the jth edge, For the The mean curvature of all pixels on the edge, represents the mean curvature of all pixels on the jth edge, is a natural constant.
3. A method for detecting wastewater filtration effect according to claim 1, characterized in that: The reflectivity is: ; In the formula, For the The reflectivity of the edges, For the Gray levels within the edge The probability of occurrence, is the number of gray levels, For the The mean gray value of the pixels within the edge, It is the maximum gray value of the pixel in the wastewater image.
4. A method for detecting wastewater filtration effect according to claim 1, characterized in that: The method further includes clustering the edges in the wastewater image using a mean shift clustering algorithm, measuring the edges according to their lengths, and discarding the edges whose lengths are less than a set length threshold.
5. A method for detecting wastewater filtration effect according to claim 1, characterized in that: The size of the particles in the corrected wastewater image is obtained, specifically: Convert the corrected wastewater image into a grayscale image and perform binarization processing; The particles in the image are marked and segmented through connected domain analysis, the independent region of each particle is identified, and the area of each particle region is calculated as the size of the particle.
6. A method for detecting wastewater filtration effect according to claim 1, characterized in that: Use CMOS camera or CCD camera to capture wastewater images.
7. A method for detecting wastewater filtration effect according to claim 1, characterized in that: The method also includes graying and denoising the wastewater image.
8. A wastewater filtration effect detection system, characterized in that: It comprises a memory and a processor, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, a method for detecting the effect of wastewater filtration as described in any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Wastewater treatment grade detection method based on machine vision electrophoresis line discharge
CN116823834A