CN115294131A - Sewage treatment quality detection method and system - Google Patents

Sewage treatment quality detection method and system Download PDF

Info

Publication number
CN115294131A
CN115294131A CN202211220233.3A CN202211220233A CN115294131A CN 115294131 A CN115294131 A CN 115294131A CN 202211220233 A CN202211220233 A CN 202211220233A CN 115294131 A CN115294131 A CN 115294131A
Authority
CN
China
Prior art keywords
image
sewage
superpixel
block
degree
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211220233.3A
Other languages
Chinese (zh)
Inventor
方钰
涂今腊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
HIGHFINE WATER TREATMENT ENGINEERING CO LTD
Original Assignee
HIGHFINE WATER TREATMENT ENGINEERING CO LTD
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by HIGHFINE WATER TREATMENT ENGINEERING CO LTD filed Critical HIGHFINE WATER TREATMENT ENGINEERING CO LTD
Priority to CN202211220233.3A priority Critical patent/CN115294131A/en
Publication of CN115294131A publication Critical patent/CN115294131A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/90Dynamic range modification of images or parts thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/74Image or video pattern matching; Proximity measures in feature spaces
    • G06V10/761Proximity, similarity or dissimilarity measures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20021Dividing image into blocks, subimages or windows

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Artificial Intelligence (AREA)
  • Computing Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Software Systems (AREA)
  • Multimedia (AREA)
  • Quality & Reliability (AREA)
  • Image Analysis (AREA)

Abstract

The invention relates to the technical field of sewage treatment quality measurement, in particular to a sewage treatment quality detection method and system. The method comprises the steps of firstly, acquiring a sewage area image; and (3) carrying out data processing on the sewage area image, and acquiring a sewage treatment quality influence factor according to the change of the sewage surface image before and after the coagulant is added and the difference between the sewage surface image and the purified water image. The method realizes the representation of the sewage treatment quality through the change of the sewage surface image after the coagulant is added and the difference between the sewage and the purified water image, and improves the efficiency and the precision of the sewage treatment quality detection.

Description

Sewage treatment quality detection method and system
Technical Field
The invention relates to the technical field of sewage treatment quality measurement, in particular to a sewage treatment quality detection method and system.
Background
Sewage treatment is a process of purifying sewage to meet the water quality requirement of discharging the sewage into a certain water body or reusing the sewage. Sewage treatment is widely applied to various fields such as buildings, agriculture, environmental protection and the like, and if the sewage treatment effect is poor, serious environmental pollution can be caused when the sewage is discharged. Therefore, the quality detection of sewage treatment is also more critical.
Disclosure of Invention
In order to solve the technical problems, the invention aims to provide a method and a system for detecting the sewage treatment quality, and the adopted technical scheme is as follows:
in a first aspect, an embodiment of the present invention provides a method for detecting sewage treatment quality, including the following steps:
collecting a sewage image, and preprocessing the sewage image to obtain a sewage surface image;
acquiring a sewage area of a sewage surface image to obtain a sewage area image; dividing the sewage area image into a plurality of superpixel blocks by using a superpixel segmentation algorithm, and representing the dirty degree of the sewage through the gray difference between the sewage area image and the purified water image; acquiring an adjacent superpixel block in the vertical direction for any superpixel block, and calculating the similarity between the superpixel block and the adjacent superpixel block; obtaining the change degree of the super pixel block according to the similarity of the super pixel block and the adjacent super pixel block; acquiring front and back change information of a superpixel block in a sewage area image of an adjacent frame under the action of a coagulant, and correcting the change degree to obtain a corrected change degree; calculating the overall change degree of the sewage area image based on the correction change degree of each super pixel block; acquiring a sewage treatment quality influence factor according to the change of the sewage surface image before and after the coagulant is added and the difference between the sewage surface image and the purified water image;
and obtaining the sewage treatment quality index by combining the integral change degree and the sewage treatment quality influence factor.
Preferably, the preprocessing the sewage image to obtain the sewage surface image includes:
and carrying out gray level treatment on the sewage image by using a weighted gray level method to obtain a sewage surface image.
Preferably, the representing the degree of dirtiness of the sewage through the gray scale difference between the sewage area image and the purified water image includes:
the dirtiness is calculated by the formula:
Figure 337063DEST_PATH_IMAGE002
wherein, the first and the second end of the pipe are connected with each other,
Figure DEST_PATH_IMAGE003
degree of dirtiness;
Figure 293387DEST_PATH_IMAGE004
the average gray value of the image of the sewage area when no coagulant is added is shown,
Figure DEST_PATH_IMAGE005
representing the average gray value of the purified water image;
Figure 922951DEST_PATH_IMAGE006
as a function of the maximum value.
Preferably, the acquiring, for any super pixel block, a super pixel block adjacent in the vertical direction, and calculating the similarity between the super pixel block and the adjacent super pixel block includes:
the calculation formula of the similarity is as follows:
Figure 414019DEST_PATH_IMAGE008
wherein, the first and the second end of the pipe are connected with each other,
Figure DEST_PATH_IMAGE009
is similarity;
Figure 129034DEST_PATH_IMAGE010
the probability that the gray co-occurrence matrix gray point pair (i, j) of the super pixel block Q appears is represented,
Figure DEST_PATH_IMAGE011
represents a super pixel block
Figure 92311DEST_PATH_IMAGE012
The probability of occurrence of the gray-level co-occurrence matrix gray-level point pair (i, j),
Figure DEST_PATH_IMAGE013
then respectively represent superpixel block Q and pairDirectly above adjacent superpixel block in the corresponding vertical direction
Figure 91228DEST_PATH_IMAGE012
Average gray value within; e is a natural constant.
Preferably, the obtaining the degree of change of the super pixel block according to the similarity between the super pixel block and the adjacent super pixel block includes:
the calculation formula of the change degree is as follows:
Figure DEST_PATH_IMAGE015
wherein the content of the first and second substances,
Figure 747338DEST_PATH_IMAGE016
to varying degrees;
Figure 11966DEST_PATH_IMAGE009
show that
Figure DEST_PATH_IMAGE017
Super pixel block Q and adjacent super pixel block right above in image
Figure 513354DEST_PATH_IMAGE012
The similarity of (a) to (b) is,
Figure 461719DEST_PATH_IMAGE018
show that
Figure 837466DEST_PATH_IMAGE017
Superpixel block Q and immediate downward Fang Linjin superpixel block in image
Figure DEST_PATH_IMAGE019
The similarity of (a) to (b),
Figure 323811DEST_PATH_IMAGE020
show that
Figure 425628DEST_PATH_IMAGE017
Adjacent frames of an image
Figure DEST_PATH_IMAGE021
Super pixel block in image
Figure 681029DEST_PATH_IMAGE022
And the immediately above neighboring super pixel block
Figure DEST_PATH_IMAGE023
The similarity of (a) to (b),
Figure 413361DEST_PATH_IMAGE024
show that
Figure 918161DEST_PATH_IMAGE017
Adjacent frames of an image
Figure 371139DEST_PATH_IMAGE021
Super pixel block in image
Figure 543363DEST_PATH_IMAGE022
And right down Fang Linjin superpixel block
Figure DEST_PATH_IMAGE025
Similarity of (c);
Figure 977756DEST_PATH_IMAGE006
as a function of the maximum value.
Preferably, the correcting the variation degree to obtain a corrected variation degree includes:
the calculation formula of the correction change degree is as follows:
Figure DEST_PATH_IMAGE027
wherein, the first and the second end of the pipe are connected with each other,
Figure 913394DEST_PATH_IMAGE016
to varying degrees;
Figure 904484DEST_PATH_IMAGE028
to correct the degree of change; m and k are statistical information of pixel point category change in the super pixel block;
Figure DEST_PATH_IMAGE029
is a superpixel block Q and
Figure 868897DEST_PATH_IMAGE030
the number of the common pixel points;
Figure DEST_PATH_IMAGE031
indicating that the ith common pixel point is in the image
Figure 943033DEST_PATH_IMAGE017
A gray value of (d);
Figure 688004DEST_PATH_IMAGE032
indicating that the ith common pixel point is in the image
Figure 217205DEST_PATH_IMAGE021
The gray-scale value of (a) above,
Figure DEST_PATH_IMAGE033
is shown in the image
Figure 567284DEST_PATH_IMAGE017
The j-th neighborhood feature value of the ith shared pixel point,
Figure 609058DEST_PATH_IMAGE034
is shown in the image
Figure 575746DEST_PATH_IMAGE021
The j-th neighborhood feature value of the ith shared pixel point,
Figure DEST_PATH_IMAGE035
to adjust the parameters.
Preferably, the calculating the overall degree of change of the sewage area image based on the corrected degree of change of each super pixel block includes:
the calculation formula of the overall change degree is as follows:
Figure DEST_PATH_IMAGE037
wherein, the first and the second end of the pipe are connected with each other,
Figure 298851DEST_PATH_IMAGE038
the degree of change is global; 400n represents the number of superpixels;
Figure DEST_PATH_IMAGE039
coordinate information in the vertical direction of the seed point of the ith super-pixel block is represented;
Figure 231998DEST_PATH_IMAGE040
coordinate information in a vertical direction representing a center point of the image;
Figure DEST_PATH_IMAGE041
indicating the extent of modification change for the ith superpixel block,
Figure 382357DEST_PATH_IMAGE042
the frame number corresponding to the image of the ith super pixel block is shown;
Figure DEST_PATH_IMAGE043
the number of frames required when the sewage image is no longer changed is indicated.
Preferably, the acquiring of the sewage treatment quality influence factor according to the change of the sewage surface image before and after the coagulant addition and the difference with the purified water image comprises:
the calculation formula of the sewage treatment quality influence factor is as follows:
Figure DEST_PATH_IMAGE045
wherein the content of the first and second substances,
Figure 429816DEST_PATH_IMAGE046
is sewageProcessing the quality impact factor; e is a natural constant;
Figure DEST_PATH_IMAGE047
the degree of dirtiness before sewage treatment;
Figure 753350DEST_PATH_IMAGE048
is the dirtiness degree after sewage treatment.
Preferably, the step of obtaining the sewage treatment quality index by combining the overall change degree and the sewage treatment quality influence factor comprises the following steps:
and multiplying the integral change degree by the sewage treatment quality influence factor to obtain a sewage treatment quality index.
In a second aspect, an embodiment of the present invention provides a sewage treatment quality detection system, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned sewage treatment quality detection method when executing the computer program.
The embodiment of the invention at least has the following beneficial effects:
firstly, collecting a sewage image, and preprocessing the sewage image to obtain a sewage surface image; acquiring a sewage area of a sewage surface image to obtain a sewage area image; dividing the sewage area image into a plurality of superpixel blocks by using a superpixel segmentation algorithm, and representing the dirty degree of the sewage through the gray difference between the sewage area image and the purified water image; acquiring an adjacent superpixel block in the vertical direction for any superpixel block, and calculating the similarity between the superpixel block and the adjacent superpixel block; obtaining the change degree of the super pixel block according to the similarity of the super pixel block and the adjacent super pixel block; acquiring front and back change information of a superpixel block in an adjacent frame sewage area image under the action of a coagulant, and correcting the change degree to obtain a corrected change degree; calculating the overall change degree of the sewage area image based on the correction change degree of each super pixel block; acquiring a sewage treatment quality influence factor according to the change of the sewage surface image before and after the coagulant is added and the difference between the sewage surface image and the purified water image; and obtaining the sewage treatment quality index by combining the integral change degree and the sewage treatment quality influence factor.
The quality of sewage treatment is represented by the change of the image on the surface of the sewage after the coagulant is added and the difference between the image of the sewage and the image of the purified water, so that the efficiency and the precision of the detection of the quality of the sewage treatment are improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions and advantages of the prior art, the drawings used in the embodiments or the description of the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a flow chart of a method for detecting the quality of sewage treatment according to an embodiment of the present invention.
Detailed Description
To further illustrate the technical means and effects of the present invention adopted to achieve the predetermined objects, the following detailed description will be given to a method and a system for detecting the quality of sewage treatment according to the present invention, and the specific implementation, structure, characteristics and effects thereof with reference to the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" refers to not necessarily the same embodiment. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
The embodiment of the invention provides a specific implementation method of a sewage treatment quality detection method and system, and the method is suitable for a scene that sewage generated by factory production needs sewage treatment quality detection.
The following describes a specific scheme of a sewage treatment quality detection method and system provided by the invention in detail with reference to the accompanying drawings.
Referring to fig. 1, a flow chart of steps of a method for detecting quality of wastewater treatment according to an embodiment of the present invention is shown, the method including the following steps:
and S100, acquiring a sewage image, and preprocessing the sewage image to obtain a sewage surface image.
In the invention, sewage is collected by a transparent container, and a fixed light source is used for collecting a sewage surface image and a continuous multi-frame sewage surface image added with a coagulant by an industrial camera, wherein the images are respectively recorded as a
Figure 343600DEST_PATH_IMAGE017
Figure 992756DEST_PATH_IMAGE021
Figure 153610DEST_PATH_IMAGE043
In which
Figure 811993DEST_PATH_IMAGE017
Corresponding to the surface image of the sewage without adding the coagulant,
Figure DEST_PATH_IMAGE049
correspondingly, the image is the image when the sewage image is not changed any more when the coagulant is added, and the acquired image is the front view of the measuring cylinder and is an RGB image. And (4) carrying out gray level treatment on the sewage image by using a weighted gray level method to obtain a sewage surface image. Weighted graying is a well-known technique and will not be described in detail herein.
Thus, a surface image of the wastewater was obtained.
S200, dividing the sewage area image into a plurality of superpixel blocks by using a superpixel segmentation algorithm, and representing the dirty degree of the sewage through the gray difference between the sewage area image and the purified water image; acquiring an adjacent superpixel block in the vertical direction for any superpixel block, and calculating the similarity between the superpixel block and the adjacent superpixel block; obtaining the change degree of the super pixel block according to the similarity of the super pixel block and the adjacent super pixel block; acquiring front and back change information of a superpixel block in a sewage area image of an adjacent frame under the action of a coagulant, and correcting the change degree to obtain a corrected change degree; calculating the overall change degree of the sewage area image based on the correction change degree of each super pixel block; and acquiring a sewage treatment quality influence factor according to the change of the sewage surface image before and after the coagulant is added and the difference between the sewage surface image and the purified water image.
After the coagulant is added, impurities in the sewage are combined with the coagulant to form floccules and precipitate to the bottom, so that the method uses a superpixel segmentation algorithm for sewage area images, analyzes the change of sewage surface images and the difference between the sewage surface images before and after treatment and purified water images to obtain a sewage treatment quality influence factor.
And acquiring a sewage area of the sewage surface image to obtain a sewage area image. In the present invention, (b) obtaining the surface image of the wastewater
Figure 934713DEST_PATH_IMAGE017
) And (4) segmenting the surface image of the sewage obtained in the measuring cylinder as the foreground and the rest of the area as the background by using an Otsu threshold segmentation method to obtain the image of the sewage area. The Otsu threshold segmentation method is a well-known technique and will not be described herein.
A superpixel segmentation algorithm is used for the sewage area image, the sewage is segmented into K superpixel blocks by presetting K =400, the superpixel segmentation algorithm is a known technology, and details are not repeated here. The above steps are also carried out on the sewage images at different moments, and 400 superpixel blocks can be obtained. The superpixel blocks on the two images can correspond to one another, and the specific process is as follows: image of sewage area
Figure 489191DEST_PATH_IMAGE017
The first line and the first superpixel block correspond to the sewage area image
Figure 183347DEST_PATH_IMAGE021
The first row, the first superpixel block, and so on.
According to the priori knowledge, the purified water is usually transparent liquid and has a large gray value, the surface of the sewage is usually dirty due to various objects such as impurities, the gray value is low, namely the surfaces of the purified water and the sewage have a certain gray value difference, so that the dirty degree Y of the sewage is represented by the gray value difference, namely the dirty degree of the sewage is represented by the gray value difference between the sewage area image and the purified water image.
The degree of dirtiness is calculated by:
Figure 130574DEST_PATH_IMAGE050
wherein the content of the first and second substances,
Figure 367521DEST_PATH_IMAGE003
a degree of dirtiness;
Figure 624058DEST_PATH_IMAGE004
the average gray value of the image of the sewage area without coagulant addition is shown,
Figure 539931DEST_PATH_IMAGE005
representing the average gray value of the purified water image;
Figure 290849DEST_PATH_IMAGE006
as a function of the maximum value. The larger the Y value, the more turbid the waste water becomes, and the greater the degree of contamination becomes.
After the coagulant is added to the sewage, impurities in the sewage are combined with the coagulant and gradually precipitate, and the impurities are gradually separated from the water, so that the gray value of the pixel points of the superpixel blocks in the vertical direction also changes, the higher the gray value of the superpixel blocks is, the closer the superpixel blocks are to the purified water, the larger the gray value is, the more serious the impurity accumulation of the superpixel blocks below is, and the smaller the gray value is. Therefore, the change process is analyzed to obtain the change degree of the superpixel block, thereby representing the treatment effect of the coagulant and obtaining the sewage treatment quality influence factor.
Taking superpixel block Q as an example, in
Figure 710198DEST_PATH_IMAGE017
Obtaining adjacent superpixel blocks in the vertical direction on the gray map, at least two superpixel blocks exist in the vertical direction of the superpixel block Q, and the superpixel block positioned right above the superpixel block Q is recorded as
Figure 419528DEST_PATH_IMAGE012
The super pixel block located right below it is denoted as
Figure 557117DEST_PATH_IMAGE019
Then Q and Q can be calculated separately
Figure 847414DEST_PATH_IMAGE012
Figure 137581DEST_PATH_IMAGE019
The similarity XS between, here the formula is denoted Q,
Figure 532659DEST_PATH_IMAGE012
for example, for a super pixel block Q,
Figure 111539DEST_PATH_IMAGE012
respectively acquiring gray level co-occurrence matrices (gray levels are compressed into 16 levels, and the values of the gray level co-occurrence matrices are normalized), wherein the method for acquiring the gray level co-occurrence matrices is a known technology, and is not described herein again, and there are
Figure 984686DEST_PATH_IMAGE009
. For any super-pixel block, an adjacent super-pixel block in the vertical direction is acquired, and the similarity between the super-pixel block and the adjacent super-pixel block is calculated.
The similarity is calculated by the formula:
Figure 394938DEST_PATH_IMAGE008
wherein the content of the first and second substances,
Figure 898601DEST_PATH_IMAGE009
is similarity;
Figure 276362DEST_PATH_IMAGE010
the probability that the gray co-occurrence matrix gray point pair (i, j) of the super pixel block Q appears is represented,
Figure 438353DEST_PATH_IMAGE011
represents a super pixel block
Figure 155642DEST_PATH_IMAGE012
The probability of occurrence of the gray point pair (i, j) of the gray co-occurrence matrix of (a),
Figure 112096DEST_PATH_IMAGE013
respectively, the superpixel block Q and the corresponding vertically immediately above neighboring superpixel block Q are represented
Figure 977153DEST_PATH_IMAGE012
Average gray value within; e is a natural constant.
Difference value thereof
Figure DEST_PATH_IMAGE051
The smaller the size, the greater the similarity between two super pixel blocks,
Figure 333048DEST_PATH_IMAGE013
respectively represent superpixel block Q and superpixel block
Figure 973020DEST_PATH_IMAGE012
The average gray value of the inner.
Then to the adjacent frame image
Figure 365955DEST_PATH_IMAGE021
Performing association acquisition of superpixel blocks, and acquiring superpixel blocks Q
Figure 390412DEST_PATH_IMAGE021
Corresponding superpixel blocks on an image
Figure 894206DEST_PATH_IMAGE030
Figure 382825DEST_PATH_IMAGE012
Figure 212240DEST_PATH_IMAGE019
Corresponding super pixel blocks are respectively
Figure 723993DEST_PATH_IMAGE052
Figure DEST_PATH_IMAGE053
. For superpixel block
Figure 687270DEST_PATH_IMAGE030
Figure 499237DEST_PATH_IMAGE052
Can also calculate according to the steps
Figure 483242DEST_PATH_IMAGE020
According to the above steps, the method can be obtained
Figure 295341DEST_PATH_IMAGE009
Figure 593467DEST_PATH_IMAGE018
Figure 541831DEST_PATH_IMAGE020
Figure 956458DEST_PATH_IMAGE024
Therefore, the variation degree BY of the superpixel block Q can be obtained. And obtaining the change degree of the super pixel block according to the similarity of the super pixel block and the adjacent super pixel block.
The calculation formula of the degree of change is:
Figure 442803DEST_PATH_IMAGE054
wherein the content of the first and second substances,
Figure 357669DEST_PATH_IMAGE016
to varying degrees;
Figure 409808DEST_PATH_IMAGE009
show that
Figure 689610DEST_PATH_IMAGE017
Super pixel block Q and adjacent super pixel block right above in image
Figure 319044DEST_PATH_IMAGE012
The similarity of (a) to (b) is,
Figure 490131DEST_PATH_IMAGE018
show that
Figure 600038DEST_PATH_IMAGE017
Super pixel block Q and immediate downward Fang Linjin super pixel block in image
Figure 113059DEST_PATH_IMAGE019
The similarity of (a) to (b),
Figure 438910DEST_PATH_IMAGE020
show that
Figure 522011DEST_PATH_IMAGE017
Adjacent frames of an image
Figure 220845DEST_PATH_IMAGE021
Super pixel block in image
Figure 622877DEST_PATH_IMAGE022
And the directly above adjacent super pixel block
Figure 651005DEST_PATH_IMAGE023
The similarity of (a) to (b) is,
Figure 491791DEST_PATH_IMAGE024
show that
Figure 841870DEST_PATH_IMAGE017
Adjacent frames of an image
Figure 601753DEST_PATH_IMAGE021
Super pixel block in image
Figure 584752DEST_PATH_IMAGE022
And right down Fang Linjin superpixel block
Figure 370175DEST_PATH_IMAGE025
Similarity of (c);
Figure 705253DEST_PATH_IMAGE006
as a function of the maximum value.
The larger BY is, the better the treatment effect is under the action of the coagulant. However, the BY only considers the similarity change information of adjacent superpixel blocks on the adjacent frame images, and ignores the change information of the superpixel blocks, so that the BY evaluation is not complete. Therefore, the superpixel block Q and the superpixel block are aligned here
Figure 917929DEST_PATH_IMAGE030
Analyzing to obtain the change information of the superpixel block in the front and back of the adjacent frame images under the action of the coagulant, correcting the BY value to obtain the corrected change degree
Figure 388224DEST_PATH_IMAGE028
Firstly, a superpixel block Q and a superpixel block are obtained
Figure 882397DEST_PATH_IMAGE030
The number of pixels in the table is recorded as
Figure DEST_PATH_IMAGE055
,
Figure 613593DEST_PATH_IMAGE056
. By comparison
Figure 256889DEST_PATH_IMAGE055
Figure DEST_PATH_IMAGE057
Of (3) then the superpixel block Q and
Figure 40912DEST_PATH_IMAGE030
the larger of the two (e.g., the superpixel Q is larger, i.e., the size of the superpixel Q is selected as the example)
Figure 620667DEST_PATH_IMAGE055
>
Figure 602442DEST_PATH_IMAGE057
) Then, the pixel points in the superpixel block can be determined, taking the pixel point Q in the superpixel block Q as an example, let m =0 and k =0. Firstly, the q points are subjected to image coordinate acquisition, which is expressed as (
Figure 173231DEST_PATH_IMAGE058
Figure DEST_PATH_IMAGE059
) If the Q point belongs to a super-pixel block Q, then
Figure 178971DEST_PATH_IMAGE021
The pixels with the same coordinates in the image do not belong to the superpixel block
Figure 313149DEST_PATH_IMAGE030
If m = m +1, otherwise m = m, the judgment is carried out on all the pixels in the superpixel block Q, and the superpixel blocks are judged in the same way
Figure 612413DEST_PATH_IMAGE030
The inner pixel point is also judged, if the pixel point belongs to the superpixel block
Figure 791588DEST_PATH_IMAGE030
And the same coordinate corresponds to
Figure 504198DEST_PATH_IMAGE017
And when the pixel point in the image does not belong to the super pixel block Q, k = k +1, otherwise k = k. When the Q point belongs to both the superpixel block Q and the superpixel block
Figure 989537DEST_PATH_IMAGE030
In the process, the q point is subjected to the acquisition of 3*3 neighborhood, and then the q point can be acquired
Figure 533520DEST_PATH_IMAGE060
Neighborhood eigenvalues of points
Figure DEST_PATH_IMAGE061
Wherein
Figure 357032DEST_PATH_IMAGE062
Expressing the gray value of the ith pixel point in the q point neighborhood, wherein the clockwise included angle between the straight line formed by the pixel point and the q point and the horizontal straight line is
Figure DEST_PATH_IMAGE063
Figure 104408DEST_PATH_IMAGE031
The gray value of the pixel point Q in the superpixel block Q is represented. According to the superpixel block Q and
Figure 642705DEST_PATH_IMAGE030
the change degree of the common pixel points and the change degree of the super pixel blocks are corrected by m, k, and then the change degree of the super pixel blocks is obtained
Figure 182140DEST_PATH_IMAGE028
. And acquiring front and back change information of the superpixel block in the adjacent frame sewage area image under the action of a coagulant, and correcting the change degree to obtain the corrected change degree.
The calculation formula of the correction change degree is as follows:
Figure 265634DEST_PATH_IMAGE027
wherein, the first and the second end of the pipe are connected with each other,
Figure 156098DEST_PATH_IMAGE016
to varying degrees;
Figure 966928DEST_PATH_IMAGE028
to correct the degree of change; m and k are statistical information of the change of pixel point types in the super pixel block;
Figure 846023DEST_PATH_IMAGE029
is a superpixel block Q and
Figure 412002DEST_PATH_IMAGE030
the number of the common pixel points;
Figure 727446DEST_PATH_IMAGE031
indicating the ith common pixel point in the image
Figure 358278DEST_PATH_IMAGE017
Upper gray value;
Figure 335287DEST_PATH_IMAGE032
indicating that the ith common pixel point is in the image
Figure 275430DEST_PATH_IMAGE021
The gray-scale value of (a) above,
Figure 343749DEST_PATH_IMAGE033
is shown in the image
Figure 512694DEST_PATH_IMAGE017
The j-th neighborhood feature value of the ith shared pixel point,
Figure 146806DEST_PATH_IMAGE034
is shown in the image
Figure 726692DEST_PATH_IMAGE021
The j-th neighborhood feature value of the ith shared pixel point,
Figure 829777DEST_PATH_IMAGE035
to adjust the parameters.
Wherein m and k are statistical information of the change of the pixel point category in the super pixel block, the larger the value is, the larger the change degree is,
Figure 582839DEST_PATH_IMAGE035
to adjust the parameters, a very small positive number is used, preventing the denominator from being 0.
Figure 291032DEST_PATH_IMAGE028
The larger the size, the more effective the treatment of wastewater.
Analyzing the adjacent images according to the steps, and then each super-pixel block in each image has the corresponding super-pixel block
Figure 41819DEST_PATH_IMAGE028
Value, so that the overall degree of change can be calculated
Figure 881468DEST_PATH_IMAGE038
. And calculating the overall change degree of the sewage area image based on the corrected change degree of each super-pixel block.
The calculation formula of the overall change degree is as follows:
Figure 392215DEST_PATH_IMAGE037
wherein the content of the first and second substances,
Figure 741199DEST_PATH_IMAGE038
the degree of change is global; 400n represents the number of superpixels;
Figure 928467DEST_PATH_IMAGE039
coordinate information in the vertical direction of the seed point of the ith super-pixel block is represented;
Figure 740565DEST_PATH_IMAGE040
coordinate information in a vertical direction representing a center point of the image;
Figure 304271DEST_PATH_IMAGE041
indicating the extent of modification change for the ith superpixel block,
Figure 518214DEST_PATH_IMAGE042
the frame number corresponding to the image of the ith super pixel block is shown;
Figure 876383DEST_PATH_IMAGE043
the number of frames required when the sewage image is no longer changed is indicated.
The number of the collected images is n +1, each image has 400 super-pixel blocks, and the last image does not have a subsequent adjacent frame image, so that the calculation is not performed here.
Figure 831570DEST_PATH_IMAGE039
Coordinate information in the vertical direction of the seed point of the ith superpixel block is shown,
Figure 933387DEST_PATH_IMAGE040
indicating coordinate information in the vertical direction of the center point of the image
Figure 251105DEST_PATH_IMAGE064
The larger the difference is, the more the superpixel block is located above or below, the more the change degree can reflect the sewage treatment effect, so the larger weight is given.
Figure 530908DEST_PATH_IMAGE042
The smaller the change in the superpixel block at this time, the more important the degree of change at the beginning of the precipitation, and the greater the weight given thereto,
Figure 566866DEST_PATH_IMAGE038
the larger the size, the better the effect of the sewage treatment.
Then according to the above-mentioned steps, for
Figure 36872DEST_PATH_IMAGE043
The corresponding image and the purified water image are calculated again to obtain the dirtiness degree
Figure DEST_PATH_IMAGE065
Then, the sewage treatment quality influence factor U can be obtained. Acquiring a sewage treatment quality influence factor according to the change of the surface image of the sewage before and after adding the coagulant and the difference between the surface image and the purified water image
The calculation formula of the sewage treatment quality influence factor is as follows:
Figure 192785DEST_PATH_IMAGE045
wherein the content of the first and second substances,
Figure 282970DEST_PATH_IMAGE046
is a sewage treatment quality influence factor; e is a natural constant;
Figure 9486DEST_PATH_IMAGE047
the degree of dirt before sewage treatment;
Figure 927807DEST_PATH_IMAGE048
is the dirtiness degree after the sewage treatment. The larger the value of the sewage treatment quality influence factor is, the better the sewage treatment effect is.
Thus, the influence index of the sewage treatment quality is obtained.
And step S300, combining the overall change degree and the sewage treatment quality influence factor to obtain a sewage treatment quality index.
According to the steps, the influence indexes of the sewage treatment quality are obtained: a sewage treatment quality influencing factor. Therefore, the sewage treatment quality index R is obtained by combining the overall change degree and the sewage treatment quality influence factor. Specifically, the method comprises the following steps: and multiplying the integral change degree by the sewage treatment quality influence factor to obtain a sewage treatment quality index. The higher the index value of the sewage treatment quality is, the better the sewage treatment quality is.
In summary, the method comprises the steps of firstly collecting a sewage image, and preprocessing the sewage image to obtain a sewage surface image; acquiring a sewage area of a sewage surface image to obtain a sewage area image; dividing the sewage area image into a plurality of superpixel blocks by using a superpixel segmentation algorithm, and representing the dirty degree of the sewage through the gray difference between the sewage area image and the purified water image; acquiring an adjacent superpixel block in the vertical direction for any superpixel block, and calculating the similarity between the superpixel block and the adjacent superpixel block; obtaining the change degree of the super pixel block according to the similarity of the super pixel block and the adjacent super pixel block; acquiring front and back change information of a superpixel block in an adjacent frame sewage area image under the action of a coagulant, and correcting the change degree to obtain a corrected change degree; calculating the overall change degree of the sewage area image based on the correction change degree of each superpixel block; acquiring a sewage treatment quality influence factor according to the change of the sewage surface image before and after the coagulant is added and the difference between the sewage surface image and the purified water image; and obtaining the sewage treatment quality index by combining the integral change degree and the sewage treatment quality influence factor.
A sewage treatment quality detection system comprises a memory, a processor and a computer program stored in the memory and capable of running on the processor, wherein the processor realizes the steps of the method when executing the computer program. Since a sewage treatment quality detection method is described in detail above, it is not described again.
It should be noted that: the precedence order of the above embodiments of the present invention is only for description, and does not represent the merits of the embodiments. The processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (10)

1. A sewage treatment quality detection method is characterized by comprising the following steps:
collecting a sewage image, and preprocessing the sewage image to obtain a sewage surface image;
acquiring a sewage area of a sewage surface image to obtain a sewage area image; dividing the sewage area image into a plurality of superpixel blocks by using a superpixel segmentation algorithm, and representing the dirty degree of the sewage through the gray difference between the sewage area image and the purified water image; acquiring an adjacent superpixel block in the vertical direction for any superpixel block, and calculating the similarity between the superpixel block and the adjacent superpixel block; obtaining the change degree of the super pixel block according to the similarity of the super pixel block and the adjacent super pixel block; acquiring front and back change information of a superpixel block in a sewage area image of an adjacent frame under the action of a coagulant, and correcting the change degree to obtain a corrected change degree; calculating the overall change degree of the sewage area image based on the correction change degree of each super pixel block; acquiring a sewage treatment quality influence factor according to the change of the sewage surface image before and after the coagulant is added and the difference between the sewage surface image and the purified water image;
and obtaining the sewage treatment quality index by combining the integral change degree and the sewage treatment quality influence factor.
2. The method for detecting the sewage treatment quality according to claim 1, wherein the preprocessing the sewage image to obtain the sewage surface image comprises:
and carrying out gray level treatment on the sewage image by using a weighted gray level method to obtain a sewage surface image.
3. The method of claim 1, wherein the step of characterizing the degree of contamination of the wastewater by the difference between the gray levels of the image of the wastewater region and the image of the purified water comprises:
the dirtiness level is calculated by the formula:
Figure DEST_PATH_IMAGE001
wherein the content of the first and second substances,
Figure 560098DEST_PATH_IMAGE002
degree of dirtiness;
Figure 978441DEST_PATH_IMAGE003
the average gray value of the image of the sewage area when no coagulant is added is shown,
Figure 723412DEST_PATH_IMAGE004
representing the average gray value of the purified water image;
Figure 518192DEST_PATH_IMAGE005
as a function of the maximum value.
4. The wastewater treatment quality detection method according to claim 1, wherein the acquiring of the neighboring superpixel blocks in the vertical direction for any superpixel block, and the calculating of the similarity between the superpixel block and the neighboring superpixel block comprise:
the calculation formula of the similarity is as follows:
Figure 399430DEST_PATH_IMAGE006
wherein the content of the first and second substances,
Figure DEST_PATH_IMAGE007
is similarity;
Figure 191936DEST_PATH_IMAGE008
a gray co-occurrence matrix gray point pair (i,j) The probability of occurrence of the event is determined,
Figure 424203DEST_PATH_IMAGE009
representing a superpixel block
Figure 757096DEST_PATH_IMAGE010
The probability of occurrence of the gray point pair (i, j) of the gray co-occurrence matrix of (a),
Figure 492839DEST_PATH_IMAGE011
respectively, the superpixel Q and the corresponding vertically immediately above neighboring superpixel block
Figure 502252DEST_PATH_IMAGE010
Average gray value within; e is a natural constant.
5. The method of claim 1, wherein the obtaining the degree of change of the superpixel block according to the similarity between the superpixel block and the neighboring superpixel block comprises:
the calculation formula of the change degree is as follows:
Figure 972548DEST_PATH_IMAGE012
wherein the content of the first and second substances,
Figure 109131DEST_PATH_IMAGE013
to varying degrees;
Figure 699382DEST_PATH_IMAGE007
show that
Figure 161587DEST_PATH_IMAGE014
Super pixel block Q and adjacent super pixel block right above in image
Figure 97008DEST_PATH_IMAGE010
The similarity of (a) to (b) is,
Figure 37282DEST_PATH_IMAGE015
show that
Figure 747618DEST_PATH_IMAGE014
Superpixel block Q and immediate downward Fang Linjin superpixel block in image
Figure 115145DEST_PATH_IMAGE016
The similarity of (a) to (b) is,
Figure 12563DEST_PATH_IMAGE017
show that
Figure 490949DEST_PATH_IMAGE014
Adjacent frames of an image
Figure 586950DEST_PATH_IMAGE018
Super pixel block in image
Figure 125378DEST_PATH_IMAGE019
And the directly above adjacent super pixel block
Figure 41251DEST_PATH_IMAGE020
The similarity of (a) to (b),
Figure 57748DEST_PATH_IMAGE021
show that
Figure 742676DEST_PATH_IMAGE014
Adjacent frames of an image
Figure 186427DEST_PATH_IMAGE018
Super pixel block in image
Figure 589595DEST_PATH_IMAGE019
And right down Fang Linjin superpixel block
Figure 675363DEST_PATH_IMAGE022
The similarity of (c);
Figure 965530DEST_PATH_IMAGE005
as a function of the maximum value.
6. The method for detecting sewage treatment quality according to claim 1, wherein the correcting the variation degree to obtain a corrected variation degree comprises:
the calculation formula of the correction change degree is as follows:
Figure 360608DEST_PATH_IMAGE023
wherein the content of the first and second substances,
Figure 736226DEST_PATH_IMAGE013
to varying degrees;
Figure 349653DEST_PATH_IMAGE024
to correct the degree of change; m and k are statistical information of the change of pixel point types in the super pixel block;
Figure 25485DEST_PATH_IMAGE025
is a superpixel block Q and
Figure 60306DEST_PATH_IMAGE026
the number of the common pixel points;
Figure 923220DEST_PATH_IMAGE027
indicating that the ith common pixel point is in the image
Figure 334478DEST_PATH_IMAGE014
A gray value of (d);
Figure 864817DEST_PATH_IMAGE028
indicating that the ith common pixel point is in the image
Figure 70539DEST_PATH_IMAGE018
The gray-scale value of (a) above,
Figure 686328DEST_PATH_IMAGE029
is shown in the image
Figure 635699DEST_PATH_IMAGE014
The j-th neighborhood feature value of the ith shared pixel point,
Figure 754964DEST_PATH_IMAGE030
is shown in the image
Figure 397167DEST_PATH_IMAGE018
The jth neighborhood feature value of the ith common pixel point,
Figure 234673DEST_PATH_IMAGE031
to adjust the parameters.
7. The method of claim 1, wherein the calculating of the overall degree of change of the wastewater region image based on the corrected degree of change of each superpixel block comprises:
the calculation formula of the overall change degree is as follows:
Figure 987734DEST_PATH_IMAGE032
wherein the content of the first and second substances,
Figure 961507DEST_PATH_IMAGE033
the degree of change is global; 400n represents the number of superpixels;
Figure 509031DEST_PATH_IMAGE034
coordinate information in the vertical direction of the seed point of the ith super-pixel block is represented;
Figure 568254DEST_PATH_IMAGE035
coordinate information in a vertical direction representing a center point of the image;
Figure 877005DEST_PATH_IMAGE036
indicating the extent of modification change for the ith superpixel block,
Figure 705284DEST_PATH_IMAGE037
the frame number corresponding to the image of the ith super pixel block is shown;
Figure 689289DEST_PATH_IMAGE038
the number of frames required when the sewage image is no longer changed is indicated.
8. The sewage treatment quality detection method according to claim 1, wherein the obtaining of the sewage treatment quality influence factor based on the change of the image of the surface of the sewage before and after the addition of the coagulant and the difference from the image of the purified water comprises:
the calculation formula of the sewage treatment quality influence factor is as follows:
Figure 235808DEST_PATH_IMAGE039
wherein, the first and the second end of the pipe are connected with each other,
Figure 596251DEST_PATH_IMAGE040
is a sewage treatment quality influence factor; e is a natural constant;
Figure 528304DEST_PATH_IMAGE041
the degree of dirtiness before sewage treatment;
Figure 433943DEST_PATH_IMAGE042
is the dirtiness degree after sewage treatment.
9. The method of claim 1, wherein the step of combining the overall variation degree and the sewage treatment quality influencing factor to obtain the sewage treatment quality index comprises:
and multiplying the integral change degree by the sewage treatment quality influence factor to obtain a sewage treatment quality index.
10. A wastewater treatment quality detection system comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor when executing the computer program performs the steps of the method of any one of claims 1~9.
CN202211220233.3A 2022-10-08 2022-10-08 Sewage treatment quality detection method and system Pending CN115294131A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211220233.3A CN115294131A (en) 2022-10-08 2022-10-08 Sewage treatment quality detection method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211220233.3A CN115294131A (en) 2022-10-08 2022-10-08 Sewage treatment quality detection method and system

Publications (1)

Publication Number Publication Date
CN115294131A true CN115294131A (en) 2022-11-04

Family

ID=83834783

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211220233.3A Pending CN115294131A (en) 2022-10-08 2022-10-08 Sewage treatment quality detection method and system

Country Status (1)

Country Link
CN (1) CN115294131A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022001571A1 (en) * 2020-06-29 2022-01-06 南京巨鲨显示科技有限公司 Computing method based on super-pixel image similarity
CN114882031A (en) * 2022-07-11 2022-08-09 江苏瑞立环保工程股份有限公司 Sewage treatment method and system based on activated sludge process
CN114882040A (en) * 2022-07-12 2022-08-09 山东中治环境工程设备有限公司 Sewage treatment detection method based on template matching
CN115049665A (en) * 2022-08-16 2022-09-13 南通森田消防装备有限公司 Fire hose surface quality detection method and system based on image processing

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022001571A1 (en) * 2020-06-29 2022-01-06 南京巨鲨显示科技有限公司 Computing method based on super-pixel image similarity
CN114882031A (en) * 2022-07-11 2022-08-09 江苏瑞立环保工程股份有限公司 Sewage treatment method and system based on activated sludge process
CN114882040A (en) * 2022-07-12 2022-08-09 山东中治环境工程设备有限公司 Sewage treatment detection method based on template matching
CN115049665A (en) * 2022-08-16 2022-09-13 南通森田消防装备有限公司 Fire hose surface quality detection method and system based on image processing

Similar Documents

Publication Publication Date Title
CN114972329B (en) Image enhancement method and system of surface defect detector based on image processing
CN115829883B (en) Surface image denoising method for special-shaped metal structural member
CN109785291B (en) Lane line self-adaptive detection method
CN111583227B (en) Method, device, equipment and medium for automatically counting fluorescent cells
CN115131354B (en) Laboratory plastic film defect detection method based on optical means
CN109540917B (en) Method for extracting and analyzing yarn appearance characteristic parameters in multi-angle mode
CN110648330B (en) Defect detection method for camera glass
CN116310845B (en) Intelligent monitoring system for sewage treatment
CN109472779A (en) A kind of yarn appearance characteristic parameter extraction and analysis method based on morphosis
CN115082465B (en) Wool and cashmere classification method based on scanning electron microscope image processing
CN115359053A (en) Intelligent detection method and system for defects of metal plate
CN111178193A (en) Lane line detection method, lane line detection device and computer-readable storage medium
CN112101352A (en) Underwater alumen ustum state identification method and monitoring device, computer equipment and storage medium
CN116416252A (en) Method for detecting sedimentation image of wastewater in boehmite production process
CN116883408A (en) Integrating instrument shell defect detection method based on artificial intelligence
CN114742785A (en) Hydraulic joint cleanliness control method based on image processing
CN116778431B (en) Automatic sludge treatment monitoring method based on computer vision
CN117853484A (en) Intelligent bridge damage monitoring method and system based on vision
CN115294131A (en) Sewage treatment quality detection method and system
CN111882549A (en) Automatic detection and identification method and system for grayish green small foreign fibers
CN114862765B (en) Cell layered image processing method
CN114742849B (en) Leveling instrument distance measuring method based on image enhancement
CN115471537A (en) Monocular camera-based moving target distance and height measuring method
CN113763404B (en) Foam image segmentation method based on optimization mark and edge constraint watershed algorithm
CN115546799A (en) Backlight-free water meter liquid crystal display screen display number identification method under poor lighting condition

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination