A machine vision-based method and system for monitoring a foam layer in a waste liquid neutralization tank

By fusing multi-tilt-angle foam images and dynamic gradient weighting coefficients, combined with morphological operations and the watershed algorithm, the problem of missed detection of sparse foam layers was solved, achieving high-precision foam layer monitoring and ensuring the stable operation of the wastewater treatment system.

CN121544593BActive Publication Date: 2026-04-14SHAANXI HIGH TECH ENVIRONMENTAL PROTECTION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-01-15
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

In existing technologies, threshold-based image segmentation algorithms are prone to missing sparse foam layers in waste liquid and pool foam layer monitoring scenarios, resulting in low monitoring accuracy.

Method used

By fusing multi-tilt-angle foam images using a weighted average method, and combining gradient saliency features and morphological features, a dynamic adaptive gradient weighting coefficient calculation model is adopted. By combining normalized gray values ​​and gradient weighting coefficients, a dual saliency feature system is constructed. Foam sub-regions are segmented using morphological operations and watershed algorithms, and foam coverage, equivalent circle diameter, and instantaneous foam flow velocity are calculated. The movement of foam sub-regions is tracked by feature point matching, the probability of foam attribution is calculated, and a probability threshold is set to filter foam pixels, thereby achieving hierarchical early warning.

Benefits of technology

It significantly improves the identification accuracy of sparse foam areas, reduces the probability of missed detection, enhances the accuracy and reliability of foam layer monitoring, and ensures the stable operation and compliant discharge of wastewater treatment systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121544593B_ABST
    Figure CN121544593B_ABST
Patent Text Reader

Abstract

The present application belongs to the technical field of image processing, and particularly relates to a waste liquid neutralization tank foam layer monitoring method and system based on machine vision, which comprises the following steps: obtaining a fusion image by using a weighted average method, calculating the gradient amplitude and local entropy value of a pixel point based on the image, combining the normalized gray value and the gradient weighting coefficient to extract the gradient significant feature; determining a segmentation threshold based on the gradient significant feature, segmenting to obtain a binary foam image, and calculating the global foam coverage; extracting a foam sub-region in the binary foam image, calculating the equivalent circle diameter of the sub-region, obtaining the instantaneous foam flow rate through feature point matching, combining the foam coverage and the equivalent circle diameter to obtain the morphological significant feature, weighting and summing the gradient significant feature to obtain the foam attribution probability, setting a probability threshold to screen the foam pixel points, setting the foam overflow degree level based on the area ratio, and performing early warning. The present application improves the accuracy of foam layer monitoring.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology. More specifically, this invention relates to a machine vision-based method and system for monitoring the foam layer in a waste liquid neutralization tank. Background Technology

[0002] Waste liquid neutralization tanks are the core facilities for wastewater treatment. During the neutralization process, a large amount of foam is continuously generated. If the foam accumulates excessively, it may overflow, which can cause problems such as system shutdown, incomplete neutralization of waste liquid, and environmental pollution risks. Therefore, it is necessary to use a machine vision system to monitor the foam layer in the waste liquid neutralization tank in real time.

[0003] The purpose of using a machine vision system to monitor the foam layer in the waste liquid neutralization tank in real time is to obtain the overflow status of the foam layer in real time, provide data support for defoaming control and process adjustment, and ensure the stable operation of the treatment system and compliant discharge. In the existing technology, a threshold-based image segmentation algorithm is usually used to segment the collected foam layer image to identify the foam layer area.

[0004] However, in the waste liquid neutralization pool scenario, threshold-based image segmentation algorithms have significant limitations: the core assumption of threshold-based image segmentation algorithms is that the target and background are separable in terms of color or grayscale. However, in this scenario, the foam layer itself has a gradient characteristic from dense to sparse and from white to semi-transparent. Especially in the sparse foam area, its color is very close to the color of the waste liquid below. Therefore, traditional threshold-based image segmentation algorithms cannot distinguish the real sparse foam layer. As a result, during the segmentation process, areas that originally belong to the sparse foam layer are mistakenly identified as waste liquid areas, ultimately causing serious missed detection of the sparse foam layer and severely affecting the accuracy of monitoring the foam layer in the waste liquid neutralization pool. Summary of the Invention

[0005] To address the technical problems of low accuracy and missed detection of sparse foam layers in waste liquid and pool foam layer monitoring scenarios, the present invention provides solutions in the following aspects.

[0006] In a first aspect, the present invention provides a machine vision-based method for monitoring the foam layer in a waste liquid neutralization tank, comprising: acquiring foam images and constructing a rectangular coordinate system; fusing the foam images corresponding to each pitch angle using a weighted average method to obtain a fused foam image; calculating the gradient magnitude and entropy of the gradient magnitude in the local neighborhood of each pixel based on the fused foam image; combining the normalized gray value and the gradient weighting coefficient to obtain the gradient saliency features of each pixel belonging to the foam region; calculating the mean and standard deviation based on the gradient saliency features to determine a segmentation threshold; obtaining a binary foam image through threshold segmentation; and calculating the ratio of the total number of pixels in the binary foam image to the total number of pixels in the fused foam image to obtain the foam coverage. The coverage rate is determined by performing morphological operations and watershed segmentation on a binary foam image to obtain several foam sub-regions. The equivalent circle diameter of each foam sub-region is calculated. The movement of each foam sub-region in the continuous binary foam image is tracked by feature point matching. The instantaneous foam velocity of each foam sub-region is calculated. After normalization, the foam coverage rate, equivalent circle diameter, and instantaneous foam velocity are fused to obtain the morphological salient features of each foam sub-region. The gradient salient features of each pixel are weighted and fused with the morphological salient features of the corresponding foam sub-region to calculate the probability of each pixel belonging to the foam region. A probability threshold is set to filter foam pixels. The degree of foam overflow is classified according to the area ratio to achieve graded early warning.

[0007] This method enhances image information integrity by fusing foam images from multiple elevation angles. It constructs a dual saliency feature system combining gradient and morphological features, overcoming the limitations of traditional threshold segmentation which relies on a single grayscale feature. This allows for accurate identification of dense and sparse foam regions, effectively addressing the issue of missed detections in sparse foam layers and improving the accuracy and reliability of foam layer monitoring. Furthermore, this invention achieves precise screening of foam pixels by calculating foam attribution probabilities. Combined with a graded early warning mechanism based on area proportions, it provides real-time and effective data support for defoaming control and process adjustment in wastewater neutralization tanks, ensuring the stable operation and compliant discharge of wastewater treatment systems.

[0008] Preferably, the step of fusing the foam images corresponding to each pitch angle using a weighted average method to obtain the fused foam image includes: In the formula, It is the merged bubble image; It is the index of the pitch angle; It is the pitch angle. The corresponding angle; It is the pitch angle. The corresponding bubble image.

[0009] Preferably, the method for obtaining the gradient weighting coefficients includes: In the formula, These are gradient weighting coefficients; It is a preset base weight; It is a regulatory factor; It is the absolute value symbol; It is a pixel. In foam images The normalized grayscale value in the image.

[0010] This method effectively addresses the limitation of traditional fixed-weight strategies in adapting to the gray-scale gradient characteristics of foam layers by constructing a dynamically adaptive gradient weighting coefficient calculation model, significantly improving the recognition accuracy of sparse foam regions. This dynamic adjustment mechanism enables the gradient weighting coefficients to adaptively match decision requirements based on the gray-scale distribution characteristics of pixels, preserving the efficient discrimination ability of gray-scale features for high-contrast regions while strengthening the supplementary discrimination role of gradient entropy features for low-contrast blurred regions. This further reduces the probability of missed detection in sparse foam layers, ensuring the overall accuracy and reliability of foam layer monitoring.

[0011] Preferably, obtaining the gradient saliency features of each pixel belonging to the bubble region includes: In the formula, It is a pixel. The gradient significance of the region belonging to the bubble region, with a value range of [value range missing]. ; They are pixels In foam images The normalized grayscale value and normalized gradient magnitude in the data; It is the gray-scale weighting coefficient; These are gradient weighting coefficients; It is a natural exponential function.

[0012] This method constructs a weighted model by fusing normalized grayscale values ​​and normalized gradient magnitudes, and then maps these values ​​using the Sigmoid function to achieve accurate quantification of pixel bubble attributes. The normalized grayscale values ​​serve as the fundamental distinguishing element between the bubble and the background, while the normalized gradient magnitude compensates for the shortcomings in grayscale discrimination in sparse bubble regions. The two elements complement each other through dynamic weighting to adapt to different bubble scenarios. The Sigmoid function normalizes the feature values ​​to... The interval directly reflects the probability of a pixel belonging to a bubble, effectively breaking through the limitations of traditional single features, taking into account both dense and sparse bubble recognition, improving the distinguishability of gradient saliency features, and providing support for subsequent accurate segmentation and solving the problem of missed detection.

[0013] Preferably, the step of calculating the mean and standard deviation based on the gradient saliency features to determine the segmentation threshold includes: calculating the mean and standard deviation of the gradient saliency features of each pixel belonging to the bubble region, denoted as […]. Set the segmentation threshold ,in, The preset adjustment coefficient is used; pixels corresponding to gradient salient features greater than the segmentation threshold are assigned a value of 1, and pixels corresponding to gradient salient features less than or equal to the segmentation threshold are assigned a value of 0, thus obtaining a binary bubble image.

[0014] Preferably, the calculation of the equivalent circle diameter of each foam sub-region includes: In the formula, It is the first The equivalent circle diameter of the foam sub-region; It is the index of the foam sub-region; It is the first The total number of pixels in the foam sub-region.

[0015] This method standardizes and quantifies the geometric dimensions of irregular foam sub-regions by converting the total number of pixels in the foam sub-region into an equivalent circle diameter. This approach eliminates the need for complex morphological fitting; it accurately reflects the actual size of the foam sub-region simply through the direct conversion between area and equivalent circle diameter. This simplifies the calculation process and avoids interference from irregular foam morphology in size assessment. Furthermore, the standardized equivalent circle diameter provides a unified geometric parameter basis for subsequent fusion of instantaneous foam flow velocity and foam coverage to construct salient morphological features, ensuring consistency in feature comparison between foam sub-regions of different morphologies and further improving the accuracy of foam layer morphology analysis.

[0016] Preferably, the calculation of the instantaneous foam velocity in each foam sub-region includes: In the formula, It is the first Instantaneous foam velocity in the foam sub-region; They are the first The foam sub-region in the first Second, the The x-coordinate of the centroid of the second; They are the first The foam sub-region in the first Second, the The ordinate of the centroid coordinate of the second; The preset total time interval, The time interval between two consecutive data collections is 2 seconds.

[0017] This method accurately quantifies the dynamic motion characteristics of foam by tracking the changes in the centroid coordinates of continuous foam sub-regions and calculating the instantaneous foam velocity by combining the preset total time interval and the time interval between adjacent acquisitions. Based on the direct conversion between the displacement distance and time span of the centroid coordinates, this approach is logically simple and computationally efficient, stably capturing the migration patterns of foam sub-regions. Simultaneously, the quantified instantaneous foam velocity, as a dynamic feature, complements the equivalent circle diameter and foam coverage, providing key dynamic parameters for constructing salient morphological features. This effectively overcomes the limitations of traditional static morphological analysis and further improves the comprehensiveness and accuracy of foam layer monitoring.

[0018] Preferably, obtaining the morphological features of each foam sub-region includes: In the formula, It is the first The morphological features of the foam sub-region; It represents the bubble coverage of the binary bubble image in the bubble image; It is the diameter of the reference equivalent circle; It is a reference instantaneous foam flow rate; It is the first The equivalent circle diameter of the foam sub-region; It is the first Instantaneous foam velocity in the foam sub-region.

[0019] Preferably, calculating the probability of each pixel belonging to the foam region includes: In the formula, It is located in The probability that a pixel belongs to a bubble region, with a value ranging from 0 to 1; It is located in The gradient salient features of the pixels; It is the first The morphological features of the foam sub-region; It is the feature fusion coefficient.

[0020] Secondly, the present invention provides a machine vision-based foam layer monitoring system for waste liquid neutralization tanks, including a processor and a memory. The memory stores computer program instructions, and when the computer program instructions are executed by the processor, the aforementioned machine vision-based foam layer monitoring method for waste liquid neutralization tanks is implemented.

[0021] By adopting the above technical solution, a computer program for monitoring the foam layer of a waste liquid neutralization tank based on machine vision is generated and stored in a memory so that it can be loaded and executed by a processor. A terminal device can then be made based on the memory and processor for convenient use.

[0022] The beneficial effects of this invention are as follows: It effectively solves the pain points of traditional threshold segmentation algorithms, such as missing sparse foam and having a single monitoring dimension, and significantly improves the accuracy and reliability of foam layer monitoring in wastewater neutralization tanks. By fusing foam images from multiple elevation angles using a weighted average method, it integrates multi-view information, making up for the shortcomings of single-view coverage and detail, and laying a complete foundation for feature extraction. Based on the fused image, it extracts gradient magnitude and local neighborhood gradient entropy values, and combines normalized gray values ​​and dynamic gradient weighting coefficients to obtain gradient saliency features, breaking through the limitations of single gray features, accurately identifying dense and sparse foam, and significantly reducing the probability of missed detection. By adaptively determining the segmentation threshold through gradient saliency features, it segments foam sub-regions through morphological operations and watershed algorithms, quantifies foam coverage, equivalent circle diameter, and instantaneous foam flow velocity, and fuses them into morphological saliency features, taking into account the global distribution of the foam layer and the geometric and dynamic characteristics of sub-regions, making up for the shortcomings of traditional static monitoring. Finally, it weights and fuses the two types of saliency features, filters pixels by foam belonging probability, and achieves hierarchical early warning by combining area proportion, avoiding system shutdowns and pollution caused by excessive foam accumulation, and ensuring the stable operation and compliant discharge of wastewater treatment systems. Attached Figure Description

[0023] Figure 1 This is a flowchart illustrating a machine vision-based method for monitoring the foam layer in a waste liquid neutralization tank according to the present invention.

[0024] Figure 2 The image is an original image schematically illustrating a machine vision-based method for monitoring the foam layer in a waste liquid neutralization tank according to the present invention.

[0025] Figure 3 This is a schematic diagram illustrating the gradient saliency features of a machine vision-based method for monitoring the foam layer in a waste liquid neutralization tank according to the present invention.

[0026] Figure 4 This is a schematic diagram illustrating the foam monitoring results of a machine vision-based foam layer monitoring method for waste liquid neutralization tanks according to the present invention.

[0027] Figure 5 This is a schematic diagram illustrating a comparison of foam monitoring in a waste liquid neutralization tank based on machine vision, according to the present invention. Detailed Implementation

[0028] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0029] The specific embodiments of the present invention will now be described in detail with reference to the accompanying drawings.

[0030] This invention discloses a machine vision-based method for monitoring the foam layer in a waste liquid neutralization tank, referring to... Figure 1 This includes steps S1-S4:

[0031] S1. Based on the environment of the waste liquid neutralization tank, acquire the original image and perform preprocessing to obtain the foam image.

[0032] It should be noted that the overall logic of this step is to acquire complete image information of the foam layer in the waste liquid neutralization tank through multi-angle image acquisition, so as to provide a high-quality data foundation for subsequent foam feature analysis. The operation process involves the construction of an image acquisition system. The parameter design logic of the system is based on the light propagation model to optimize the imaging parameters, thereby eliminating ambient light interference and enhancing the recognizability of foam features.

[0033] Specifically, four industrial cameras are fixedly installed at appropriate positions above the waste liquid and pool, and the index for the pitch angle is set to... ,when At that time, the corresponding pitch angles are respectively for The surface of the waste liquid neutralization tank is photographed at various pitch angles to ensure that the field of view of all industrial cameras can completely cover the entire surface of the waste liquid neutralization tank. The industrial cameras are equipped with LED light sources to ensure that the original images of the tank surface captured in dim environments have uniform illumination. The industrial cameras capture original images at a frequency of 1 frame per second and transmit the captured original images to the processing unit via a wireless network. The acquisition frequency is adaptively adjusted according to the foam generation rate of the waste liquid neutralization tank.

[0034] Furthermore, the acquired raw images are preprocessed to improve quality: Gaussian filtering is used to reduce sensor noise in the raw images; for raw images with uneven illumination, homomorphic filtering is used for illumination correction to ensure that the brightness of the raw images in different areas of the waste liquid and the pool surface remains consistent; during the initial system setup phase, the image area corresponding to the inner side of the pool wall is manually calibrated to complete the ROI area calibration, and background information such as the factory structure outside the ROI area is removed from the raw images. The raw images after removal are then grayscaled to obtain foam images, enabling precise focusing analysis of the foam area on the pool surface.

[0035] By following the steps described above, you can obtain the original image. Please refer to [link / reference]. Figure 2 As shown, Figure 2 This is the original image of a machine vision-based method for monitoring the foam layer in a waste liquid neutralization tank according to the present invention. As can be seen from the image, large areas of white in the original image represent dense foam, small bubbles and semi-transparent textures represent sparse foam, and dark areas represent the waste liquid background.

[0036] S2. Based on multi-view weighted fusion images, the gradient saliency features of the bubble region are dynamically calculated by combining gray-level features and local gradient entropy features.

[0037] It should be noted that the overall logic of this step is based on the characteristic that sparse foam has a similar color to the waste liquid background but has bubble texture on its surface. By fusing image grayscale features and local gradient entropy features, the local texture energy of the image is calculated to enhance the contrast between the foam area and the waste liquid background. This breaks through the limitations of traditional segmentation based on a single grayscale threshold and solves the technical problem of missed detection of sparse foam layers.

[0038] Specifically, taking the bottom left pixel of the bubble image as the origin, the horizontal direction to the right is... The axis, vertically upward direction is A Cartesian coordinate system is constructed using axes; the foam images from various viewpoints are fused using a weighted average method to obtain the fused foam image. The relationship is as follows:

[0039] ;

[0040] In the formula, It is the merged bubble image; It is the index of the pitch angle; It is the pitch angle. The corresponding angle; It is the pitch angle. The corresponding bubble image.

[0041] Furthermore, based on the fused foam image Perform the following operations to calculate the gradient salient features of pixels: calculate the bubble image using the Scharr gradient operator. The gradient magnitude of each pixel in the bubble image, for example. In the middle position The gradient magnitude of the pixel at point is denoted as ; in pixels Set as the center Size of local neighborhood window Exemplary ; Calculate the local neighborhood window The entropy value of the gradient magnitude of all pixels within the range is denoted as . Used to reflect pixels local neighborhood window centered Within, the degree of disorder in the gradient magnitude of pixels; extracting pixels. In foam images The normalized grayscale value and the normalized gradient magnitude in the image are denoted as follows: Normalization methods can use maximum and minimum value normalization.

[0042] It should be noted that the foam region, due to its rich bubble texture, exhibits a more chaotic distribution of local gradient amplitudes and a higher entropy value; while the uniform waste liquid background shows a more ordered gradient amplitude distribution and a lower entropy value. Therefore, its gradient weighting coefficient... It should be dynamically adjusted to address situations where grayscale features become ineffective, i.e. The ability to make judgments is enhanced when the value is in the intermediate ambiguity range.

[0043] Specifically, since the foam area exhibits higher overall brightness while the waste liquid background has lower brightness, grayscale characteristics are the fundamental feature distinguishing the two. For example, a grayscale weighting coefficient is assigned as follows: Secondly, to address the issue of sparse foam having a similar grayscale to the background, a pixel-based approach is introduced. local neighborhood window centered Entropy of gradient magnitude of all pixels within As a key correction feature, the gradient weighting coefficients are calculated. The relationship is as follows:

[0044] ;

[0045] In the formula, These are gradient weighting coefficients; These are preset base weights, for example. ; It is a regulatory factor, for example. ; It is the absolute value symbol; It is a pixel. In foam images The normalized grayscale value in the image; 0.5 is an example value and can be adjusted according to actual needs; when When the value approaches 0.5, indicating a blurry area that is difficult to distinguish using grayscale, Gradient weighting coefficients approaching 0 Increasing this significantly enhances the decision weight of the local gradient entropy feature; when When the grayscale feature is close to 1 or close to 0, it already possesses strong discriminative power, and the gradient weighting coefficient... Values ​​revert to preset base weights .

[0046] It should be noted that a weighted fusion model is constructed to address the characteristics of foam areas being white with high grayscale values ​​and waste liquid areas being dark with low grayscale values, as well as the gradual variation characteristics of the grayscale values ​​of foam and waste liquid areas being relatively close but with different entropy values ​​of gradient magnitude.

[0047] Furthermore, the pixel points are calculated. The gradient significance of the region belonging to the bubble region is shown in the following formula:

[0048] ;

[0049] In the formula, It is a pixel. The gradient significance of the region belonging to the bubble region, with a value range of [value range missing]. The closer the value is to 1, the higher the probability that the pixel belongs to the foam area; the closer the value is to 0, the higher the probability that it belongs to the waste liquid background. They are pixels In foam images The normalized grayscale value and normalized gradient magnitude in the data; It is the gray-scale weighting coefficient; These are gradient weighting coefficients; It is a natural exponential function; when the pixel... In foam images When both the normalized gray value and the normalized gradient magnitude are larger, the pixel... The greater the gradient significance of a region belonging to a bubble region, the greater the significance of the gradient, and vice versa.

[0050] Specifically, traversing the bubble image For each pixel at a given location, obtain the gradient salient features of each pixel belonging to the bubble region.

[0051] The gradient salient feature map can be obtained by following the steps above. Please refer to [link to relevant documentation]. Figure 3 As shown, Figure 3 This is a gradient saliency feature comparison image of a machine vision-based method for monitoring foam layers in waste liquid neutralization tanks according to the present invention. In the gradient saliency feature image, the brighter the hue, the higher the probability that the pixel belongs to the foam region. Dense foam in the original image appears as bright yellow in the gradient saliency feature image, with a value close to 1, while sparse foam appears as a brighter hue, with a value exceeding 0.5. The dark waste liquid background appears as a dark hue, with a value close to 0, and the two are clearly distinguishable. This feature system that integrates grayscale and gradient entropy not only preserves the grayscale difference between foam and background, but also enhances the identification of sparse foam, effectively solving the problem of missed detection of sparse foam by the traditional grayscale threshold method.

[0052] S3. Based on the foam coverage of the binary foam image in the foam image, the equivalent circle diameter of each foam sub-region, and the instantaneous foam velocity, obtain the morphological features of each foam sub-region.

[0053] It should be noted that the core innovation of this step lies in establishing a spatiotemporal evolution model of foam. By integrating the geometric features of foam, such as foam coverage, equivalent circle diameter, and instantaneous foam velocity, a morphological salient feature that can reflect the dynamic behavior of foam is constructed. At the same time, foam exhibits complex dynamic behavior on the surface of waste liquid: not only are there volume changes, such as expansion, contraction, and merging, and morphological changes, such as near-circular and irregular deformation, but also processes such as generation, migration, and collapse. Traditional static image analysis cannot distinguish regions with similar textures but different dynamic characteristics. This method significantly improves the robustness and accuracy of foam region detection by quantifying the spatiotemporal evolution characteristics of foam.

[0054] Specifically, based on the gradient saliency features of each pixel belonging to the bubble region, the mean and standard deviation of the gradient saliency features of each pixel are calculated, and denoted as follows: Set the segmentation threshold ,in, For example, a preset adjustment coefficient is used. ; Assign a value of 1 to the pixels corresponding to the gradient salient features that are greater than the segmentation threshold, and assign a value of 0 to the pixels corresponding to the gradient salient features that are less than or equal to the segmentation threshold, to obtain a binary bubble image.

[0055] Furthermore, the ratio of the total number of pixels in the binary bubble image to the total number of pixels in the fused bubble image is calculated as the bubble coverage rate, denoted as . Morphological operations are performed on the binary bubble image to separate adjacent bubbles. Then, the watershed algorithm is applied to segment the interconnected bubble regions, obtaining several bubble sub-regions. The index of the bubble sub-regions is set as... ; with the first Taking the foam sub-region as an example, we calculate its equivalent circle diameter using the following formula:

[0056] ;

[0057] In the formula, It is the first The equivalent circle diameter of the foam sub-region; It is the index of the foam sub-region; It is the first The total number of pixels in the foam sub-region is used to reflect the number of pixels in the first sub-region. The area of ​​the foam sub-region; when the first The larger the total number of pixels in the foam sub-region, the better. The larger the equivalent circle diameter of a foam sub-region, the smaller the equivalent circle diameter; traverse all foam sub-regions to obtain the equivalent circle diameter of each foam sub-region.

[0058] Specifically, a feature point matching method is used to track foam movement. This method can effectively utilize the surface texture features of foam and has low computational complexity. Based on at least three consecutive binary foam images, the feature point matching method tracks foam movement. Taking a foam sub-region as an example, calculate its instantaneous foam velocity. For instance, take the first... Second, the Second and the Taking a binary bubble image of a given second as an example for analysis: the Harris corner detection algorithm is used to calculate the response value of each pixel in the binary bubble image; and the maximum value of all response values ​​is denoted as... Set the response threshold to The pixel with a response value greater than or equal to the response threshold is used as a feature point to obtain several feature points; 0.6 is an example value and can be set according to actual needs; the Harris corner detection algorithm is existing technology and will not be described in detail here. Feature point matching methods include, but are not limited to, the Harris corner detection algorithm.

[0059] Furthermore, texture feature description is performed on each feature point to generate a unique feature descriptor. The specific process is as follows: First, a square neighborhood of a fixed size is taken centered on each feature point, for example, 31 pixels × 31 pixels. Within the neighborhood, 256 pairs of pixels are selected according to a preset random pattern. The gray values ​​of each pair of pixels are compared, and a 1 or 0 is marked on the corresponding binary bit according to the gray value relationship, generating a 256-bit binary string as the initial descriptor. The gradient direction of the pixels in the neighborhood of the feature point is calculated and the principal direction is statistically determined. The coordinates of the random point pairs are rotated around the feature point to be aligned with the principal direction, and then the descriptors are re-compared to generate descriptors, so that the descriptors have rotation invariance and adapt to the rotational movement of foam on the liquid surface. At the same time, the gray mean and standard deviation of the pixel points in their local areas are calculated, and the gray value comparison sensitivity is dynamically adjusted to enhance the descriptor's ability to distinguish low-contrast foam textures.

[0060] Specifically, after descripting all feature points in two images, a bidirectional nearest neighbor matching strategy is used to complete feature point matching, with Hamming distance as the descriptor similarity metric. The matching steps are as follows: During forward matching, for each feature point in the previous image, the feature point with the smallest Hamming distance in the current image is searched as a candidate matching point; during reverse matching, for each feature point in the current image, the feature point with the smallest Hamming distance in the previous image is searched as a candidate matching point; cross-validation is performed, and the feature point pair is confirmed as a valid matching pair only when the forward matching and reverse matching results are consistent; to further eliminate false matches, the ratio of the best matching distance to the second-best matching distance for each feature point is calculated. If the ratio exceeds a preset threshold (example value is 0.8), the match is determined to be non-unique and is discarded; Hamming distance is existing technology and will not be elaborated here. Feature point matching methods include, but are not limited to, Hamming distance matching.

[0061] Furthermore, based on the above effective feature point matching results, the dynamic stable features of each pixel are calculated. The specific operation is as follows: Let the first pixel be... The foam sub-region in the first The set of valid feature points for a second is: Then the first The foam sub-region in the first The centroid coordinates of the second are Similarly, the calculation yields the first... The foam sub-region in the first Centroid coordinates of seconds ,in This represents the number of valid feature points in the foam sub-region. The preset total time interval, If the time interval between two consecutive seconds is denoted as , then the is calculated. The instantaneous foam velocity in the foam sub-region is expressed by the following formula:

[0062] ;

[0063] In the formula, It is the first Instantaneous foam velocity in the foam sub-region; They are the first The foam sub-region in the first Second, the The x-coordinate of the centroid of the second; They are the first The foam sub-region in the first Second, the The ordinate of the centroid coordinate of the second; The preset total time interval, The time interval between two consecutive data collections; when the first... The foam sub-region in the first Second, the The greater the difference in the x-coordinate of the centroid coordinates at each second, the more significant the difference in the x-coordinates. The foam sub-region in the first Second, the The greater the difference in the ordinate of the centroid coordinates at each second, the smaller the total preset time interval, and the smaller the time interval between two adjacent acquisition seconds. The greater the instantaneous foam velocity in the foam sub-region, the lower the instantaneous foam velocity, and vice versa.

[0064] Specifically, refer to the equivalent circle diameter This is the average diameter of the equivalent circle of the effective foam sub-region under the same working conditions, with reference to the instantaneous foam velocity. The mean instantaneous flow velocity of the effective foam sub-region under the same working conditions is used. The effective foam sub-region refers to the real foam region confirmed by manual annotation. Specifically, the mean value of the feature parameters of the effective foam samples is selected as the benchmark value to normalize feature parameters of different magnitudes, eliminating the interference of external factors such as the resolution of the detection equipment and the difference in waste liquid composition on the feature calculation results; based on the foam coverage of the binary foam image in the foam image. The equivalent circle diameter and instantaneous foam velocity of each foam sub-region are used to obtain the morphological characteristics of each foam sub-region, with the first... Taking the foam sub-region as an example for analysis, the first... The morphological characteristics of the foam subregion are shown in the following formula:

[0065] ;

[0066] In the formula, It is the first The morphological features of the foam sub-region; It represents the bubble coverage of the binary bubble image in the bubble image; It is the diameter of the reference equivalent circle; It is a reference instantaneous foam flow rate; It is the first The equivalent circle diameter of the foam sub-region; It is the first Instantaneous foam velocity in the foam sub-region; 0.5 is an example weight; when the... The larger the ratio of the equivalent circle diameter of the foam sub-region to the reference equivalent circle diameter, the more significant the change in the number of circles. The larger the ratio of the instantaneous foam velocity in the foam sub-region to the reference instantaneous foam velocity, and the larger the foam coverage of the binary foam image in the foam image, the better the... The greater the morphological significance of the foam region, the more pronounced its features, and vice versa; The larger the morphological features of the foam sub-region, the larger its size and the more active its movement, and the greater its contribution to foam overflow.

[0067] It should be noted that foam coverage, as a global scenario indicator, reflects the overall distribution density of foam on the waste liquid surface. Using it as a product factor reflects the dependence of foam significance on the overall environment: when foam coverage is low, even if individual foams are large or move quickly, their overall impact on the process is limited, so significance should be suppressed; conversely, when foam coverage is high, any abnormal changes in the foam layer may have a greater impact, so the significance weight of individual foams needs to be enhanced. This design avoids oversensitivity to individual foams in sparse foam scenarios and improves the model's adaptability under different operating conditions.

[0068] Furthermore, by traversing all foam sub-regions, the morphological salient features of each foam sub-region are obtained.

[0069] S4. Based on the gradient saliency features of each pixel belonging to the foam region and the morphological saliency features of each foam sub-region, calculate the probability that each pixel belongs to the foam region in the waste liquid neutralization tank; based on this probability, obtain the degree of foam overflow in the waste liquid neutralization tank and perform graded early warning.

[0070] It should be noted that the overall logic of this step is to integrate gradient saliency features and morphological saliency features to construct a foam attribution probability calculation model, quantify the confidence of each pixel belonging to the foam region, and evaluate the degree of foam overflow in the waste liquid neutralization tank based on the probability distribution and area ratio of the foam region, formulate a graded early warning strategy, and solve the technical problem that traditional detection relies on only a single feature, resulting in insufficient early warning accuracy and inability to adapt to process control requirements.

[0071] Specifically, each pixel in the fused foam image is traversed to determine the foam sub-region to which each pixel belongs. The gradient salient features of each pixel are then weighted and fused with the morphological salient features of the corresponding foam sub-region to calculate the probability that each pixel belongs to the foam region in the waste liquid neutralization pool. Taking a pixel as an example, this pixel belongs to the first... The relationship between the probability of bubble affiliation in a bubble sub-region is as follows:

[0072] ;

[0073] In the formula, It is located in The probability that a pixel belongs to a bubble region, with a value ranging from 0 to 1. The closer the value is to 1, the higher the confidence that the pixel belongs to a bubble region. It is located in The gradient salient features of the pixels; It is the first The morphological features of the foam sub-region; This is the feature fusion coefficient, used to balance the contribution weights of gradient saliency features and morphological saliency features. An example value of 1.2 is used, which can be dynamically adjusted according to actual detection accuracy requirements. The core logic of this fusion method is that the gradient saliency features of a pixel reflect whether it possesses the texture attributes of a bubble, while the morphological saliency features of the bubble sub-region reflect the overall geometric and dynamic characteristics of that region. The fusion of these two features enables two-layer feature verification from pixel to sub-region, significantly reducing the probability of misjudgment based on a single feature.

[0074] Furthermore, a threshold for the probability of foam attribution is set. For example, a value of 0.7 is used, indicating a probability value greater than or equal to... Pixels identified as foam pixels are counted, and the total area of ​​all foam pixels is calculated. The ratio of this area to the total surface area of ​​the waste liquid neutralization tank is recorded as the foam area percentage. Based on the proportion of foam area Classify the degree of bubble overflow and implement graded early warning. An example of a specific graded standard setting is as follows: When... A concentration less than 10% is considered a mild overflow warning, indicating that a small amount of foam is generated in the waste liquid neutralization tank, which is within the process controllable range; when A concentration greater than or equal to 10% but less than 30% is considered a moderate overflow warning, indicating an accelerated foam formation rate. Attention should be paid to changes in process parameters such as the dosage of neutralizing agents and the stirring rate. A level of 30% or higher is considered a severe overflow warning, indicating that a large amount of foam has accumulated and there is a risk of overflowing into the neutralization tank. It is necessary to immediately start the defoaming device or take emergency measures such as shutdown for inspection. The above-mentioned graded warning standards can be adjusted according to the safety control requirements of different waste liquid treatment processes to ensure that the warning strategy is adapted to the actual production conditions.

[0075] Specifically, the final foam monitoring results can be obtained by following the steps described above. Please refer to [link / reference]. Figure 4 As shown, Figure 4 This is a foam monitoring result diagram of a waste liquid neutralization tank foam layer monitoring method based on machine vision in this invention. As can be seen from the diagram, the white area in the foam monitoring result diagram is the detected foam layer. At this time, it is under severe overflow warning, indicating that a large amount of foam has accumulated and there is a risk of overflowing into the neutralization tank. It is necessary to immediately start the defoaming device or take emergency measures such as stopping the machine for inspection.

[0076] Furthermore, a comparison chart of the monitoring effects of this method and existing technologies can be obtained by following the steps of this method. Please refer to [link / reference]. Figure 5 As shown, Figure 5 This is a comparison image of foam monitoring using a machine vision-based foam layer monitoring method for waste liquid neutralization tanks, as described in this invention. The image shows significant differences in the actual foam percentage across different methods: this method achieves 65.0% actual foam percentage, while the simple threshold segmentation method in the prior art results in 25.0%, the Canny edge detection method in 14.9%, and the color threshold segmentation method in only 4.0%. Clearly, this method significantly outperforms other existing technologies in foam monitoring, enabling more accurate capture of the foam region on the surface of the waste liquid neutralization tank. This also verifies the improved monitoring accuracy achieved by this method through the fusion of multi-view images, gradient saliency features, and a spatiotemporal evolution model.

[0077] This invention also discloses a machine vision-based foam layer monitoring system for waste liquid neutralization tanks, including a processor and a memory. The memory stores computer program instructions, which, when executed by the processor, implement a machine vision-based foam layer monitoring method for waste liquid neutralization tanks according to the present invention.

[0078] The system also includes other components well known to those skilled in the art, such as communication buses and communication interfaces, the settings and functions of which are known in the art and will not be described in detail here.

Claims

1. A method for monitoring the foam layer in a waste liquid neutralization tank based on machine vision, characterized in that, include: Foam images were acquired and a rectangular coordinate system was constructed. The foam images corresponding to each pitch angle were fused using a weighted average method to obtain a fused foam image. Based on the fused foam image, the gradient magnitude of each pixel and the entropy of the gradient magnitude in the local neighborhood were calculated. By combining the normalized gray value and the gradient weighting coefficient, the gradient saliency features of each pixel belonging to the foam region were obtained. Based on the gradient saliency features, the mean and standard deviation are calculated to determine the segmentation threshold. A binary foam image is obtained through threshold segmentation. The ratio of the total number of pixels in the binary foam image to the total number of pixels in the fused foam image is calculated to obtain the foam coverage. Morphological operations and watershed algorithm are performed on the binary foam image to segment it into several foam sub-regions. The equivalent circle diameter of each foam sub-region is calculated. The movement of each foam sub-region in the continuous binary foam image is tracked by the feature point matching method. The instantaneous foam velocity of each foam sub-region is calculated. After normalization, the foam coverage, equivalent circle diameter and instantaneous foam velocity are fused to obtain the morphological saliency features of each foam sub-region. The gradient salient features of each pixel are weighted and fused with the morphological salient features of the corresponding foam sub-region. The probability of each pixel belonging to the foam region is calculated. A probability threshold is set to filter foam pixels. The degree of foam overflow is divided according to the area ratio to achieve graded early warning.

2. The method for monitoring the foam layer in a waste liquid neutralization tank based on machine vision according to claim 1, characterized in that, The process of fusing the foam images corresponding to each pitch angle using a weighted average method to obtain the fused foam image includes: ; In the formula, It is the merged bubble image; It is the index of the pitch angle; It is the pitch angle. The corresponding angle; It is the pitch angle. The corresponding bubble image.

3. The method for monitoring the foam layer in a waste liquid neutralization tank based on machine vision according to claim 1, characterized in that, The method for obtaining the gradient weighting coefficients includes: ; In the formula, These are gradient weighting coefficients; It is a preset base weight; It is a regulatory factor; It is the absolute value symbol; It is a pixel. In foam images The normalized grayscale value in the image.

4. The method for monitoring the foam layer in a waste liquid neutralization tank based on machine vision according to claim 1, characterized in that, The process of obtaining the gradient saliency features of each pixel belonging to the bubble region includes: ; In the formula, It is a pixel. The gradient significance of the region belonging to the bubble region, with a value range of [value range missing]. ; They are pixels In foam images The normalized grayscale value and normalized gradient magnitude in the data; It is the gray-scale weighting coefficient; These are gradient weighting coefficients; It is a natural exponential function.

5. The method for monitoring the foam layer in a waste liquid neutralization tank based on machine vision according to claim 1, characterized in that, The step of calculating the mean and standard deviation based on the gradient saliency features to determine the segmentation threshold includes: Based on the gradient saliency features of each pixel belonging to the bubble region, the mean and standard deviation of the gradient saliency features of each pixel are calculated and denoted as follows: Set the segmentation threshold ,in, The preset adjustment coefficient is used; pixels corresponding to gradient salient features greater than the segmentation threshold are assigned a value of 1, and pixels corresponding to gradient salient features less than or equal to the segmentation threshold are assigned a value of 0, thus obtaining a binary bubble image.

6. The method for monitoring the foam layer in a waste liquid neutralization tank based on machine vision according to claim 1, characterized in that, The calculation of the equivalent circle diameter for each foam sub-region includes: ; In the formula, It is the first The equivalent circle diameter of the foam sub-region; It is the index of the foam sub-region; It is the first The total number of pixels in the foam sub-region.

7. The method for monitoring the foam layer in a waste liquid neutralization tank based on machine vision according to claim 1, characterized in that, The calculation of the instantaneous foam velocity in each foam sub-region includes: ; In the formula, It is the first Instantaneous foam velocity in the foam sub-region; They are the first The foam sub-region in the first Second, the The x-coordinate of the centroid of a second; They are the first The foam sub-region in the first Second, the The ordinate of the centroid coordinate of the second; The preset total time interval, The time interval between two consecutive data collections is 2 seconds.

8. The method for monitoring the foam layer in a waste liquid neutralization tank based on machine vision according to claim 1, characterized in that, The method of obtaining the morphological features of each foam sub-region includes: ; In the formula, It is the first The morphological features of the foam sub-region; It represents the bubble coverage of the binary bubble image in the bubble image; It is the diameter of the reference equivalent circle; It is a reference instantaneous foam flow rate; It is the first The equivalent circle diameter of the foam sub-region; It is the first Instantaneous foam velocity in the foam sub-region.

9. The method for monitoring the foam layer in a waste liquid neutralization tank based on machine vision according to claim 1, characterized in that, The calculation of the probability of each pixel belonging to the foam region includes: ; In the formula, It is located in The probability that a pixel belongs to a bubble region, with a value ranging from 0 to 1; It is located in The gradient salient features of the pixels; It is the first The morphological features of the foam sub-region; It is the feature fusion coefficient.

10. A machine vision-based foam layer monitoring system for waste liquid neutralization tanks, characterized in that, include: A processor and a memory, the memory storing computer program instructions that, when executed by the processor, implement a machine vision-based method for monitoring the foam layer in a waste liquid neutralization tank according to any one of claims 1-9.

Citation Information

Patent Citations

  • Processing method for foam adhesion image region segmentation

    CN111524143A

  • Ore pulp liquid level prediction method and system based on flotation froth dynamic characteristics and storage medium

    CN119863630A