Vision-based surfactant foam amount prediction method and system
By combining visual image processing and machine learning methods with guided filtering, adaptive thresholding, binarization, Euclidean distance transformation and watershed algorithm, a foam volume prediction model is constructed, which solves the problem of foam volume prediction accuracy in high-density small foam scenarios and achieves high-precision foam volume prediction in complex foam environments.
Patent Information
- Application Number
- CN202511310777.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-15
- Publication Date
- 2025-12-12
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing technologies struggle to accurately segment small bubbles and extract effective features in high-density small foam scenarios, resulting in low accuracy in foam volume prediction. This is especially true when foam region boundaries are blurred and small bubbles are severely adhered together. Existing methods cannot meet the requirements for accurate bubble diameter and foam volume prediction in complex foam environments.
A vision-based method for predicting surfactant foam volume is adopted. Image data is acquired by an industrial camera with a fixed top-down view. Image enhancement and segmentation are performed by combining guided filtering, adaptive threshold binarization, morphological processing, Euclidean distance transformation and watershed algorithm. A foam volume prediction model based on convolutional neural network and support vector regression is constructed, and the feature vector of small bubble structure is extracted to predict foam volume.
It achieves accurate segmentation of dense foam regions, improves the accuracy and robustness of foam volume prediction, and is applicable to foam scenarios with complex backgrounds and multiple bubble diameter distributions, significantly improving the accuracy and stability of foam volume prediction.
Smart Images

Figure CN121121407A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of image recognition and foam detection, and particularly relates to a surfactant foam amount prediction method and system based on vision. BACKGROUND
[0002] At present, the prediction of surfactant foam amount mainly relies on traditional image processing methods, such as bubble counting algorithm based on region connectivity, threshold method or traditional feature extraction technology. However, these methods have certain deficiencies when processing high-density small-bubble region foam images. For example, when surfactant foam forms a dense bubble group under high concentration, the traditional method is prone to bubble adhesion and misrecognition, resulting in large bubble diameter calculation error and low foam amount prediction accuracy. The existing technology cannot fully meet the demand for accurate prediction of bubble diameter and foam amount in complex foam environment. Therefore, there is an urgent need for a prediction method that can accurately segment small bubbles and extract effective features even in the case of dense bubbles and fuzzy boundaries, in order to improve the accuracy and stability of foam amount prediction, especially in industrial applications and laboratory research, to improve the adaptability and generalization ability of the prediction model. SUMMARY
[0003] In view of the above technical deficiencies, the purpose of the present application is to provide a surfactant foam amount prediction method based on vision, which aims to solve the technical problem that the methods based on area statistics or connected component recognition in the prior art have low recognition accuracy in high-density small-bubble scenarios, especially in the case of fuzzy foam region boundaries and serious small bubble adhesion, which makes it difficult to achieve accurate bubble diameter extraction.
[0004] To solve the above technical problems, the present application adopts the following technical scheme: the present application provides a surfactant foam amount prediction method based on vision, The surfactant foam amount prediction method based on vision comprises: Step S10: acquiring process image data of surfactant foam generation by a fixed overhead industrial camera to obtain first image data; and performing standardization processing on the first image data to obtain second image data; Step S20: obtaining a preliminary binary foam region graph by using a guided filter method combined with adaptive threshold binarization processing based on the second image data; and performing morphological filling processing and edge closing processing on the preliminary binary foam region graph to obtain an optimized binary foam region graph; Step S30: performing Euclidean distance transformation according to the optimized binary foam region graph to obtain a binary foam distance graph; and obtaining local maximum points from the binary foam distance graph as a seed point set S of a watershed algorithm, and performing propagation with the seed point set S as a starting marker to obtain a connected bubble region graph; Step S40: Based on the segmentation of the bubble region map, effective small bubbles are obtained. Bubble diameter statistics and region density modeling are used to extract the feature information of effective small bubbles and construct the bubble structure feature vector. Step S50: Construct a foam volume prediction model based on convolutional neural network and support vector regression. Input the small bubble structure feature vector into the pre-trained foam volume prediction model to obtain the output of the foam volume prediction result.
[0005] Preferably, in step S20, the preliminary binary bubble region map is obtained by using guided filtering combined with adaptive threshold binarization based on the second image data; the optimized binary bubble region map is obtained by performing morphological filling and edge closure processing on the preliminary binary bubble region map, specifically including: Step S201: Perform guided filtering on the second image data obtained in step S10. Use a linear guided filter with a window size of 7 to retain the bubble edges while removing the background and inter-bubble interference textures to obtain an intermediate filtered image. Step S202: For the intermediate filtered image, based on a 9×9 local window, calculate the mean local brightness, standard deviation of local brightness, and standard deviation of local gradient response of the 9×9 local window, and calculate the dynamic threshold function based on the mean local brightness, standard deviation of local brightness, and standard deviation of local gradient response. Step S203: Perform binarization based on the dynamic threshold function and the intermediate filtered image to obtain a preliminary binary bubble region map; Step S204: Detect the broken edges and void areas of the preliminary binary foam region map, perform a closing operation on the preliminary binary foam region map to connect the broken edges, and perform small hole filling processing on the void areas to obtain the intermediate binary foam region map; Step S205: Set the area threshold function and shape filtering conditions, and exclude the non-bubble areas in the intermediate binary bubble region map according to the area threshold function and shape filtering conditions to obtain the optimized binary bubble region map.
[0006] Preferably, in step S30, the step of performing Euclidean distance transformation on the optimized binary bubble region map to obtain a binary bubble distance map; introducing the watershed algorithm, obtaining local maxima points from the binary bubble distance map as the seed point set S of the watershed algorithm, and using the seed point set S as the starting marker for propagation to obtain the cohesive bubble region map, specifically includes: Step S301: Using the optimized binary bubble region map obtained in step S20 as input, perform Euclidean distance transformation on the bubble regions to obtain a binary bubble distance map; Step S302: Perform local extremum detection on the binary bubble distance map, extract the peak value of the bubble core region, and set a safety constraint condition for the distance threshold between the peak values in the bubble core region. Construct a seed set for the watershed algorithm based on the safety constraint condition and the peak value of the bubble core region. Step S303: Negate the binary bubble distance map to obtain the inverse binary bubble distance map, and use the inverse binary bubble distance map as the topographic map input for the watershed algorithm; Step S304: Based on the seed set of the watershed algorithm and the topographic map input of the watershed algorithm, execute the propagation action of the watershed algorithm to generate a map of the clumped bubble region.
[0007] Preferably, step S40, which involves segmenting effective bubbles based on the bubble region map, extracting feature information of effective bubbles using bubble diameter statistics and region density modeling, and constructing bubble structure feature vectors, specifically includes: Step S401: Based on the bubble region map obtained in step S30, traverse each bubble region to filter out effective small bubbles that meet the preset bubble constraint conditions. Step S402: Calculate the feature information of effective bubbles based on the effective bubbles; Step S403: Calculate the spatial distribution density and regional coverage of effective bubbles based on the effective bubbles; Step S404: Construct bubble structure feature vectors based on the feature information, spatial distribution density, and regional coverage of effective bubbles.
[0008] Preferably, in step S40, the formula for calculating the spatial distribution density is: ,in, Where N is the spatial distribution density, and N is the area of a single continuous foam region. The total area of the foam zone; the formula for calculating the area coverage rate is: ,in, For regional coverage, This represents the area of the region where air bubbles adhere.
[0009] Preferably, step S50, which involves constructing a foam volume prediction model based on a convolutional neural network and support vector regression, and inputting the small bubble structure feature vectors into the pre-trained foam volume prediction model to obtain the output of the foam volume prediction result, specifically includes: Step S501: Based on the second image data as input, a first image prediction sub-model is constructed using a convolutional neural network structure; wherein, the first image prediction sub-model is used to automatically extract texture distribution, brightness unevenness and edge density feature information from the image; Step S502: Based on the bubble structure feature vector constructed in step S40 as input, a second image prediction sub-model is constructed using support vector regression; wherein, the second image prediction sub-model is used to establish the mapping relationship between structural features and the total volume of the bubble; Step S503: Weighted fusion of the first image prediction sub-model and the second image prediction sub-model to obtain the foam quantity prediction model; Step S504: Obtain historical labeled data, pre-train the first image prediction sub-model and the second image prediction sub-model in the foam volume prediction model based on the historical labeled data, and determine the weighting coefficients of each sub-model based on the minimum mean square error principle to obtain the pre-trained foam volume prediction model. Step S505: Input the bubble structure feature vector into the pre-trained foam volume prediction model to obtain the output of the foam volume prediction result.
[0010] Preferably, in step S40, the characteristic information of the effective bubbles includes the average bubble diameter, the standard deviation of the bubble diameter, the foam coverage area, the bubble density, and the coefficient of variation of the bubble diameter, wherein, .
[0011] The present invention also provides a vision-based surfactant foam quantity prediction system comprising: The image acquisition and preprocessing module is used to acquire process image data of surfactant foam generation using an industrial camera with a fixed top-down view, to obtain first image data; and to obtain second image data by standardizing the first image data. The foam region extraction module is used to obtain a preliminary binary foam region map based on the second image data by using guided filtering combined with adaptive threshold binarization; the preliminary binary foam region map is then subjected to morphological filling and edge closure processing to obtain an optimized binary foam region map. The bubble segmentation module is used to perform Euclidean distance transformation on the optimized binary bubble region map to obtain a binary bubble distance map. The watershed algorithm is introduced to obtain local maxima points from the binary bubble distance map as the seed point set S of the watershed algorithm. The algorithm is propagated with the seed point set S as the starting mark to obtain the cohesive bubble region map. The feature extraction module is used to segment effective small bubbles based on the region map of the adhered bubbles, extract feature information of effective small bubbles by bubble diameter statistics and region density modeling, and construct bubble structure feature vectors. The foam volume prediction module is used to construct a foam volume prediction model based on convolutional neural networks and support vector regression. The feature vectors of small bubble structures are input into the pre-trained foam volume prediction model to obtain the foam volume prediction results.
[0012] The present invention also provides a computer program product, including a vision-based surfactant foam quantity prediction program, which, when executed by a processor, implements the vision-based surfactant foam quantity prediction method.
[0013] The beneficial effects of this invention are as follows: This invention utilizes guided filtering and adaptive thresholding algorithms in computer vision to enhance and binarize foam images. Combined with Euclidean distance transform and watershed algorithm, it effectively solves the problem of difficulty in identifying bubble diameter caused by small bubble adhesion, achieves accurate segmentation of dense foam areas, and improves the accuracy of structural feature extraction.
[0014] This invention extracts multidimensional feature information from images and structures based on computer vision, and constructs a foam volume prediction model that integrates convolutional neural networks and support vector regression. This significantly improves the accuracy and robustness of foam volume prediction and is applicable to foam scenarios with complex backgrounds and multiple bubble diameter distributions. Attached Figure Description
[0015] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0016] Figure 1 This is a schematic flowchart of the first embodiment of a vision-based surfactant foam quantity prediction method of the present invention.
[0017] Figure 2 This is a schematic diagram of an apparatus for predicting surfactant foam volume based on vision, according to the present invention. Detailed Implementation
[0018] 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 embodiments of the present invention, and not all embodiments. 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.
[0019] Example 1: As Figure 1 The diagram shown is a flowchart of the first embodiment of the vision-based surfactant foam quantity prediction method of the present invention, which presents the first embodiment of the vision-based surfactant foam quantity prediction method of the present invention.
[0020] In the first embodiment, the vision-based surfactant foam quantity prediction method includes: Step S10: Acquire process image data of surfactant foam generation using an industrial camera with a fixed top-down view to obtain first image data; standardize the first image data to obtain second image data; It should be noted that the industrial camera is positioned perpendicular to the upper surface of the foam generation container to avoid bubble contour distortion caused by parallax; the image acquisition frame rate is 10fps, and the resolution is no less than 1280×720 pixels to ensure that key image details are preserved during the foam generation process.
[0021] It is understandable that standardization processing refers to normalizing the grayscale values of the original image by making them the maximum and minimum values, so that the pixel values are uniformly mapped to the [0,1] range, eliminating the overall brightness fluctuation caused by differences in the lighting conditions of the shooting environment, which helps to improve the robustness of subsequent adaptive thresholding processing.
[0022] It should be understood that, compared to traditional fixed threshold or contrast stretching methods, this embodiment uses maximum and minimum value normalization.
[0023] Step S20: Based on the second image data, a preliminary binary bubble region map is obtained by using guided filtering combined with adaptive threshold binarization; the preliminary binary bubble region map is then subjected to morphological filling and edge closure processing to obtain an optimized binary bubble region map. It should be noted that in step S20, the preliminary binary bubble region map is obtained by using guided filtering combined with adaptive threshold binarization based on the second image data; the optimized binary bubble region map is obtained by performing morphological filling and edge closure processing on the preliminary binary bubble region map, specifically including: Step S201: Perform guided filtering on the second image data obtained in step S10. Use a linear guided filter with a window size of 7 to retain the bubble edges while removing the background and inter-bubble interference textures to obtain an intermediate filtered image. Step S202: For the intermediate filtered image, based on a 9×9 local window, calculate the mean local brightness, standard deviation of local brightness, and standard deviation of local gradient response of the 9×9 local window, and calculate the dynamic threshold function based on the mean local brightness, standard deviation of local brightness, and standard deviation of local gradient response. Step S203: Perform binarization based on the dynamic threshold function and the intermediate filtered image to obtain a preliminary binary bubble region map; Step S204: Detect the broken edges and void areas of the preliminary binary foam region map, perform a closing operation on the preliminary binary foam region map to connect the broken edges, and perform small hole filling processing on the void areas to obtain the intermediate binary foam region map; Step S205: Set the area threshold function and shape filtering conditions, and exclude the non-bubble areas in the intermediate binary bubble region map according to the area threshold function and shape filtering conditions to obtain the optimized binary bubble region map.
[0024] Understandably, this step addresses the issues of uneven brightness and low inter-bubble contrast in bubble images through a combined design of guided filtering and dynamic thresholding. Compared to the global thresholding method, this approach can still achieve effective segmentation even when bubble boundaries are blurred or locally overexposed. Simultaneously, guided filtering removes high-frequency noise while preserving boundary structure, improving edge integrity and providing stable input for subsequent bubble segmentation.
[0025] It should be understood that traditional Otsu or fixed threshold algorithms rely on the bimodal characteristics of image grayscale, while bubble images often exhibit a non-bimodal distribution and a continuous, gradual change in grayscale, which can easily lead to missegmentation or oversegmentation of entire regions. This invention introduces the local gradient response standard deviation as a structure-sensitive factor into the threshold function, making bubble-background separation more accurate, especially showing a more significant recognition advantage in densely packed bubble regions.
[0026] For example, when 30 dense foam images were segmented using the traditional Otsu method and the method of this invention, the average bubble diameter recognition error after segmentation was compared. The average error of the Otsu method was ±3.4px, while that of this invention was only ±1.2px, a reduction of approximately 64.7%. At the same time, in the bubble adhesion area, the edge closure and pore filling mechanism of this invention improved the boundary integrity rate by approximately 22%, significantly enhancing the separability and recognizability of subsequent bubbles.
[0027] Step S30: Perform Euclidean distance transformation on the optimized binary bubble region map to obtain a binary bubble distance map; obtain local maxima points from the binary bubble distance map as the seed point set S of the watershed algorithm, and propagate with the seed point set S as the starting marker to obtain the sticky bubble region map; It should be noted that in step S30, the process of performing Euclidean distance transformation on the optimized binary bubble region map to obtain a binary bubble distance map, and then introducing the watershed algorithm to obtain local maxima points from the binary bubble distance map as the seed point set S of the watershed algorithm, and using the seed point set S as the starting marker to propagate and obtain the cohesive bubble region map, specifically includes: Step S301: Using the optimized binary bubble region map obtained in step S20 as input, perform Euclidean distance transformation on the bubble regions to obtain a binary bubble distance map; Step S302: Perform local extremum detection on the binary bubble distance map, extract the peak value of the bubble core region, and set a safety constraint condition for the distance threshold between the peak values in the bubble core region. Construct a seed set for the watershed algorithm based on the safety constraint condition and the peak value of the bubble core region. Step S303: Negate the binary bubble distance map to obtain the inverse binary bubble distance map, and use the inverse binary bubble distance map as the topographic map input for the watershed algorithm; Step S304: Based on the seed set of the watershed algorithm and the topographic map input of the watershed algorithm, execute the propagation action of the watershed algorithm to generate a map of the clumped bubble region.
[0028] Understandably, this step, by performing an Euclidean distance transformation on the optimized binary bubble region map, effectively highlights the centrality of each independent bubble region. The distance transformation assigns each foreground pixel the distance value to its nearest boundary, thus forming a distance map in the image with the bubble center as the peak. This provides a precise basis for subsequent identification of the center locations of adherent bubbles. Further performing local maximum detection on the distance map can extract potential bubble center points as seed markers.
[0029] It should be understood that traditional watershed algorithms, when using gradient maps as input, often suffer from oversegmentation or boundary drift in areas with small bubble diameters or dark bubble centers. This invention, however, constructs a "topographic map" by negating the distance map and uses only the maximum points selected through safe distance constraints as seed points. This avoids missegmentation caused by overly dense seed points or boundary interference, thus achieving more accurate generation of boundaries between small bubbles, making it particularly suitable for scenarios with densely packed, interconnected small bubbles.
[0030] For example, when testing on 10 typical dense bubble images, the traditional gradient map-based Watershed segmentation had an average misclassification rate of 18.7%, while the misclassification rate dropped to 7.4% after using the inverse distance map + maximum seed scheme constructed by the method of this invention, and the average recognition accuracy of small bubble regions was improved by about 41%. At the same time, in regions with bubble diameters less than 20px, the boundary accuracy of this method was improved by about 36% compared with the traditional method, significantly enhancing the segmentability of tiny bubbles.
[0031] Step S40: Based on the segmentation of the bubble region map, effective small bubbles are obtained. Bubble diameter statistics and region density modeling are used to extract the feature information of effective small bubbles and construct the bubble structure feature vector. It should be noted that step S40, which involves segmenting effective small bubbles based on the bubble region map, extracting feature information of effective small bubbles using bubble diameter statistics and region density modeling, and constructing bubble structure feature vectors, specifically includes: Step S401: Based on the bubble region map obtained in step S30, traverse each bubble region to filter out effective small bubbles that meet the preset bubble constraint conditions. Step S402: Calculate the feature information of effective bubbles based on the effective bubbles; Step S403: Calculate the spatial distribution density and regional coverage of effective bubbles based on the effective bubbles; Step S404: Construct bubble structure feature vectors based on the feature information, spatial distribution density, and regional coverage of effective bubbles.
[0032] Understandably, compared with the traditional method of using only the total area or number of bubbles as model input, this invention introduces bubble diameter distribution statistics and spatial density features into structural modeling. This not only enhances the diversity of prediction inputs but also significantly improves the model's ability to perceive changes in bubble structure, especially in scenarios with uneven bubble diameters or strong structural heterogeneity.
[0033] For example, in an experiment with 50 high-density foam images, under the same convolutional neural network structure, the average prediction error of the model trained using only bubble area and quantity features was ±3.2 mL, while the error of the model trained using the structural feature vector of this invention decreased to ±1.1 mL, with an accuracy improvement of more than 65%, especially in sample groups with large variations in bubble diameter.
[0034] Step S50: Construct a foam volume prediction model based on convolutional neural network and support vector regression. Input the small bubble structure feature vector into the pre-trained foam volume prediction model to obtain the output of the foam volume prediction result.
[0035] It should be noted that step S50, which involves constructing a foam volume prediction model based on a convolutional neural network and support vector regression, and inputting the small bubble structure feature vectors into the pre-trained foam volume prediction model to obtain the output of the foam volume prediction result, specifically includes: Step S501: Based on the second image data as input, a first image prediction sub-model is constructed using a convolutional neural network structure; wherein, the first image prediction sub-model is used to automatically extract texture distribution, brightness unevenness and edge density feature information from the image; Step S502: Based on the bubble structure feature vector constructed in step S40 as input, a second image prediction sub-model is constructed using support vector regression; wherein, the second image prediction sub-model is used to establish the mapping relationship between structural features and the total volume of the bubble; Step S503: Weighted fusion of the first image prediction sub-model and the second image prediction sub-model to obtain the foam quantity prediction model; Step S504: Obtain historical labeled data, pre-train the first image prediction sub-model and the second image prediction sub-model in the foam volume prediction model based on the historical labeled data, and determine the weighting coefficients of each sub-model based on the minimum mean square error principle to obtain the pre-trained foam volume prediction model. Step S505: Input the bubble structure feature vector into the pre-trained foam volume prediction model to obtain the output of the foam volume prediction result.
[0036] Understandably, step S50 aims to fuse image semantic features and structural features to achieve more accurate foam volume prediction. By constructing a dual-channel prediction model based on convolutional neural networks and support vector regression, and jointly training it with historical experimental data, a better modeling and estimation capability for complex foam structures is achieved.
[0037] It should be understood that traditional foam volume estimation methods usually rely only on image area or number of bubbles, and cannot effectively model the structural differences caused by bubble diameter variability and distribution density; while the prediction model of this invention considers both image and structure dimensions, which can capture potential visual patterns and reflect physical structural features, thus improving the perception accuracy of complex foam environments.
[0038] For example, the prediction model was trained and tested based on 120 sets of nonionic surfactant foam images collected in the laboratory. The results showed that the mean square error of foam volume prediction by the method of the present invention was ±0.94 mL, which is 49.7% and 37.7% higher than that of ±1.87 mL using only the CNN method and ±1.51 mL using only the SVR method, respectively. At the same time, the improvement in prediction stability was particularly significant in image samples with a bubble density of more than 70%.
[0039] Example 2: Furthermore, the present invention provides a vision-based surfactant foam quantity prediction system, employing a vision-based surfactant foam quantity prediction method from the above embodiments, which can solve the technical problem of vision-based surfactant foam quantity prediction. Compared with the prior art, the beneficial effects of the vision-based surfactant foam quantity prediction system provided by the present invention are the same as those of the vision-based surfactant foam quantity prediction method provided in the above embodiments, and other technical features of the vision-based surfactant foam quantity prediction system are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.
[0040] Example 3: This invention provides a vision-based surfactant foam quantity prediction device. Please refer to... Figure 2A vision-based surfactant foam quantity prediction device includes: 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, which, when executed by the at least one processor, enable the at least one processor to perform the vision-based surfactant foam quantity prediction method described in Embodiment 1 above. The vision-based surfactant foam quantity prediction device in this embodiment may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital radio receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Description), PMPs (Portable Media Players), and in-vehicle terminals (e.g., in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. This vision-based surfactant foam quantity prediction device is merely an example and should not limit the functionality or scope of the embodiments of this invention. A vision-based surfactant foam quantity prediction device may include a processing unit 1001 (e.g., a central processing unit, a graphics processor, etc.) that can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1003 into a random access memory (RAM) 1004. The RAM 1004 also stores various programs and data required for the operation of the vision-based surfactant foam quantity prediction device. The processing unit 1001, ROM 1002, and RAM 1004 are interconnected via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to I / O interface 1006: input devices 1007 including, for example, touchscreens, touchpads, keyboards, mice, image sensors, microphones, accelerometers, gyroscopes, etc.; output devices 1008 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 1003 including, for example, magnetic tapes, hard disks, etc.; and communication devices 1009. Communication device 1009 allows a vision-based surfactant foam quantity prediction device to communicate wirelessly or wiredly with other devices to exchange data. Although a vision-based surfactant foam quantity prediction device with various systems is shown in the figure, it should be understood that it is not required to implement or possess all the systems shown. More or fewer systems may be implemented alternatively.
[0041] Example 4: This invention also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the vision-based surfactant foam quantity prediction method described above. The computer program product provided by this invention can solve the technical problem of vision-based surfactant foam quantity prediction. Compared with the prior art, the beneficial effects of the computer program product provided by this invention are the same as those of the vision-based surfactant foam quantity prediction method provided in the above embodiments, and will not be repeated here.
[0042] In particular, according to the embodiments disclosed in this invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from ROM 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this invention.
[0043] It should be understood that the various parts disclosed in this invention can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.
[0044] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.
Claims
1. A vision-based method for predicting surfactant foam quantity, characterized in that, The methods include: Step S10: Acquire process image data of surfactant foam generation using an industrial camera with a fixed top-down view to obtain first image data; standardize the first image data to obtain second image data; Step S20: Based on the second image data, a preliminary binary bubble region map is obtained by using guided filtering combined with adaptive threshold binarization; the preliminary binary bubble region map is then subjected to morphological filling and edge closure processing to obtain an optimized binary bubble region map. Step S30: Perform Euclidean distance transformation on the optimized binary bubble region map to obtain a binary bubble distance map; obtain local maxima points from the binary bubble distance map as the seed point set S of the watershed algorithm, and propagate with the seed point set S as the starting marker to obtain the sticky bubble region map; Step S40: Based on the segmentation of the bubble region map, effective small bubbles are obtained. Bubble diameter statistics and region density modeling are used to extract the feature information of effective small bubbles and construct the bubble structure feature vector. Step S50: Construct a foam volume prediction model based on convolutional neural network and support vector regression. Input the small bubble structure feature vector into the pre-trained foam volume prediction model to obtain the output of the foam volume prediction result.
2. The vision-based method for predicting surfactant foam quantity as described in claim 1, characterized in that, In step S20, guided filtering combined with adaptive threshold binarization is used based on the second image data to obtain a preliminary binary bubble region map; the preliminary binary bubble region map is then subjected to morphological filling and edge closure processing to obtain an optimized binary bubble region map, specifically including: Step S201: Perform guided filtering on the second image data obtained in step S10. Use a linear guided filter with a window size of 7 to retain the bubble edges while removing the background and inter-bubble interference textures to obtain an intermediate filtered image. Step S202: For the intermediate filtered image, based on a 9×9 local window, calculate the mean local brightness, standard deviation of local brightness, and standard deviation of local gradient response of the 9×9 local window, and calculate the dynamic threshold function based on the mean local brightness, standard deviation of local brightness, and standard deviation of local gradient response. Step S203: Perform binarization based on the dynamic threshold function and the intermediate filtered image to obtain a preliminary binary bubble region map; Step S204: Detect the broken edges and void areas of the preliminary binary foam region map, perform a closing operation on the preliminary binary foam region map to connect the broken edges, and perform small hole filling processing on the void areas to obtain the intermediate binary foam region map; Step S205: Set the area threshold function and shape filtering conditions, and exclude the non-bubble areas in the intermediate binary bubble region map according to the area threshold function and shape filtering conditions to obtain the optimized binary bubble region map.
3. The vision-based method for predicting surfactant foam volume as described in claim 1, characterized in that, In step S30, the Euclidean distance transformation is performed on the optimized binary bubble region map to obtain a binary bubble distance map; the watershed algorithm is introduced, and local maxima points are obtained from the binary bubble distance map as the seed point set S of the watershed algorithm. The propagation is carried out with the seed point set S as the starting marker to obtain the cohesive bubble region map. The steps specifically include: Step S301: Using the optimized binary bubble region map obtained in step S20 as input, perform Euclidean distance transformation on the bubble regions to obtain a binary bubble distance map; Step S302: Perform local extremum detection on the binary bubble distance map, extract the peak value of the bubble core region, and set a safety constraint condition for the distance threshold between the peak values in the bubble core region. Construct a seed set for the watershed algorithm based on the safety constraint condition and the peak value of the bubble core region. Step S303: Negate the binary bubble distance map to obtain the inverse binary bubble distance map, and use the inverse binary bubble distance map as the topographic map input for the watershed algorithm; Step S304: Based on the seed set of the watershed algorithm and the topographic map input of the watershed algorithm, execute the propagation action of the watershed algorithm to generate a map of the clumped bubble region.
4. The vision-based method for predicting surfactant foam quantity as described in claim 1, characterized in that, Step S40, which involves segmenting effective bubbles based on the bubble region map, extracting feature information of effective bubbles using bubble diameter statistics and region density modeling, and constructing bubble structure feature vectors, specifically includes: Step S401: Based on the bubble region map obtained in step S30, traverse each bubble region to filter out effective small bubbles that meet the preset bubble constraint conditions. Step S402: Calculate the feature information of effective bubbles based on the effective bubbles; Step S403: Calculate the spatial distribution density and regional coverage of effective bubbles based on the effective bubbles; Step S404: Construct bubble structure feature vectors based on the feature information, spatial distribution density, and regional coverage of effective bubbles.
5. The vision-based method for predicting surfactant foam volume as described in claim 4, characterized in that, In step S40, the formula for calculating the spatial distribution density is: ,in, Where N is the spatial distribution density, and N is the area of a single continuous foam region. The total area of the foam zone; the formula for calculating the area coverage rate is: ,in, For regional coverage, This represents the area of the region where air bubbles adhere.
6. The vision-based method for predicting surfactant foam volume as described in claim 1, characterized in that, Step S50, which involves constructing a foam volume prediction model based on a convolutional neural network and support vector regression, and inputting the small bubble structure feature vectors into the pre-trained foam volume prediction model to obtain the output of the foam volume prediction result, specifically includes: Step S501: Based on the second image data as input, a first image prediction sub-model is constructed using a convolutional neural network structure; wherein, the first image prediction sub-model is used to automatically extract texture distribution, brightness unevenness and edge density feature information from the image; Step S502: Based on the bubble structure feature vector constructed in step S40 as input, a second image prediction sub-model is constructed using support vector regression; wherein, the second image prediction sub-model is used to establish the mapping relationship between structural features and the total volume of the bubble; Step S503: Weighted fusion of the first image prediction sub-model and the second image prediction sub-model to obtain the foam quantity prediction model; Step S504: Obtain historical labeled data, pre-train the first image prediction sub-model and the second image prediction sub-model in the foam volume prediction model based on the historical labeled data, and determine the weighting coefficients of each sub-model based on the minimum mean square error principle to obtain the pre-trained foam volume prediction model. Step S505: Input the bubble structure feature vector into the pre-trained foam volume prediction model to obtain the output of the foam volume prediction result.
7. The vision-based method for predicting surfactant foam volume as described in claim 1, characterized in that, In step S40, the characteristic information of effective bubbles includes average bubble diameter, standard deviation of bubble diameter, foam coverage area, bubble density, and coefficient of variation of bubble diameter. .
8. A vision-based surfactant foam quantity prediction system, applied to the vision-based surfactant foam quantity prediction method according to any one of claims 1-7, characterized in that, The vision-based surfactant foam quantity prediction system includes: The image acquisition and preprocessing module is used to acquire process image data of surfactant foam generation using an industrial camera with a fixed top-down view, to obtain first image data; and to obtain second image data by standardizing the first image data. The foam region extraction module is used to obtain a preliminary binary foam region map based on the second image data by using guided filtering combined with adaptive threshold binarization; the preliminary binary foam region map is then subjected to morphological filling and edge closure processing to obtain an optimized binary foam region map. The bubble segmentation module is used to perform Euclidean distance transformation on the optimized binary bubble region map to obtain a binary bubble distance map. The watershed algorithm is introduced to obtain local maxima points from the binary bubble distance map as the seed point set S of the watershed algorithm. The algorithm is propagated with the seed point set S as the starting mark to obtain the cohesive bubble region map. The feature extraction module is used to segment effective small bubbles based on the region map of the adhered bubbles, extract feature information of effective small bubbles by bubble diameter statistics and region density modeling, and construct bubble structure feature vectors. The foam volume prediction module is used to construct a foam volume prediction model based on convolutional neural networks and support vector regression. The feature vectors of small bubble structures are input into the pre-trained foam volume prediction model to obtain the foam volume prediction results.
9. A vision-based surfactant foam quantity prediction device, characterized in that, The vision-based surfactant foam quantity prediction device includes: a memory, a processor, and a vision-based surfactant foam quantity prediction program stored in the memory and executable on the processor. When the vision-based surfactant foam quantity prediction program is executed by the processor, it implements a vision-based surfactant foam quantity prediction method according to any one of claims 1 to 7.
10. A computer program product, characterized in that, The computer program product includes a vision-based surfactant foam quantity prediction program, which, when executed by a processor, implements a vision-based surfactant foam quantity prediction method according to any one of claims 1 to 7.
Citation Information
Cited By
Method and system for monitoring foam layer of waste liquid neutralization tank based on machine vision
CN121544593A
