Method and device for judging coagulation effect based on image, electronic equipment and medium

By processing coagulation images and extracting feature parameters, the equivalent particle size and fractal dimension are calculated, solving the problem of inaccurate judgment of coagulation effect in existing technologies, and realizing the optimal use of coagulants and improving water treatment efficiency.

CN117237321BActive Publication Date: 2026-07-07HUANENG HAINAN POWER GENERATION CO LTD DONGFANG POWER PLANT +2

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HUANENG HAINAN POWER GENERATION CO LTD DONGFANG POWER PLANT
Filing Date
2023-10-09
Publication Date
2026-07-07

AI Technical Summary

Technical Problem

Existing technologies make it difficult to accurately determine the coagulation effect, which affects the efficiency of the water treatment process and the optimization of coagulant use.

Method used

After acquiring the coagulation image and performing grayscale conversion, median filtering, and histogram equalization, binarization is performed using the three-frame difference method and particle swarm optimization enhancement Otsu method to extract the feature parameters of the flocs, and the equivalent particle size and fractal dimension are calculated to determine the coagulation effect.

Benefits of technology

It enables accurate judgment of coagulation effect, ensures optimal use of coagulant during coagulation process, and improves the efficiency and effect of water treatment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117237321B_ABST
    Figure CN117237321B_ABST
Patent Text Reader

Abstract

The application provides a method and device for judging coagulation effect based on images, electronic equipment and medium. The method comprises the following steps: acquiring a coagulation image; performing binaryzation processing on the coagulation image to acquire a binaryzation image corresponding to the coagulation image; acquiring a characteristic parameter of a flocculating body in the binaryzation image; acquiring an equivalent particle size and a fractal dimension of the flocculating body according to the characteristic parameter; and judging the coagulation effect according to the equivalent particle size and the fractal dimension. The equivalent particle size and the fractal dimension can be used to more accurately judge the coagulation effect, and the difference in the coagulation effect under different coagulation conditions can be determined, thereby providing data support for determining the optimal coagulant dosage in the water treatment coagulation process, and the coagulation effect is ensured to be optimal.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of water treatment technology, and in particular to a method, apparatus, electronic device and medium for judging coagulation effect based on images. Background Technology

[0002] Water is essential for human survival. For the entire ecological environment, water resources are the most important factor in the environment. However, with the rapid increase in population, urbanization, industrialization, and the increasing demand for irrigation water, coupled with serious water pollution and the destruction of the balance of the aquatic ecosystem, my country's water resource crisis has become increasingly prominent.

[0003] It should be noted that coagulation is a widespread process in natural water bodies. Accompanied by the migration and transformation of particulate matter and other pollutants in the water, coagulation is widely used in water treatment and wastewater treatment, and is often one of the most common and economical methods. How to combine image processing technology to analyze coagulation images in the water treatment process, obtain data related to the coagulation effect, and improve the accuracy of judging the coagulation effect has become an urgent problem to be solved. Summary of the Invention

[0004] The purpose of this application is to at least partially solve one of the technical problems in the aforementioned technologies.

[0005] The first aspect of this application provides a method for judging coagulation effect based on an image, comprising: acquiring a coagulation image; performing binarization processing on the coagulation image to obtain a binarized image corresponding to the coagulation image; acquiring feature parameters of flocs in the binarized image, and acquiring the equivalent particle size and fractal dimension of the flocs based on the feature parameters; and judging the coagulation effect based on the equivalent particle size and the fractal dimension.

[0006] The method for determining coagulation effect based on images provided in the first aspect of this application also has the following technical features, including:

[0007] According to one embodiment of this application, an initial coagulation image is acquired by an image acquisition device, wherein the initial coagulation image is three consecutive frames of coagulation image; the initial coagulation image is subjected to grayscale processing, median filtering processing and histogram equalization processing to obtain the coagulation image.

[0008] According to one embodiment of this application, the step of binarizing the coagulated image to obtain a binarized image corresponding to the coagulated image includes: performing a three-frame difference method to differentiate the coagulated image to obtain a first difference image and a second difference image; performing an AND operation on the first difference image and the second difference image to obtain a target difference image; obtaining an optimal segmentation threshold for the target difference image using particle swarm optimization enhanced by Otsu's method; performing binarization processing on the target difference image based on the optimal segmentation threshold to obtain an initial binarized image corresponding to the coagulated image; and performing morphological processing on the initial binarized image to obtain the binarized image corresponding to the coagulated image.

[0009] According to one embodiment of this application, the binarization processing of the target difference image based on the optimal segmentation threshold includes: if the gray value in the target difference image is greater than or equal to the optimal segmentation threshold, setting the gray value of the target difference image to 1; or, if the gray value in the target difference image is less than the optimal segmentation threshold, setting the gray value of the target difference image to 0.

[0010] According to one embodiment of this application, obtaining the feature parameters of the flocs in the binarized image includes: marking each connected unit in the binarized image using a connected component labeling algorithm; performing a traversal scan of the binarized image to obtain the feature parameters of the flocs in the binarized image, wherein the feature parameters include at least the position, quantity, length, width, area, and perimeter of the flocs.

[0011] According to one embodiment of this application, obtaining the equivalent particle size and fractal dimension of the floc based on the characteristic parameters includes: obtaining the area of ​​the central blank region of the floc and the aspect ratio of the floc; determining the equivalent particle size of the floc based on the area, perimeter, area of ​​the central blank region, and aspect ratio of the floc; and determining the fractal dimension of the floc based on the area and length of the floc.

[0012] A second aspect of this application provides an apparatus for judging coagulation effect based on an image, comprising: a first acquisition module for acquiring a coagulation image; a processing module for performing binarization processing on the coagulation image to acquire a binarized image corresponding to the coagulation image; a second acquisition module for acquiring feature parameters of flocs in the binarized image, and acquiring the equivalent particle size and fractal dimension of the flocs based on the feature parameters; and a judgment module for judging the coagulation effect based on the equivalent particle size and the fractal dimension.

[0013] The second aspect of this application provides an apparatus for judging coagulation effect based on images, which further has the following technical features, including:

[0014] According to one embodiment of this application, the first acquisition module is configured to: acquire an initial coagulation image through an image acquisition device, wherein the initial coagulation image is three consecutive frames of coagulation image; and perform grayscale processing, median filtering processing, and histogram equalization processing on the initial coagulation image to obtain the coagulation image.

[0015] According to one embodiment of this application, the processing module is further configured to: perform differential processing on the coagulated image using a three-frame differential method to obtain a first differential image and a second differential image; perform an AND operation on the first differential image and the second differential image to obtain a target differential image; obtain an optimal segmentation threshold for the target differential image using particle swarm optimization enhanced by Otsu's method; perform binarization processing on the target differential image based on the optimal segmentation threshold to obtain an initial binarized image corresponding to the coagulated image; and perform morphological processing on the initial binarized image to obtain the binarized image corresponding to the coagulated image.

[0016] According to one embodiment of this application, the processing module is configured to: set the gray value of the target difference image to 1 if the gray value in the target difference image is greater than or equal to the optimal segmentation threshold; or set the gray value of the target difference image to 0 if the gray value in the target difference image is less than the optimal segmentation threshold.

[0017] According to one embodiment of this application, the second acquisition module is configured to: mark each connected unit in the binarized image using a connected component labeling algorithm; perform a traversal scan of the binarized image to acquire feature parameters of the flocs in the binarized image, wherein the feature parameters include at least the position, quantity, length, width, area, and perimeter of the flocs.

[0018] According to one embodiment of this application, the second acquisition module is configured to: acquire the area of ​​the central blank region of the flocculant and the aspect ratio of the flocculant; determine the equivalent particle size of the flocculant based on the area, perimeter, area of ​​the central blank region, and aspect ratio of the flocculant; and determine the fractal dimension of the flocculant based on the area and length of the flocculant.

[0019] A third aspect of this application provides an electronic device, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the image-based method for determining coagulation effect provided in the first aspect of this application.

[0020] A fourth aspect of this application provides a non-transitory computer-readable storage medium storing computer instructions for causing the computer to execute the image-based method for judging coagulation effects provided in the first aspect of this application.

[0021] A fifth aspect of this application provides a computer program product that, when executed by an instruction processor, performs the image-based method for judging coagulation effects provided in the first aspect of this application.

[0022] The method and apparatus for judging coagulation effect based on images provided in this application acquire a coagulation image; perform binarization processing on the coagulation image to obtain a corresponding binarized image; obtain the feature parameters of the flocs in the binarized image; obtain the equivalent particle size and fractal dimension of the flocs based on the feature parameters; and judge the coagulation effect based on the equivalent particle size and fractal dimension. This application can more accurately judge the quality of coagulation effect by using the equivalent particle size and fractal dimension. At the same time, it can determine the difference in coagulation effect under different coagulation conditions, providing data support for determining the optimal coagulant dosage in the water treatment coagulation process, thereby ensuring that the coagulation effect reaches the optimal level.

[0023] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description

[0024] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein:

[0025] Figure 1 This is a flowchart illustrating a method for determining coagulation effect based on an image according to an embodiment of this application;

[0026] Figure 2 This is a flowchart illustrating another embodiment of the method for determining coagulation effect based on images in this application;

[0027] Figure 3 This is a flowchart illustrating another embodiment of the method for determining coagulation effect based on images in this application;

[0028] Figure 4 This is a flowchart illustrating another embodiment of the method for determining coagulation effect based on images in this application;

[0029] Figure 5 This illustrates the relationship between equivalent particle size and turbidity removal rate in one embodiment of this application.

[0030] Figure 6 This illustrates the relationship between fractal dimension and sedimentation ratio in one embodiment of this application.

[0031] Figure 7 This is a schematic diagram of the structure of an image-based device for judging coagulation effect according to an embodiment of this application;

[0032] Figure 8 This is a block diagram of an electronic device according to an embodiment of this application. Detailed Implementation

[0033] The embodiments of this application are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this application, and should not be construed as limiting this application.

[0034] The following describes, with reference to the accompanying drawings, a method, apparatus, electronic device, and medium for determining coagulation effect based on images according to embodiments of this application.

[0035] Figure 1 This is a flowchart illustrating an embodiment of the method for determining coagulation effect based on images, as shown below. Figure 1 As shown, the method includes:

[0036] S101, Obtain the coagulation image.

[0037] Coagulation includes coagulation and flocculation. Coagulation refers to the destabilization process of colloids in water, while flocculation refers to the aggregation process of destabilized particles.

[0038] It should be noted that this application does not limit the specific method for obtaining concrete images, and the appropriate method can be selected according to the actual situation.

[0039] Optionally, an initial coagulation image can be acquired using an image acquisition device. The initial coagulation image consists of three consecutive coagulation images. The initial coagulation image is then subjected to grayscale processing, median filtering, and histogram equalization to obtain the coagulation image.

[0040] For example, the image acquisition device can be an industrial digital camera.

[0041] It should be noted that industrial digital cameras, compared to traditional consumer cameras, have higher image stability, higher transmission capacity, and higher anti-interference capability.

[0042] It should be noted that converting the initial coagulation image to grayscale reduces the computational load of subsequent image processing.

[0043] For example, the initial confounded image can be converted to grayscale using a grayscale processing formula:

[0044] Grey = 0.22R + 0.70G + 0.08B

[0045] Where Grey is the grayscale value of the coagulated image; R is the red primary color value of the initial coagulated image; G is the yellow primary color value of the initial coagulated image; and B is the green primary color value of the initial coagulated image after grayscale conversion.

[0046] It should be noted that since there are many sound sources or light sources in the background environment during the acquisition of coagulation images, they will affect the subsequent processing of coagulation images. Median filtering and histogram equalization can increase the contrast of coagulation images, thereby improving the clarity of coagulation images and making the floc features in the coagulation images more prominent, which is beneficial to the subsequent recognition and feature extraction of coagulation images.

[0047] S102, perform binarization processing on the coagulation image to obtain the binarized image corresponding to the coagulation image.

[0048] In this embodiment of the application, after obtaining the coagulation image, the coagulation image can be binarized to obtain the binarized image corresponding to the coagulation image.

[0049] It should be noted that this application performs binarization processing on the coagulation image, and the specific method for obtaining the corresponding binarized image of the coagulation image is not limited and can be selected according to the actual situation.

[0050] Optionally, the coagulation image can be differentiated using a three-frame difference method to obtain a difference image. The optimal segmentation threshold of the difference image can be obtained based on the particle swarm optimization-enhanced Otsu method. The difference image can then be binarized using the segmentation threshold to obtain the binarized image corresponding to the coagulation image.

[0051] S103: Obtain the feature parameters of the flocs in the binarized image, and obtain the equivalent particle size and fractal dimension of the flocs based on the feature parameters.

[0052] It should be noted that this application does not limit the specific method for obtaining the feature parameters of flocs in the binarized image, and the method can be selected according to the actual situation.

[0053] Alternatively, the feature parameters of flocs in the binarized image can be obtained through a connected component labeling algorithm.

[0054] Optionally, the characteristic parameters include at least the location, quantity, length, width, area, and perimeter of the flocs.

[0055] In the embodiments of this application, after obtaining the characteristic parameters of the flocs, the equivalent particle size and fractal dimension of the flocs can be calculated based on the characteristic parameters.

[0056] Equivalent particle size refers to the diameter of a particle that is used to represent the actual particle diameter when a certain physical property of the particle is the same as or similar to that of an equal amount of spherical particles.

[0057] Among them, fractal dimension is a quantitative characterization of the irregularity and space-filling degree of flocs.

[0058] S104, the coagulation effect is judged based on the equivalent particle size and fractal dimension.

[0059] It should be noted that the equivalent particle size of flocs has a good correlation with the turbidity removal rate, which can reflect the quality of coagulation. The fractal dimension of flocs has a good correlation with the sedimentation ratio, which can also reflect the quality of coagulation.

[0060] In the embodiments of this application, after obtaining the equivalent particle size and fractal dimension, the coagulation effect can be determined based on the equivalent particle size and fractal dimension.

[0061] Optionally, for different water treatment scenarios, different equivalent particle size ranges and fractal dimension ranges can be preset according to the actual production conditions. The coagulation effect can be judged by the equivalent particle size and the preset equivalent particle size curve range, and the fractal dimension and the preset fractal dimension range.

[0062] It should be noted that the equivalent particle size of flocs has a good correlation with the turbidity removal rate, which can reflect the quality of coagulation. The fractal dimension of flocs has a good correlation with the sedimentation ratio, which can also reflect the quality of coagulation.

[0063] For example, in water treatment scenario 1, the preset equivalent particle size range is [x1, x2]. When the obtained equivalent particle size is within the preset equivalent particle size range [x1, x2], it can be determined that the turbidity removal rate is good. The preset fractal dimension range is [y1, y2]. When the obtained fractal dimension is within the fractal dimension range [y1, y2], it can be determined that the settling performance of the flocs is good.

[0064] The method for judging coagulation effect based on images proposed in this application involves acquiring a coagulation image; performing binarization processing on the coagulation image to obtain a corresponding binarized image; obtaining the feature parameters of the flocs in the binarized image; obtaining the equivalent particle size and fractal dimension of the flocs based on the feature parameters; and judging the coagulation effect based on the equivalent particle size and fractal dimension. This application can more accurately judge the quality of coagulation effect by using the equivalent particle size and fractal dimension. At the same time, it can determine the difference in coagulation effect under different coagulation conditions, providing data support for determining the optimal coagulant dosage in the water treatment coagulation process, thereby ensuring that the coagulation effect reaches the optimal level.

[0065] In the above embodiments, the specific process of binarizing the coagulation image to obtain the corresponding binarized image can be described in conjunction with... Figure 2 To understand further, Figure 2 This is a flowchart illustrating another embodiment of the method for determining coagulation effect based on images, as shown below. Figure 2 As shown, the method includes:

[0066] S201, the coagulated image is differentially divided using the three-frame differential method to obtain the first differential image and the second differential image.

[0067] Among them, the three-frame difference method detects moving targets by comparing three consecutive frames of images.

[0068] For example, when the image is M, the previous frame image is M. t-1 The current frame image is M t The next frame image is M t+1 The structure is formed by combining three frames of image M using the three-frame difference method. t-1 M t M t+1 By performing a difference operation on the front and back, the first difference image D is obtained. t+1 Second difference image D t .

[0069] Optionally, the first difference image and the second difference image are compared pixel by pixel. If the pixel difference between the two difference images is large, it indicates that there is a moving target in the image.

[0070] S202, Perform an AND operation on the first difference image and the second difference image to obtain the target difference image.

[0071] In this embodiment of the application, after obtaining the first difference image D t+1 and D t Then, the first difference image D can be processed. t+1 Second difference image D t+1 Performing an AND operation yields the target difference image D. i .

[0072] S203, using particle swarm optimization to enhance the Otsu method, obtains the optimal segmentation threshold for the target difference image.

[0073] Optionally, the target difference image is fully traversed by the improved particle swarm optimization enhanced Otsu method (OTSU) to determine the optimal segmentation threshold i of the target difference image.

[0074] For example, the pixels in the target difference image can be sorted by gray value from smallest to largest, the cumulative probability of the pixels in each gray level can be calculated, the inter-class method of background and foreground can be calculated, and the threshold with the largest variance can be selected as the optimal segmentation threshold i.

[0075] S204, Binarize the target difference image based on the optimal segmentation threshold to obtain the initial binarized image corresponding to the coagulated image.

[0076] In this embodiment of the application, if the gray value in the target difference image is greater than or equal to the optimal segmentation threshold, the gray value of the target difference image is set to 1; if the gray value in the target difference image is less than the optimal segmentation threshold, the gray value of the target difference image is set to 0.

[0077] S205, perform morphological processing on the initial binarized image to obtain the binarized image corresponding to the coagulated image.

[0078] It should be noted that this application does not limit the specific method of morphological processing of the initial binarized image, and the method can be selected according to the actual situation.

[0079] Optionally, morphological closing operations can be performed on the initial binarized image to obtain the binarized image corresponding to the coagulated image.

[0080] Optionally, a morphological opening operation can be performed on the initial binarized image to obtain the binarized image corresponding to the coagulated image.

[0081] It should be noted that the closing operation is to first perform an expansion operation on the same structuring element and then perform an erosion operation. This can connect the target and fill in the tiny holes or gaps and discontinuities in the structuring element.

[0082] It should be noted that the opening operation performs erosion and then dilation on the same structuring element, which can filter and separate the initial binarized image, ensuring that the initial binarized image does not produce global geometric distortion.

[0083] Among them, the erosion operation can separate two objects with small connections and effectively remove the boundary points of the objects. The dilation operation can effectively identify the background target relative to the target in front of the image as the detection target and fill the holes in the initial binarized image.

[0084] The method for judging coagulation effect based on images proposed in this application involves differentiating the coagulation image using a three-frame difference method to obtain a first difference image and a second difference image. A bitwise AND operation is then performed on the first and second difference images to obtain a target difference image. The optimal segmentation threshold for the target difference image is obtained by enhancing the Otsu method with particle swarm optimization. Based on the optimal segmentation threshold, the target difference image is binarized to obtain an initial binarized image corresponding to the coagulation image. Morphological processing is then performed on the initial binarized image to obtain the corresponding binarized image. This method can quickly and accurately determine the binarized image corresponding to the coagulation image, laying the foundation for subsequent extraction of feature parameters of the flocs.

[0085] The process of obtaining the feature parameters of flocs in a binary image, as proposed in this application, will be explained below.

[0086] In the above embodiments, the specific process for obtaining the characteristic parameters of the flocs can be described in conjunction with... Figure 3 To understand further, Figure 3 This is a flowchart illustrating another embodiment of the method for determining coagulation effect based on images, as shown below. Figure 3 As shown, the method includes:

[0087] S301, each connected unit in the binarized image is labeled using a connected component labeling algorithm.

[0088] S302, perform a traversal scan of the binarized image to obtain the feature parameters of the flocs in the binarized image, wherein the feature parameters include at least the position, number, length, width, area and perimeter of the flocs.

[0089] It should be noted that the feature parameters of flocs can be extracted by identifying connected units. All connected units in the binarized image can be obtained, each unit can be uniquely labeled, and the feature parameters of the flocs in the binarized image can be determined by traversing and scanning.

[0090] Alternatively, a nested loop function GetLabel(int x, int y, int counter) can be used to perform a traversal scan, assigning a label value to all pixels in the binarized image. Pixels with the same label value belong to the same floc. The variable counter is used, and its value is the number of flocs. The total value of all pixels of each floc is the area of ​​the floc.

[0091] Optionally, the number of flocs n is the number of units marked in the binarized image. The last marked number represents the total number of connected units, i.e., the number of flocs in the binarized image. The number of flocs n can be stored in the variable real Floc Number = counter.

[0092] Optionally, the length L of the floc is the maximum size of the floc in the horizontal direction. Let Ti be a floc target in the binary image. If the length and width of the floc meet the optimal segmentation threshold i, then the length L of the floc is the difference between the maximum length and the minimum length, where the units of length and width are pixels.

[0093] Optionally, the width W of the floc is the maximum size of the floc in the vertical direction. Let Ti be a floc target in the binary image. If the length and width of the floc meet the optimal segmentation threshold i, then the width W of the floc is the difference between the maximum width and the minimum width, where the units of length and width are pixels.

[0094] Optionally, the perimeter C of the floc is the number of pixels with the same marked number during the scanning process that are all located outside the same number. For example, if the number of pixels marked with the number 1 are outside the same number, then the perimeter L of the floc marked with the number 1 is n1. The perimeter C is stored in the variable floc Perimeter, and the perimeter C of each floc can be obtained using the above method.

[0095] Optionally, the area S of the floc is the total number of pixels corresponding to each number during the scanning process. For example, if the number of pixels marked as number 2 is n2, then the area S of the floc marked as number 2 is n2. The area of ​​the floc is stored in the variable floc Area[i], and the area S of each floc can be obtained using the above method.

[0096] It should be noted that the units for the length, width, area, and perimeter of each floc are pixels. Optionally, the units for the length, width, area, and perimeter of the floc can be converted from pixels to millimeters, micrometers, etc., according to a pre-set proportional conversion relationship.

[0097] Furthermore, in order to calculate the equivalent particle size and fractal dimension of the flocs, after converting the units of the length, width, area, and perimeter of the flocs, the arithmetic mean of the length, width, area, and perimeter of the flocs can be taken to obtain the mean length, mean width, mean perimeter, and mean area of ​​the flocs in the binarized image. The equivalent particle size and fractal dimension of the flocs can then be calculated using the mean length, mean width, mean perimeter, and mean area of ​​the flocs.

[0098] In the above embodiments, the specific process of obtaining the equivalent particle size and fractal dimension of the flocs based on the characteristic parameters can be described in conjunction with... Figure 4 To understand further, Figure 4 This is a flowchart illustrating another embodiment of the method for determining coagulation effect based on images, as shown below. Figure 4 As shown, the method includes:

[0099] S401, obtain the area of ​​the blank area in the middle of the floc and the aspect ratio of the floc.

[0100] The area of ​​the blank central region of the floc is the proportion of the hollow area to the total area of ​​the floc.

[0101] The aspect ratio of the floc is the ratio of the average length to the average width of the floc.

[0102] S402, determine the equivalent particle size of the floc based on the area, perimeter, area of ​​the blank area in the middle, and aspect ratio of the floc.

[0103] Alternatively, the equivalent particle size d of the flocs can be determined according to the following formula:

[0104]

[0105] Where S is the area of ​​the floc (average area), C is the perimeter of the floc (average perimeter), S0 is the area of ​​the blank area in the middle of the floc, m is the aspect ratio of the floc, k1 is the discount factor for the perimeter, k2 is the discount factor for the aspect ratio, and k3 is the discount factor for the area of ​​the blank area in the middle.

[0106] Optionally, the values ​​of k1, k2, and k3 are between 0 and 1. When k1 is 0, it indicates that there is no discount on the perimeter; when k2 is 0, it indicates that there is no discount on the aspect ratio; when k3 is 0, it indicates that there is no discount on the area of ​​the blank area in the middle. The values ​​of k1, k2, and k3 can be set according to the actual situation of the flocculant.

[0107] S403, determine the fractal dimension of the flocs based on their area and length.

[0108] It should be noted that fractal dimension can be used to characterize the density of flocs. Flocs exhibit self-similarity and a power-law relationship between their characteristic parameters. The fractal dimension D of the flocs can be determined using the following formula. f :

[0109] S∝L Df (2)

[0110] Among them, D fLet S be the fractal dimension of the floc, S be the area (mean area) of the floc, and L be the length (mean length) of the floc.

[0111] The method for judging coagulation effect based on images proposed in this application obtains the area of ​​the blank area in the middle of the floc and the aspect ratio of the floc. Based on the area, perimeter, area of ​​the blank area in the middle, and aspect ratio of the floc, the equivalent particle size of the floc is determined. Based on the area and length of the floc, the fractal dimension of the floc is determined. This application can accurately determine the equivalent particle size and fractal dimension through the characteristic parameters of the floc, laying the foundation for subsequent judgment of coagulation effect.

[0112] The specific process of the image-based method for judging coagulation effect proposed in this application will be explained below.

[0113] For example, in the application scenario of a newly built power plant that needs to treat the raw water from the reservoir during the production process, coagulation is the first process in the water treatment stage. It is necessary to determine the amount and type of coagulant. Therefore, by judging the coagulation effect, the optimal coagulation conditions can be determined.

[0114] First, after determining the coagulation conditions, the coagulant is added to a newly obtained beaker of reservoir raw water and thoroughly mixed on a coagulation mixer. Once the reaction is complete, the mixture is immediately removed. Using an industrial digital camera against a white background, three consecutive coagulation images are taken after mixing. During the shooting process, the flocs are kept in motion, and the beaker is completely captured in the image. The width of the beaker is also captured. Second, the method provided in this application allows for the acquisition of characteristic parameters of the flocs. For example, the characteristic parameters of the flocs (length of the flocs, etc.) can be obtained using MATLAB software. Width, perimeter, and area, etc.), in pixels; Third, based on the microstructure of the flocs, k1 can be set to 0.8, k2 to 0.8, and k3 to 0.6, and the equivalent particle size can be calculated based on equation (1); Fourth, based on equation (2), the fractal dimension can be calculated, where the units of the equivalent particle size and the fractal dimension are pixels. The final equivalent particle size and fractal dimension are obtained after proportional conversion through the beaker width, in mm; Fifth: the relationship between the equivalent particle size and the turbidity removal rate (the relationship between the equivalent particle size and the turbidity removal rate under different dosages of the reagent), such as Figure 5 As shown, the relationship between fractal dimension and sedimentation ratio (under the given dosage of polyaluminum chloride (PAC)) is as follows: Figure 6 As shown, the equivalent particle size is positively correlated with the turbidity removal rate, while the fractal dimension is negatively correlated with the sedimentation ratio. Therefore, the coagulation effect can be judged based on the equivalent particle size and fractal dimension.

[0115] In summary, the image-based method for judging coagulation effect proposed in this application obtains the characteristic parameters of flocs by acquiring and processing coagulation images, and determines the equivalent particle size and fractal dimension of the flocs based on the characteristic parameters. This allows for real-time judgment of the coagulation effect and the ability to assess the differences in coagulation effect under different coagulation conditions at the microscopic level, resulting in a more accurate final coagulation effect. Furthermore, based on the coagulation effect, the most suitable dosage of coagulant for water coagulation treatment can be obtained, maximizing the coagulation effect without wasting coagulant. This method can be applied to the coagulation treatment section in water treatment of various chemical enterprises.

[0116] Figure 7 This is a schematic diagram of the structure of an image-based device for judging coagulation effect according to an embodiment of this application, as shown below. Figure 7 As shown, the device 700 for judging coagulation effect based on image includes a first acquisition module 71, a processing module 72, a second acquisition module 73, and a judgment module 74, wherein:

[0117] The first acquisition module 71 is used to acquire the coagulation image;

[0118] Processing module 72 is used to perform binarization processing on the coagulation image to obtain the binarized image corresponding to the coagulation image;

[0119] The second acquisition module 73 is used to acquire the feature parameters of the flocs in the binarized image, and to acquire the equivalent particle size and fractal dimension of the flocs based on the feature parameters.

[0120] The judgment module 74 is used to judge the coagulation effect based on the equivalent particle size and the fractal dimension.

[0121] The second aspect of this application provides an apparatus for judging coagulation effect based on images, which further has the following technical features, including:

[0122] According to one embodiment of this application, the first acquisition module 71 is configured to: acquire an initial coagulation image through an image acquisition device, wherein the initial coagulation image is three consecutive frames of coagulation image; and perform grayscale processing, median filtering processing and histogram equalization processing on the initial coagulation image to obtain the coagulation image.

[0123] According to one embodiment of this application, the processing module 72 is further configured to: perform differential processing on the coagulated image using a three-frame differential method to obtain a first differential image and a second differential image; perform an AND operation on the first differential image and the second differential image to obtain a target differential image; obtain an optimal segmentation threshold for the target differential image using particle swarm optimization enhanced by Otsu's method; perform binarization processing on the target differential image based on the optimal segmentation threshold to obtain an initial binarized image corresponding to the coagulated image; and perform morphological processing on the initial binarized image to obtain the binarized image corresponding to the coagulated image.

[0124] According to one embodiment of this application, the processing module 72 is configured to: set the gray value of the target difference image to 1 if the gray value in the target difference image is greater than or equal to the optimal segmentation threshold; or set the gray value of the target difference image to 0 if the gray value in the target difference image is less than the optimal segmentation threshold.

[0125] According to one embodiment of this application, the second acquisition module 73 is configured to: mark each connected unit in the binarized image using a connected component marking algorithm; perform a traversal scan of the binarized image to acquire feature parameters of the flocs in the binarized image, wherein the feature parameters include at least the position, quantity, length, width, area, and perimeter of the flocs.

[0126] According to one embodiment of this application, the second acquisition module 73 is configured to: acquire the area of ​​the central blank region of the flocculant and the aspect ratio of the flocculant; determine the equivalent particle size of the flocculant based on the area, perimeter, area of ​​the central blank region, and aspect ratio of the flocculant; and determine the fractal dimension of the flocculant based on the area and length of the flocculant.

[0127] The device for judging coagulation effect based on images proposed in this application acquires a coagulation image; performs binarization processing on the coagulation image to obtain a corresponding binarized image; obtains the feature parameters of the flocs in the binarized image; obtains the equivalent particle size and fractal dimension of the flocs based on the feature parameters; and judges the coagulation effect based on the equivalent particle size and fractal dimension. This application can more accurately judge the quality of coagulation effect by using the equivalent particle size and fractal dimension. At the same time, it can determine the difference in coagulation effect under different coagulation conditions, providing data support for determining the optimal coagulant dosage in the water treatment coagulation process, thereby ensuring that the coagulation effect reaches the optimal level.

[0128] To achieve the above embodiments, this application also provides an electronic device, a computer-readable storage medium, and a computer program product.

[0129] Figure 8 This is a block diagram of an electronic device according to an embodiment of this application, such as... Figure 8 As shown, device 1000 includes memory 101, processor 102, and a computer program stored in memory 101 and executable on processor 102. When processor 102 executes program instructions, it implements the execution of... Figures 1 to 4 The embodiment is a method for judging the coagulation effect based on images.

[0130] To implement the above embodiments, this application also provides a non-transitory computer-readable storage medium storing computer instructions for causing a computer to execute... Figures 1 to 4 An example of an image-based method for determining coagulation effect.

[0131] To implement the above embodiments, this application also provides a computer program product that, when the instruction processor in the computer program product is executed, performs... Figures 1 to 4 An example of an image-based method for determining coagulation effect.

[0132] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

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

[0134] Any process or method description in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing custom logic functions or processes, and the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as should be understood by those skilled in the art to which embodiments of this application pertain.

[0135] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include: an electrical connection having one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Alternatively, the computer-readable medium may be paper or other suitable media on which the program can be printed, since the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in a computer memory.

[0136] It should be understood that various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.

[0137] Those skilled in the art will understand that all or part of the steps of the methods described in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it includes one or a combination of the steps of the method embodiments.

[0138] Furthermore, the functional units in the various embodiments of this application can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.

[0139] The storage medium mentioned above can be a read-only memory, a disk, or an optical disk, etc. Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of this application.

Claims

1. A method for judging coagulation effect based on images, characterized in that, The method includes: Obtain the coagulation image; The coagulation image is binarized to obtain the corresponding binarized image. The feature parameters of the flocs in the binarized image are obtained, and the equivalent particle size and fractal dimension of the flocs are obtained based on the feature parameters. The coagulation effect is determined based on the equivalent particle size and the fractal dimension. An initial coagulation image is acquired using an image acquisition device, wherein the initial coagulation image consists of three consecutive frames of coagulation images; The initial confounded image is subjected to grayscale conversion, median filtering, and histogram equalization to obtain the confounded image. The step of binarizing the coagulation image to obtain the corresponding binarized image includes: The coagulated image is differentially divided using a three-frame differential method to obtain a first differential image and a second differential image; The target difference image is obtained by performing a bitwise AND operation on the first difference image and the second difference image; The optimal segmentation threshold for the target difference image is obtained by enhancing the Otsu method through particle swarm optimization. The target difference image is binarized based on the optimal segmentation threshold to obtain the initial binarized image corresponding to the confounded image; The initial binarized image is subjected to morphological processing to obtain the binarized image corresponding to the coagulated image; The step of obtaining the feature parameters of the flocs in the binarized image includes: Each connected unit in the binarized image is labeled using a connected component labeling algorithm; The binarized image is scanned traversally to obtain the feature parameters of the flocs in the binarized image, wherein the feature parameters include at least the position, number, length, width, area and perimeter of the flocs; The step of obtaining the equivalent particle size and fractal dimension of the flocs based on the characteristic parameters includes: Obtain the area of ​​the central blank region of the flocculant and the aspect ratio of the flocculant; The equivalent particle size of the flocculant is determined based on its area, perimeter, area of ​​the blank region in the middle, and aspect ratio. The fractal dimension of the floc is determined based on the area and length of the floc.

2. The method according to claim 1, characterized in that, The binarization process of the target difference image based on the optimal segmentation threshold includes: If the grayscale value in the target difference image is greater than or equal to the optimal segmentation threshold, the grayscale value of the target difference image is set to 1; or, If the grayscale value in the target difference image is less than the optimal segmentation threshold, the grayscale value of the target difference image is set to 0.

3. A device for judging coagulation effect based on images, characterized in that, The apparatus implements the method as described in claim 1, the apparatus comprising: The first acquisition module is used to acquire the coagulation image; The processing module is used to perform binarization processing on the coagulation image to obtain the binarized image corresponding to the coagulation image; The second acquisition module is used to acquire the feature parameters of the flocs in the binarized image, and to acquire the equivalent particle size and fractal dimension of the flocs based on the feature parameters. The judgment module is used to judge the coagulation effect based on the equivalent particle size and the fractal dimension.

4. An electronic device, characterized in that, include: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-2.

5. A non-transitory computer-readable storage medium storing computer instructions, characterized in that, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-2.