Disclosure of Invention
In order to solve the technical problems, the application provides a pollution discharge effect evaluation method based on a backwash water filter.
The provided pollution discharge effect evaluation method based on the back flush water filter comprises the following steps:
collecting a sewage RGB image in a sewage disposal pond of the backwash water filter, and preprocessing the sewage RGB image to obtain a sewage gray image;
performing corner detection on the sewage gray level image to obtain corner points in the sewage gray level image;
constructing a pixel window by taking each pixel point in the sewage gray level image as a center;
obtaining the sewage saturation based on the position distribution characteristics of the corner points in the pixel window;
performing edge detection on the sewage gray level image to obtain an edge contour and edge pixel points of the sewage gray level image;
constructing the edge-like length of the edge contour according to the edge starting and ending points of the edge contour and the midpoint of the edge pixel length;
analyzing the position distribution characteristics of the edge pixel points in the pixel window, and combining the edge-like length to obtain a dirt saliency index in the pixel window;
constructing a soil region confidence in a backwash water filter blowdown tank based on the soil saturation and the soil saliency index in the soil region;
modifying a similarity criterion in the K-means clustering algorithm based on the confidence level of the dirt area to obtain a modified similarity and a modified K-means clustering algorithm;
and evaluating the pollution discharge effect of the backwash water filter based on the correction K-means clustering algorithm.
In some embodiments of the present invention, obtaining the sewage saturation based on the position distribution characteristics of the corner points in the pixel window includes:
obtaining corner distances between every two corner points in the pixel window;
calculating the sum of angular point distances between every two angular points in the pixel window;
according to the sum of the angular point distances, combining the area size of the pixel window to obtain the sewage saturation degree: the ratio of the sum of the angular point distances to the size of the pixel window area.
In some embodiments of the present invention, constructing an edge-like length of the edge contour from an edge start-end point and an edge pixel length midpoint of the edge contour includes:
obtaining an edge initial point, an edge end point and an edge pixel length midpoint of the edge contour;
respectively obtaining a first Euclidean distance between the edge initial point and the midpoint of the edge pixel lengthAnd a second Euclidean distance ++between the edge endpoint and the edge pixel length midpoint>;
According to the first Euclidean distanceSaid second Euclidean distance->And the included angle formed by the midpoint of the length of the edge pixel and the connecting line of the edge initial point and the edge final point respectively +.>The edge-like length of constructing the edge profile is: the first Euclidean distance->And a second Euclidean distance->Summing and then normalizing the angle->And multiplying the values to obtain the edge-like length of the edge profile.
In some embodiments of the invention, obtaining an edge starting point, an edge ending point, and an edge pixel length midpoint of the edge profile comprises:
in the set of the edge pixel points, if the edge pixel points are eight adjacent points with only one point on the same edge contour, the edge pixel points are edge starting and ending points, and two edge starting and ending points are found out and marked as an edge starting point and an edge ending point respectively;
in the set of edge pixel points, the pixel point with the largest distance from the edge starting point and the edge ending point is marked as an edge pixel length midpoint.
In some embodiments of the invention, the normalized included angleThe value acquisition method comprises the following steps:
obtaining a third Euclidean distance between the edge initial point and the edge final point;
Based on the first Euclidean distanceSaid second Euclidean distance->And said third Euclidean distance +.>Obtaining the included angle +.>Cosine values of (2);
according to the included angleCosine value of (2) to obtain the angle->A value;
for the included angleValue normalization processing is carried out to obtain a normalized included angle +.>Values.
In some embodiments of the present invention, analyzing the position distribution characteristics of the edge pixel points in the pixel window, and combining the edge-like lengths to obtain a dirt saliency index in the pixel window, including:
obtaining a fourth Euclidean distance between an edge pixel point in the pixel window and a central pixel point of the pixel window;
calculating a fourth Euclidean distance sum of all the edge pixel points in the pixel window and the central pixel point of the pixel window;
according to the fourth Euclidean distance sum, combining the edge-like length and the pixel window area size, obtaining a dirt saliency index in the pixel window as follows:
,
wherein,WSis a significant index of contamination within the pixel window,is the firstiFourth Euclidean distance between the edge representative point and the central pixel point of the pixel window, +.>Is the firstiThe edge-like length of the individual edge profiles,kfor the number of edge representative points within a pixel window,mis the pixel window area size.
In some embodiments of the invention, the soil region confidence is a product of the soil saturation and the soil saliency index.
In some embodiments of the invention, the modified similarity is: the square of the difference between the confidence of the dirt region of the pixel point and the confidence of the dirt region of the central point of the K-means cluster.
In some embodiments of the present invention, the evaluating the pollution discharge effect of the backwash water filter based on the modified K-means clustering algorithm includes:
performing cluster analysis on the sewage gray level image by using a modified K-means clustering algorithm to obtain a clustering result;
based on the clustering result, counting the sewage coverage area in the sewage pool of the back flush water filter;
obtaining a soil coverage area occupation ratio according to the soil coverage area;
and evaluating the pollution discharge effect of the back flush water filter according to the occupation ratio of the sewage coverage area.
In some embodiments of the invention, the evaluating the pollution discharge effect of the back flush water filter according to the sewage coverage area occupation ratio comprises the following steps:
judging whether the duty ratio of the sewage coverage area is larger than or equal to a duty ratio threshold value;
if so, the pollution discharge effect of the backwashing water filter is evaluated to be better;
otherwise, evaluating the pollution discharge effect of the back flush water filter is poor.
As can be seen from the above embodiments, the sewage draining effect evaluation method based on the back flushing water filter provided by the embodiments of the present application has the following beneficial effects:
the invention acquires a sewage RGB image in a sewage pool of a backwash water filter, and preprocesses the sewage RGB image to obtain a sewage gray image; performing corner detection on the sewage gray level image to obtain corner points in the sewage gray level image; constructing a pixel window by taking each pixel point in the sewage gray level image as a center; obtaining the sewage saturation based on the position distribution characteristics of the corner points in the pixel window; performing edge detection on the sewage gray level image to obtain an edge contour and edge pixel points of the sewage gray level image; constructing the edge-like length of the edge contour according to the edge starting and ending points of the edge contour and the midpoint of the edge pixel length; analyzing the position distribution characteristics of the edge pixel points in the pixel window, and combining the edge-like length to obtain a dirt saliency index in the pixel window; constructing a soil region confidence in a backwash water filter blowdown tank based on the soil saturation and the soil saliency index in the soil region; modifying a similarity criterion in the K-means clustering algorithm based on the confidence level of the dirt area to obtain a modified similarity and a modified K-means clustering algorithm; and evaluating the pollution discharge effect of the backwash water filter based on the correction K-means clustering algorithm. The traditional evaluation of the sewage disposal effect of the back flush water filter generally judges the condition in the sewage disposal pond by using the gray level change in the image or the distance-based clustering algorithm, so that the evaluation of the sewage disposal effect of the back flush water filter is realized, but the sewage in the sewage disposal pond and the water surface cannot be accurately identified by the gray level change or the distance-based clustering algorithm, so that the sewage disposal effect is misjudged. According to the invention, the characteristics of the sewage saturation in the sewage pool of the back flush water filter and the regional texture complexity are analyzed, the sewage region confidence index is constructed, the similarity criterion in the K-means algorithm is modified, the sewage region in the sewage pool is more accurately identified from the similarity based on the sewage region confidence from the similarity based on the distance, and the accuracy of judging the sewage effect of the back flush water filter is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention as claimed.
Detailed Description
In order to make the technical solution of the present invention better understood by those skilled in the art, the technical solution of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Fig. 1 is a basic flow diagram of a sewage treatment effect evaluation method based on a back flush water filter provided in an embodiment of the present application; FIG. 2 is a schematic diagram of a basic flow chart of a method for obtaining saturation of contaminants according to an embodiment of the present application; fig. 3 is a basic flow chart of a method for obtaining a similar edge length according to an embodiment of the present application; FIG. 4 shows an included angle according to an embodiment of the present applicationA basic flow diagram of a value obtaining method; FIG. 5 is a basic flow chart of a method for obtaining a significant index of contaminants according to an embodiment of the present application; FIG. 6 is a basic flow chart of a method for evaluating the pollution discharge effect of a backwash water filter based on a modified K-means clustering algorithm provided by the embodiment of the application; fig. 7 is a schematic diagram of a triangle formed by an edge start point, an edge end point and an edge pixel length midpoint according to an embodiment of the present application. The pollution discharge effect evaluation method based on the back flush water filter provided in this embodiment will be described in detail with reference to fig. 1 to 7.
As shown in fig. 1, the sewage disposal effect evaluation method based on the back flush water filter mainly comprises the following steps:
s100: and collecting a sewage RGB image in a sewage disposal pond of the backwash water filter, and preprocessing the sewage RGB image to obtain a sewage gray image.
The working principle of the back flush water filter is as follows: the more dirt on the filter element of the back flushing filter, the difference of the water pressure difference detected by the water inlet and the water outlet is different, the control system of the back flushing filter based on the threshold value of the pressure difference gives a cleaning signal to the filter, the dirt in the filter element is sucked out by adopting a suction nozzle under the condition of ensuring that the operation is not stopped, and the dirt is converged into a sewage drain pipe and finally discharged into a sewage drain pool, so that the cleaning of the filter element is completed. The backwash water filter device has a high demand for tightness, so that it is necessary to evaluate the sewage disposal effect by the sewage coverage in the sewage disposal basin of the backwash water filter.
Based on the analysis, a CMOS camera is arranged above a drain pool at the tail end of a pipeline connected with a drain outlet of the back flush water filter, and under the condition that the light is sufficient and no other environmental interference factors exist, the drain pool is shot in a overlook mode, and a sewage RGB image in the drain pool of the back flush water filter is obtained. Converting the sewage RGB image into a gray image based on a gray value average method, denoising the gray image by means of average filtering, sharpening the gray image by means of LOG sharpening algorithm, and finally obtaining the pretreated sewage gray image.
S200: and detecting the corner points of the sewage gray level image to obtain the corner points in the sewage gray level image.
Based on the working principle of the back flushing water filter, the discharged dirt belongs to a granular liquid mixture, wherein the dirt occupies more water and the water occupies less water, and finally, solid-liquid mixed dirt is formed to be discharged and stored in a sewage disposal tank for further treatment.
If the back flush water filter works normally, the sewage draining effect is good, the sewage content in the sewage draining pool is high, the water surface occupies less water, and almost all the sewage is mixed by granular liquid. When the back flush water filter has problems or the advanced filter element cleaning caused by poor sewage disposal effect and inaccurate differential pressure detection, the sewage amount discharged from the sewage pipe occupies a large amount, most of the sewage is liquid discharged into the sewage disposal tank, and only part of sewage floats on the water surface or is completely free of sewage, so that the sewage disposal effect of the back flush water filter is poor. Many types of dirt are solid particles, the texture structure of the formed dirt surface is complex, and the water surface area is relatively smoother.
And carrying out Harris corner detection on the sewage gray level image based on the characteristics to obtain the corner in the sewage gray level image. For the water surface, the more the corner points are, the more solid particle dirt is, and the greater the coverage degree of the water surface is.
S300: and constructing a pixel window by taking each pixel point in the sewage gray level image as a center.
And constructing a 15×15 pixel window by taking each pixel point in the sewage gray level image as a center.
S400: and obtaining the sewage saturation based on the position distribution characteristics of the corner points in the pixel window.
As shown in fig. 2, in some embodiments of the present invention, the sewage saturation is obtained based on the position distribution characteristics of the corner points in the pixel window, and the steps S401 to S403 are as follows.
S401: and obtaining the corner distance between every two corner points in the pixel window.
Connecting all the corner points in the pixel window to obtain a plurality of line segments, and solving the length of the line segments, namely the corner point distance between every two corner points in the pixel window,/>Is the number of corner distances in the pixel window.
S402: and calculating the sum of the corner distances between every two of all the corners in the pixel window.
S403: and according to the sum of the angular point distances, combining the area size of the pixel window to obtain the sewage saturation of the sewage.
According to the sum of angular point distances, combining the area size of the pixel window to obtain the sewage saturationThe method comprises the following steps: angular point distance sum and imageThe ratio of the size of the pixel window, namely:
wherein,LBin order for the degree of saturation of the soil,is the first in the pixel windowiThe distance between the individual corner points,mfor the size of the area of the pixel window,nis the number of corner distances in the pixel window.
When the dirt saturation degreeLBThe larger the pixel window, the more the water surface dirt content is; when the dirt saturation degreeLBThe smaller the water surface soil content within the pixel window, the less.
S500: and carrying out edge detection on the sewage gray level image to obtain the edge contour and the edge pixel point of the sewage gray level image.
Because the solid particle dirt has different shapes and sizes, the influence on the texture of the water surface is larger, when the dirt coverage is larger, the surface texture in the area is more complex, and the edges are more and shorter. Based on the regional texture characteristics with larger sewage saturation, carrying out edge detection of a Canny operator on the sewage gray image to obtain an edge contour of the sewage gray image and edge pixel points on the edge contour, and recording an edge pixel point set on each edge contourWherein->Is the total number of edge contours in the sewage gray scale image.
S600: and constructing the edge-like length of the edge contour according to the edge starting and ending points of the edge contour and the midpoint of the edge pixel length.
The edge profile formed on the water surface is generally diffusive and long due to the existence of water waves, the edge profile in the area of the dirt surface is distributed on the water surface due to the fact that dirt is solid particles, the particle shapes are different, the length of the edge profile in the final formed dirt surface is short, and the edge profile possibly has a surrounding edge profile, the whole length is long, and the edge profile actually belongs to the short edge profile of the dirt surface, so that the invention does not adopt the edge profile pixel length as a measure of the edge profile length.
As shown in fig. 3, in some embodiments of the present invention, the edge-like length of the edge contour is constructed according to the edge start and end points of the edge contour and the edge pixel length midpoint, including steps S601 to S603.
S601: an edge starting point, an edge ending point and an edge pixel length midpoint of the edge contour are obtained.
In some embodiments of the present invention, the edge starting point, the edge ending point and the edge pixel length midpoint of the edge contour may be obtained by a method that includes collecting the edge pixel pointsIf there is only one point on the same edge contour within eight adjacent points of a certain edge pixel point, the edge pixel point is one of the edge start and end points, and the two edge start and end points are found and marked as edge start points respectively (>) And edge end point (+)>) As shown in fig. 7.
At the collection of edge pixelsIn, with the edge origin ()>) And edge end point (+)>) The pixel point with the largest distance is marked as the midpoint of the edge pixel length (+.>) As shown in fig. 7.
S602: the first Euclidean distance between the edge initial point and the midpoint of the edge pixel length is calculatedAnd a second Euclidean distance of the edge end point from the midpoint of the edge pixel length +.>。
S603: according to the first Euclidean distanceSecond Euclidean distance->And the included angle formed by the midpoint of the edge pixel length and the connecting line of the edge initial point and the edge final point respectively +.>Edge-like lengths of edge contours are constructed.
According to the first Euclidean distanceSecond Euclidean distance->And the included angle formed by the midpoint of the edge pixel length and the connecting line of the edge initial point and the edge final point respectively +.>Edge-like length of constructing edge profile>The method comprises the following steps: the first Euclidean distance->And a second Euclidean distance->Summing and then normalizing the angle->The values are multiplied, namely:
wherein,indicate->Edge-like length of the individual edge profiles, +.>Representing normalized included angle->Value of->Is->First Euclidean distance between edge starting point of each edge contour and midpoint of edge pixel length, +.>Is->And a second Euclidean distance between the edge end point of the edge contour and the midpoint of the edge pixel length.
When (when)The smaller the value of (c) is, the smaller the length of the edge profile is, the more likely is the shorter edge on the dirt surface, when +.>The larger the value of (c), the longer the edge profile, the more likely it is a long edge on the water surface.
Wherein, as shown in FIG. 4, in some embodiments of the inventionNormalized included angleThe value acquisition method comprises the steps S6031-S6034.
S6031: obtaining a third Euclidean distance between the edge initial point and the edge final point。
S6032: based on the first Euclidean distanceSecond Euclidean distance->And third Euclidean distance->Obtaining an included angle +.>Cosine values of (a) are provided.
Based on the first Euclidean distanceSecond Euclidean distance->And third Euclidean distance->Obtaining an included angle +.>Cosine value size +.>The method comprises the following steps:
wherein,is->The cosine value of the line segment formed by the edge starting point of each edge contour and the midpoint of the edge pixel length and the line segment formed by the edge end point and the midpoint of the edge pixel length, +.>Is->A first Euclidean distance between the edge start point of the edge profile and the midpoint of the edge pixel length, +.>Is->A second Euclidean distance between the edge end point of the edge contour and the midpoint of the edge pixel length, +.>Is->And a third Euclidean distance between the edge starting point and the edge ending point of the edge profile.
S6033: according to the included angleCosine value of (2) to obtain the angle->Value->。
According to the included angleCosine value of (2) to obtain the angle->Value->The method comprises the following steps:
wherein,is->Line segment formed by edge starting point of each edge contour and edge pixel length midpoint and line segment included angle formed by edge end point and edge pixel length midpoint +.>Value size, ->Is->The cosine value of the line segment formed by the edge starting point of the edge outline and the midpoint of the edge pixel length and the line segment formed by the edge end point and the midpoint of the edge pixel length,representing an inverse cosine function.
S6034: to the included angleValue normalization processing is carried out to obtain a normalized included angle +.>Value->。
In the invention, the included angles generated between the two ends of the edge initial point and the edge end point and the midpoint of the length of the edge pixel are only judged for the included angle within 180 degreesIf the angle is larger than 180 degrees, the included angle is smaller than 180 degrees and is formed by the other side of the edge, so the TTA has the value range ofFor->Normalization to +.>Normalized included angle->The value is expressed as +.>。
S700: and analyzing the position distribution characteristics of the edge pixel points in the pixel window, and combining the edge-like length to obtain the dirt saliency index in the pixel window.
The more edge contours in the pixel window, the shorter the edge-like length, the greater the edge density, the more complex the dirt texture features in the pixel window, and the more pronounced the dirt in the sewage grayscale image.
As shown in fig. 5, in some embodiments of the present invention, the position distribution characteristics of the edge pixels in the pixel window are analyzed, and the edge-like length is combined to obtain the dirt saliency index in the pixel window, which includes steps S701 to S703.
S701: and obtaining a fourth Euclidean distance between the edge pixel point in the pixel window and the central pixel point of the pixel window.
Counting edge pixel points in a pixel window, only randomly selecting one edge pixel point as an edge representative point for a plurality of edge pixel points on the same edge contour, connecting the edge representative point in the window with a central pixel point of the pixel window, and solving a fourth Euclidean distance,/>The number of representative points for the edges within the pixel window.
S702: and calculating a fourth Euclidean distance sum of all edge pixel points in the pixel window and the central pixel point of the pixel window.
S703: and according to the sum of the fourth Euclidean distances, combining the edge-like length and the pixel window area size, and obtaining the dirt saliency index in the pixel window.
According to the sum of the fourth Euclidean distances, and combining the edge-like length and the pixel window area size, the obtained dirt saliency index in the pixel window is:
wherein,WSis a significant index of contamination within the pixel window,is the firstiFourth Euclidean distance between the edge representative point and the central pixel point of the pixel window, +.>Is the firstiThe edge-like length of the individual edge profiles,kfor the number of edge representative points within a pixel window,mis the pixel window area size.
When the dirt saliency index in the pixel window is larger, the shorter and denser edges in the pixel window are indicated, and the more complex textures are formed, the more likely dirt areas are formed; the smaller the dirt saliency index in the pixel window, the longer and more diffuse the edges in the pixel window, and the simpler the texture formed, the more likely it is a water surface region.
S800: the confidence of the dirt area in the dirt pool of the backwash water filter is constructed based on the dirt saturation and the dirt saliency index in the dirt area.
Based on soil saturation in soil regionLBAnd dirt saliency indexWSConstructing confidence of dirt area in sewage pool of backwash water filterIs the product of the saturation of the soil and the significant index of the soil, namely:
wherein,for the confidence level of the soil region,LBin order for the degree of saturation of the soil,WSis a significant index of contamination within the pixel window.
When (when)The larger the value of (2) is, the larger the saturation of the dirt in the area where the pixel point is located is, and the larger the dirt saliency index is, the more likely the dirt area is; when->The smaller the value of (c) is, the smaller the saturation of the dirt in the area where the pixel is located is, and the smaller the dirt saliency index is, the more likely the area is the water surface.
S900: and modifying a similarity criterion in the K-means clustering algorithm based on the confidence level of the dirt area to obtain modified similarity and a modified K-means clustering algorithm.
And modifying a similarity criterion in the K-means clustering algorithm based on the confidence level of the dirt area to obtain modified similarity and a modified K-means clustering algorithm. Wherein, the correction similarity is: the square of the difference between the confidence of the dirt region of the pixel point and the confidence of the dirt region of the central point of the K-means cluster, namely:
wherein,is K-means cluster +.>Is +.>And->Sample dot->Is modified in the dirt region, +.>Is->Dirt area confidence of individual sample points, +.>Is K-means cluster +.>Is +.>Is a confidence level of the soil region.
Setting the K value in the K-means algorithm as 2, wherein the first type is a dirt area, and the second type is a water surface area. When (when)The larger the description of sample points and K-means cluster +.>The more similar the center points of (2), the more should be classified as +.>The smaller the instruction sample point and K-means cluster +.>The more dissimilar the center points, the less should they be classified.
S1000: and evaluating the pollution discharge effect of the back flush water filter based on a modified K-means clustering algorithm.
As shown in FIG. 6, in some embodiments of the invention, the pollution discharge effect of the backwash water filter is evaluated based on a modified K-means clustering algorithm, which comprises steps S1001-S1004.
S1001: and carrying out cluster analysis on the sewage gray level image by using a modified K-means clustering algorithm to obtain a clustering result.
S1002: based on the clustering result, counting the sewage coverage area in the sewage pool of the back flush water filter.
S1003: from the dirt coverage area, a dirt coverage area duty cycle is obtained.
S1004: and (5) evaluating the pollution discharge effect of the back flush water filter according to the occupation ratio of the sewage coverage area.
In some embodiments of the invention, evaluating the blowdown effect of a backwash water filter based on the soil coverage area ratio comprises: judging whether the duty ratio of the sewage coverage area is larger than or equal to a duty ratio threshold value or not; if so, the pollution discharge effect of the backwashing water filter is evaluated to be better; otherwise, evaluating the pollution discharge effect of the back flush water filter is poor. Wherein, the value of the duty ratio threshold value can be an empirical value of 90%. Namely, when the sewage coverage area is more than or equal to 90%, the sewage discharge effect of the back flushing water filter is better; when the sewage coverage area is smaller than 90%, the sewage discharge effect of the backwash water filter is evaluated to be poor.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments.
It is noted that unless specified and limited otherwise, relational terms such as "first" and "second", and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. The terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a circuit structure, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such article or apparatus. Without further limitation, the statement "comprises one … …" does not exclude that an additional identical element is present in an article or device that comprises the element. In addition, the term "and/or" as used herein includes any and all combinations of one or more of the associated listed items.
Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.
It is to be understood that the invention is not limited to the precise arrangements and instrumentalities shown in the drawings, which have been described above, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the invention is limited only by the appended claims.