A method and apparatus for measuring the size and density of bubbles in water
Patent Information
- Application Number
- CN202410516811.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-28
- Publication Date
- 2026-09-18
- Estimated Expiration
- 2044-04-28
AI Technical Summary
常规的基于两台或多台相机的结构一方面增加了系统的复杂性,另一方面也增加了图像数据处理的难度
[0053] (1) The water bubble size and density measurement method and device provided in the embodiments of the present invention utilizes a convolutional neural network to realize the rapid judgment of bubble depth information, avoids the use of a binocular camera, simplifies the measurement device, and reduces the complexity of the algorithm, and can realize the rapid measurement of bubble density.
Smart Images

Figure CN118447076B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of marine science and technology, and more specifically, to a method and apparatus for measuring the size and density of air bubbles in water. Background Technology
[0002] Bubbles in water are a common phenomenon of gas-liquid coexistence, widely found in nature and production processes, such as in marine science, chemistry, biology, environmental science, metallurgy, and medicine. For example, bubble clouds generated by wave breaking at the ocean surface are a common phenomenon at the air-sea interface. Bubble clouds can significantly enhance turbulent processes and gas exchange rates at the air-sea interface, playing a crucial role in the study of ocean mixing layer dynamics, biological and chemical processes, as well as the coupling of upper ocean-lower atmosphere biogeochemical and physical processes.
[0003] To fully understand the formation and decay processes of bubble clouds and their impact on air-sea exchange, it is necessary to accurately measure the size and density of surface bubble clouds. Methods for measuring the size and density of bubbles in water mainly fall into four categories: acoustic detection, optical detection, probe detection, and computer vision.
[0004] Acoustic testing methods rely heavily on matching the sound wave frequency with the bubble's resonant frequency, making them susceptible to interference from shallow sea noise, resulting in generally low accuracy. Furthermore, they are only applicable to bubbles that are briefly still or moving slowly, and cannot measure rapidly moving bubbles.
[0005] Optical detection methods have high measurement sensitivity and small measurement error, but the detection range is small, and they can only detect single or a few bubbles. They are also greatly affected by fluctuations in the marine environment.
[0006] Probe detection is costly to manufacture and cannot perform large-scale measurements; it can only measure single or a few bubbles. Computer vision methods, on the other hand, have advantages such as a wide detection range, high accuracy, strong anti-interference capabilities, and the ability to simultaneously measure size and density information.
[0007] In computer vision methods, bubble segmentation methods based on traditional image processing techniques have low segmentation accuracy and perform poorly for bubbles with high overlap rates; image segmentation techniques based on deep learning require a large amount of annotation work and a significant amount of time to prepare the dataset.
[0008] Currently, observations of bubble clouds generated by wave breaking on the ocean surface are limited to laboratory simulations, with few instruments and methods available for on-site observation at sea. This necessitates overcoming challenges such as platform sway, rapid bubble movement and changes, unclear imaging, large errors in image recognition and counting, and slow response times. Conventional structures based on two or more cameras increase both system complexity and the difficulty of image data processing. Summary of the Invention
[0009] In view of the deficiencies in the prior art, the purpose of this invention is to provide a method and apparatus for measuring the size and density of bubbles in water.
[0010] According to one aspect of the present invention, a method for measuring the size and density of air bubbles in water is provided, comprising:
[0011] Obtain the bubble cloud image dataset;
[0012] Based on the bubble cloud image dataset, a target detection model and a focus model are trained.
[0013] The size distribution of bubble clouds is calculated by combining a trained object detection model with image processing.
[0014] The density of the bubble cloud is calculated using a trained focusing model.
[0015] Preferably, the step of acquiring the bubble cloud image dataset includes:
[0016] The actual size corresponding to the camera pixels is calibrated;
[0017] Acquire bubble cloud images, which include images of bubbles at different distances from the camera's focal plane;
[0018] The bubble cloud image is annotated, indicating the position of each bubble in the image and its distance from the camera's focal plane;
[0019] Data augmentation is performed on the bubble cloud image.
[0020] Preferably, the calibration of the actual size corresponding to the camera pixels includes:
[0021] Place the scale at the focal plane of the camera, record the physical size l of the scale, and record the number of pixels p corresponding to this physical size in the image captured by the camera;
[0022] Calculate the physical size of a pixel near the focal plane.
[0023] Preferably, a linear bubble generator is used to generate bubbles at a fixed distance from the camera, and images are acquired; by changing the distance between the linear bubble generator and the camera, images of bubbles located at different distances from the camera's focal plane are obtained.
[0024] Preferably, the
[0025] Based on the aforementioned bubble cloud image dataset, a target detection model and a focus model are trained, including:
[0026] Using the bubble cloud image dataset, a target detection model is trained. The target detection model can detect all bubble types in the image, as well as the position and size of the corresponding bubbles.
[0027] Using the bubble cloud image dataset, a focus judgment model is trained, which can determine whether all bubbles are within the measurement depth range.
[0028] Preferably, the target detection model includes models based on YOLO, Faster R-CNN, and non-maximum suppression methods;
[0029] The training of the focus judgment model includes:
[0030] Preprocess the images: unify the bubble image stream size to a 64×64 3-channel RGB image; linearly scale the color intensity to between 0 and 1; subtract the mean of the dimension above each data point so that the mean of all images in the dataset is converted to zero;
[0031] The preprocessed image is judged: a neural network is used to mark the bubble samples as out of focus or in focus.
[0032] Preferably, the step of calculating the size distribution of the bubble cloud using a trained target detection model combined with image processing includes:
[0033] The target detection model is used to detect bubble flow images, and individual bubbles and their positions and sizes are detected; overlapping bubbles are also detected, and overlapping bubble slices are extracted.
[0034] For the overlapping bubble slice, only the central bubble located at the center of the slice is detected, and the area of the central bubble is determined using the overlapping bubble segmentation algorithm in image processing counting.
[0035] Based on the bubble area, the equivalent diameter d of the bubble at the center is obtained, and the physical size of the diameter of the central bubble is determined to be d×r.
[0036] Preferably, the area of the central bubble is determined using an overlapping bubble segmentation algorithm in image processing counting, including:
[0037] Plot the centroid distance curve of the overlapping bubbles;
[0038] Calculate the inflection point on the centroid distance curve;
[0039] The deflection direction of the curve at the inflection point is calculated to obtain the concave point segmentation of the overlapping bubble contour;
[0040] The area of the central bubble is obtained by performing elliptical least-squares fitting on the selected contour curve.
[0041] Preferably, the step of calculating the density of the bubble cloud using the trained focusing model includes:
[0042] Using the aforementioned focus determination model, the individual bubbles and overlapping bubbles in the bubble flow image are determined to be in focus, and the number of in-focus bubbles n is obtained.
[0043] The range of the device in the three-dimensional focusing field of view, h×w×2x, is calculated by multiplying the original two-dimensional field of view size of the image, h×w×2x, by the focusing distance.
[0044] Divide the number of focused bubbles n by the three-dimensional focusing field of view size to obtain the density of bubbles in three dimensions.
[0045] According to a second aspect of the present invention, an apparatus is provided for implementing the method for measuring the size and density of air bubbles in water, comprising:
[0046] The water tank provides an environment for bubble generation;
[0047] A bubble generator, located inside the water tank, is used to generate bubbles within the water tank.
[0048] An air pump, located outside the water tank, is used to drive the bubble generator;
[0049] A fixing component is used, with a camera mounted on one side and a light source mounted on the other side; the camera is located on the front of the bubble, and the light source is located on the back of the bubble;
[0050] A scale is used to calibrate a camera and obtain the physical size of a pixel at the focal plane.
[0051] The data processing unit is connected to the camera and calculates and processes the data to determine the size and density of bubbles in the water.
[0052] Compared with the prior art, the embodiments of the present invention have at least one of the following beneficial effects:
[0053] (1) The water bubble size and density measurement method and device provided in the embodiments of the present invention utilizes a convolutional neural network to realize the rapid judgment of bubble depth information, avoids the use of a binocular camera, simplifies the measurement device, and reduces the complexity of the algorithm, and can realize the rapid measurement of bubble density.
[0054] (2) The water bubble size and density measurement method and device provided in the embodiments of the present invention use the target detection algorithm in deep learning to perform preliminary segmentation of bubble cloud image to obtain overlapping bubble slices, and then use the traditional overlapping bubble segmentation algorithm to detect the bubble in the center of the slice. This avoids the measurement error introduced by concave point matching in the traditional algorithm (concave point matching may have the phenomenon of mismatched concave points, matching concave points that do not belong to the same bubble as concave points on the same bubble), greatly improves the accuracy of bubble segmentation, and thus improves the accuracy of bubble size measurement. Attached Figure Description
[0055] Other features, objects, and advantages of the present invention will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings:
[0056] Figure 1 This is a flowchart of a method for measuring the size and density of air bubbles in water according to an embodiment of the present invention;
[0057] Figure 2 This is a block diagram of a method for measuring the size and density of air bubbles in water according to a preferred embodiment of the present invention;
[0058] Figure 3 This refers to the measurement error of the bubble size in water in a preferred embodiment of the present invention;
[0059] Figure 4 This is a measurement result of the bubble density in water in a preferred embodiment of the present invention;
[0060] Figure 5 This is a water bubble size and density measuring device in one embodiment of the present invention;
[0061] Figure 6 This is a schematic diagram of an overlapping bubble section in a preferred embodiment of the present invention.
[0062] In the diagram, 1 is the camera, 2 is the light source, 3 is the data processing unit, 4 is the scale, 5 is the fixture, 6 is the air pump, 7 is the bubble generator, and 8 is the transparent water tank. Detailed Implementation
[0063] The present invention will now be described in detail with reference to specific embodiments. These embodiments will help those skilled in the art to further understand the present invention, but do not limit the invention in any way. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention. These all fall within the scope of protection of the present invention.
[0064] One embodiment of the present invention provides a method for measuring the size and density of air bubbles in water, such as... Figure 1 and Figure 2 As shown, the specific implementation steps are as follows:
[0065] S100, Obtain the bubble cloud image dataset;
[0066] S200, a bubble cloud image dataset based on S100, is used to train object detection and focusing models;
[0067] S300 uses a trained object detection model combined with image processing to calculate the size distribution of bubble clouds;
[0068] S400 uses a trained focusing model to calculate the density of bubble clouds.
[0069] In order to obtain a more effective dataset of bubble cloud images, in a preferred embodiment, the steps of S100 are as follows:
[0070] S1.1, calibrate the actual size corresponding to the camera pixels;
[0071] Establish Figure 1 In the coordinate system shown, the z-axis direction is aligned with the camera axis. Adjust the bubble generator and the scale so that the bubble generator and the scale mark are located in the xy plane under the same z coordinate. Move the camera in the x-axis direction to align the camera with the scale mark, and move the camera in the z-axis direction to focus on the scale mark so that the scale can be clearly imaged, thus establishing a pixel-length mapping relationship.
[0072] Furthermore, the process of establishing the pixel-length mapping relationship is as follows: place the scale at the focal plane of the camera, record the physical size l of the scale, and record the number of pixels p corresponding to this physical size in the image captured by the camera. Calculate the physical size of the pixel near the focal plane. This is the pixel-length mapping relationship.
[0073] S1.2, Acquire high-quality bubble cloud images. These images contain data of bubbles located at different distances from the camera's focal plane, specifically:
[0074] Keeping the z-axis position constant, the camera is moved along the x-axis to align with the bubble and image it. The camera is then moved along the z-axis to acquire bubble cloud images at different defocus distances. In some specific embodiments, a total of 100 images at different defocus distances were obtained.
[0075] S1.3, Annotate the bubble cloud image acquired in S1.2, marking the position information of each bubble in the image and its distance from the camera's focal plane. Specifically:
[0076] The bubble cloud image was labeled using the labelme software. In this embodiment, a total of 23,184 bubbles were obtained, of which 80% were used as the training set, 10% as the test set, and 10% as the validation set.
[0077] S1.4, perform data augmentation on the labeled bubble cloud images to increase the robustness of the training set. In some specific embodiments, data augmentation methods include random scaling, random cropping, and random arrangement to obtain more training data. Of course, other data augmentation methods can also be used in other embodiments.
[0078] Based on the bubble cloud images acquired in the above embodiments, model training is performed, and the trained model is used for subsequent size detection and density measurement. In a preferred embodiment, the steps of S200 are as follows:
[0079] S2.1, train an object detection model on the bubble cloud image to detect all bubbles in the image and determine their positions. In some specific embodiments, object detection algorithms such as YOLO and Faster R-CNN are used. In other specific embodiments, non-maximum suppression methods are used, and GIOU is used as the discrimination criterion.
[0080] S2.2, train a focus judgment model on the bubble cloud image to determine whether the bubble is within the measurement depth range. This depth range refers to the Z-axis direction as shown in the figure. Determining whether it is within the measurement depth range is for accurate size calculation; bubble size measurements outside the measurement depth range have a large error. If the bubble is outside the range, it is discarded.
[0081] Specifically, bubble flow images at different distances from the focal plane exhibit varying degrees of blur. Bubbles within a distance of less than x (which can be 3mm) from the focal plane are defined as in-focus bubbles. Based on whether a bubble is in focus, a convolutional neural network is used to train bubble samples to obtain a model for distinguishing between in-focus and out-of-focus bubbles.
[0082] In a preferred embodiment, S2.1 is implemented, and the target detection model uses the relatively mature YOLOv5 method. YOLO is a one-stage target detection method, specifically:
[0083] S2.1.1, the input image is scaled or filled to a size of 640×640 before being input into the network;
[0084] S2.1.2, divide the 640×640 image into 80×80 grid regions;
[0085] S2.1.3, the network outputs prediction information for all grid regions. The prediction information for each grid includes the target's classification probability, confidence probability, and the coordinates of the bounding box. The classification probability represents the predicted classification of the target in the grid region, the confidence probability represents the probability of a detected target existing in the grid region, and the bounding box includes the center coordinates of the object's location, as well as its length and width. Each grid predicts three detected targets of different sizes and locations.
[0086] In a preferred embodiment, step S2.2 is performed to train a focus determination model on the bubble cloud image. This ensures that the data has a uniform format and scale before being input into the model, enabling the model to more easily learn useful features and patterns from the data. Specifically:
[0087] S2.2.1, Obtain bubble samples located on different focal planes from the original acquired bubble image, and unify the sample image size to a 3-channel RGB image of 64×64;
[0088] This preprocessing method ensures consistency of model input, reduces the complexity of model processing, and ensures that all images are processed by the network in the same way.
[0089] S2.2.2, linearly scale the color intensity to between 0 and 1 to improve the training effect;
[0090] This preprocessing method can reduce numerical instability during model training. It makes gradient descent optimization during model training more efficient, ensures that all features are scaled similarly, and thus helps to achieve convergence faster.
[0091] S2.2.3 further applies zero-centering, subtracting the mean of the dimension from the data in each dimension, so that the mean of all images in the dataset is converted to zero, thereby reducing the possible bias in the model during training and ensuring a fairer comparison between different features.
[0092] In section S2.2.4, a neural network is used to label bubble samples as either out of focus or in focus. This neural network consists of six convolutional layers, three max-pooling layers, and a fully connected layer. The final layer of the network is a softmax layer, which outputs the classification of the final sample. The objective function is defined as the class cross-entropy between the label and the prediction.
[0093] Furthermore, regarding the optimization method, stochastic gradient descent (SGD) was used, with a batch size of 64. The operation performed for each layer x can be represented as follows:
[0094] x = g(Wμ + b)
[0095] Here, W (weights) and b (bias) are the parameters to be learned, g is the activation function, and u is the input vector of the previous layer. In each layer, a rectified linear unit (ReLU) is used, with the activation function being...
[0096] g = max(0, Wμ + b)
[0097] We leverage the simplification properties of ReLU by combining it with SGD to accelerate learning. Like other optimization algorithms, SGD requires initial values for model parameters, and the input of each layer is influenced by the parameters of the previous layer. Therefore, as the network deepens, small changes in the parameters of previous layers are amplified. To address the internal covariate shift caused by inconsistent layer input distributions, batch normalization (BN) is used in the convolutional layers. To reduce the risk of overfitting, Dropout regularization is used in the fully connected layers. Taking advantage of the normalization effect of BN training, the Dropout strength is reduced to p = 0.2, and the number of training iterations is set to 20.
[0098] The neural network mentioned in the above steps is used to train the bubble samples. Starting from the focus position 0, the segmentation plane (the plane that marks the focus and defocus of the bubble) is expanded outward. The optimal segmentation plane is selected as the result of the neural network that best classifies focus and blur depth, and the trained model is output.
[0099] Based on the trained detection and focusing models described above, further applications are made. In a preferred embodiment, step S3 is performed, using the trained target detection model combined with image processing to calculate the size distribution of the bubble cloud, such as... Figure 3 As shown, specifically:
[0100] S3.1 uses a target detection model to detect bubbles in the bubble flow image, obtaining two types of bubbles: single bubbles, whose position and size are directly output; and overlapping bubbles, from which overlapping bubble slices are extracted, such as... Figure 6 As shown, proceed to step S3.2 for segmentation to obtain the size of the overlapping bubbles;
[0101] S3.2 For overlapping bubble segments, it is assumed that only bubbles located at the center of the image (referred to as the center bubble) are detected. The overlapping bubble segmentation algorithm from traditional image processing is used to segment the image and calculate the area of the center bubble. Based on this bubble area, the number of pixels corresponding to the equivalent diameter d of the center bubble is obtained, and its physical size d×r is calculated. (Given the diverse shapes of overlapping bubbles, which may be elliptical or other non-standard circles, the concept of equivalent diameter is proposed to accurately describe their size characteristics. The equivalent diameter refers to the diameter of a circle whose area is equal to the bubble area obtained by the bubble segmentation algorithm.)
[0102] The overlapping bubble segmentation method used in this embodiment is based on the centroid distance curve and the deflection direction. Specifically, the centroid distance curve of the overlapping bubbles is first drawn, the inflection point on the curve is calculated, and then the deflection direction of the curve at the inflection point is calculated to obtain the concave point to segment the outline of the overlapping bubbles. The center curve of the image is selected for elliptical least squares fitting to obtain the bubble area.
[0103] Similarly, in the preferred embodiment, step S4 is performed to calculate the density of the bubble cloud using the trained focusing model, such as... Figure 4 As shown, specifically:
[0104] S4.1, using the focus judgment model, determine whether individual bubbles and bubble slices in the input bubble flow image are in focus, and obtain the number of in-focus bubbles n.
[0105] Specifically, for the input test image, the model outputs a two-dimensional array matrix of size 2M, where M is the number of input bubble samples. The two columns of the matrix represent the probabilities of the bubble sample being out of focus or in focus, respectively. For each row of the matrix, the two values add up to 1. If the probability of being in focus is higher than 0.5, the bubble sample is considered in focus. Therefore, through this focus judgment model, the classification results of each bubble (including individual bubbles and overlapping bubbles) can be obtained, and the number of bubbles n located in the in-focus field of view can be determined.
[0106] The formula for calculating the accuracy of the number of bubbles in the in-focus field of view is as follows:
[0107]
[0108] Wherein, TP, TN, P, and N correspond to the number of correctly classified focused bubbles, the number of correctly classified defocused bubbles, the total number of focused bubbles, and the total number of defocused bubbles, respectively. In some specific embodiments, the detection accuracy (precision) of whether a bubble is in focus can reach 93.81%.
[0109] S4.2, calculate the range of the device's three-dimensional focusing field of view (h×w×2x) by multiplying the original two-dimensional field of view size (h×w) by the focusing distance. Divide the number of focusing bubbles by the three-dimensional focusing field of view size to obtain the density of bubbles in three dimensions.
[0110] Based on the same inventive concept, in one embodiment of the present invention, an apparatus is provided for implementing the aforementioned method for measuring the size and density of air bubbles in water, such as... Figure 5 As shown, it includes a camera 1, a light source 2, a data processing unit 3, a scale 4, a fixing component 5, a sealing assembly, etc.
[0111] The camera has a resolution of 1200×1600 pixels and a pixel size of 6.65μm. The lens has a focal length of 4mm, a field of view of 96mm×72mm, and an observation distance of 0.107m. A planar white light source with dimensions of 100mm×100mm is used. Camera 1 and light source 2 are mounted at both ends of a fixed component. The camera, located on one side of the bubble flow (front), is used to capture images of the bubble cloud. A scale 4 is used to calibrate camera 1, obtaining the physical dimensions of the pixels near the focal plane. Light source 2 provides the incident light for capturing images of the bubble cloud and is located on the back side of the bubble flow, parallel to the camera lens. The light emitted by light source 2 passes through the bubble cloud and reaches camera 1, transmitting the captured image to the data processing unit. The image processing unit is a 64-bit 1.5GHz quad-core Cortex-A72 (ARM v8) CPU, which calculates and processes the image to determine the size and density of the bubbles in the water.
[0112] In this embodiment, the bubble cloud consists of an air pump 6 and a bubble generator 7. The air pump has a power of 4W, the bubble generator is a fired bubble stone, and the measurement environment is provided by a transparent glass water tank 8.
[0113] The camera's pixel size determines the smallest bubble size that can be measured; the smaller the pixel size, the higher the measurement resolution. In a preferred embodiment, the camera has 1200×1600 pixels, a pixel size of 6.65μm, a lens focal length of 4mm, a field of view of 96mm×72mm, and an observation distance of 0.107m.
[0114] The size of the light source affects the measurement range, while the luminous power and uniformity determine the image quality and affect the detection accuracy. In a preferred embodiment, a planar white light source with a size of 100mm × 100mm and a power of 17.3W is selected.
[0115] When the camera acquires images, it captures the central portion of the image with uniform illumination to reduce errors caused by changes in boundary lighting conditions.
[0116] The computing power of the data processing system is determined by the required measurement speed; the higher the computing power, the higher the achievable measurement speed. In some specific embodiments, the CPU uses a 64-bit 1.5GHz quad-core Cortex-A72 (ARM v8), which can achieve a measurement speed of 20.6 seconds per measurement.
[0117] In a preferred embodiment, images of bubbles located at different distances from the camera's focal plane are obtained by generating bubbles at a fixed distance from the camera using a linear bubble generating device, and then acquiring the images. Specifically, the linear bubble generating device contains a series of tiny gaps that atomize the introduced gas into bubbles.
[0118] In one specific embodiment, using the water bubble size and density measurement method and apparatus described in the above embodiments, the average detection time for processing 10 bubble flow images was calculated to be 20.6 s / image. The target detection model achieved a detection accuracy of 95.83%, with an average size measurement error of 2.42%, an accuracy of 93.81% for detecting whether the bubble is in focus, and an average density measurement accuracy of 89.90%. These results fully demonstrate that, in the field of water bubble size and density detection, the measurement method and apparatus proposed in this invention avoids the use of a binocular camera for detection and combines deep learning methods with traditional image processing techniques. Compared with traditional measurement systems and algorithms, it simplifies the measurement apparatus, accelerates the measurement speed, and improves the measurement accuracy.
[0119] Specific embodiments of the present invention have been described above. It should be understood that the present invention is not limited to the specific embodiments described above, and those skilled in the art can make various modifications or variations within the scope of the claims, which do not affect the essence of the present invention. The preferred features described above can be used in any combination without conflict.
Claims
1. A method of measuring bubble size and density in water, characterized by, include: Obtain the bubble cloud image dataset; Based on the bubble cloud image dataset, a target detection model and a focus model are trained. The size distribution of bubble clouds is calculated by combining a trained object detection model with image processing. The density of the bubble cloud is calculated using a trained focusing model. The step of calculating the size distribution of the bubble cloud using a trained object detection model combined with image processing includes: The target detection model is used to detect bubble flow images, and individual bubbles and their positions and sizes are detected; overlapping bubbles are also detected, and overlapping bubble slices are extracted. For the overlapping bubble slice, only the central bubble located at the center of the slice is detected, and the area of the central bubble is calculated using the overlapping bubble segmentation algorithm in image processing technology; Based on the area of the center bubble, an equivalent diameter of the center bubble is obtained , the diameter physical size of the center bubble is determined as ; The area of the central bubble is calculated using the overlapping bubble segmentation algorithm in image processing counting, including: Plot the centroid distance curve of the overlapping bubbles; Calculate the inflection point on the centroid distance curve; The deflection direction of the curve at the inflection point is calculated to obtain the concave point segmentation of the overlapping bubble contour; The area of the central bubble is obtained by performing elliptical least-squares fitting on the contour curve. The calculation of the density of the bubble cloud using the trained focusing model includes: Using the focusing model, whether the single bubble and the overlapping bubble in the bubble flow image is focused is judged, and the number of focused bubbles is obtained ; Utilizing the image's original two-dimensional field size Multiplying the focal distance to calculate the device's range in the three-dimensional focal field ; Divide the number of focused bubbles n by the three-dimensional focusing field of view size to obtain the density of bubbles in three dimensions. .
2. The method for measuring the size and density of air bubbles in water according to claim 1, characterized in that, The acquisition of the bubble cloud image dataset includes: The actual size corresponding to the camera pixels is calibrated; Acquire bubble cloud images, which include images of bubbles at different distances from the camera's focal plane; The bubble cloud image is annotated, indicating the position of each bubble in the image and its distance from the camera's focal plane; Data augmentation is performed on the bubble cloud image.
3. The method for measuring the size and density of air bubbles in water according to claim 2, characterized in that, The calibration of the actual size corresponding to the camera pixels includes: Place the ruler at the focal plane of the camera and record its physical dimensions. And record the number of pixels corresponding to this physical size in the image captured by the camera. ; Calculate the physical size of a pixel near the focal plane. .
4. The method for measuring the size and density of air bubbles in water according to claim 2, characterized in that, A linear bubble generator is used to generate bubbles at a fixed distance from the camera, and images are acquired. By changing the distance between the linear bubble generator and the camera, images of bubbles located at different distances from the camera's focal plane are obtained.
5. The method for measuring the size and density of air bubbles in water according to claim 1, characterized in that, The Based on the aforementioned bubble cloud image dataset, a target detection model and a focus model are trained, including: Using the bubble cloud image dataset, a target detection model is trained. The target detection model can detect all bubble types in the image, as well as the position and size of the corresponding bubbles. Using the bubble cloud image dataset, a focusing model is trained, which can determine whether all bubbles are within the measurement depth range.
6. The method for measuring the size and density of air bubbles in water according to claim 5, characterized in that, The target detection models include models based on YOLO, Faster R-CNN, and non-maximum suppression methods; The training of the focusing model includes: Image preprocessing: Standardize bubble image stream size to 64. 64 three-channel RGB images; linearly scale the color intensity to between 0 and 1; subtract the mean of the data in each dimension from the mean of that dimension, so that the mean of all images in the dataset is converted to zero; The preprocessed image is judged: a neural network is used to mark the bubble samples as out of focus or in focus.
7. An apparatus for implementing the method for measuring the size and density of air bubbles in water according to any one of claims 1-6, characterized in that, include: The water tank provides an environment for bubble generation; A bubble generator, located inside the water tank, is used to generate bubbles within the water tank. An air pump, located outside the water tank, is used to drive the bubble generator; A fixing component is used, with a camera mounted on one side and a light source mounted on the other side; the camera is located on the front of the bubble, and the light source is located on the back of the bubble; A scale is used to calibrate a camera and obtain the physical size of a pixel at the focal plane. The data processing unit is connected to the camera and calculates and processes the data to determine the size and density of bubbles in the water.
Citation Information
Patent Citations
Wide-size particle field measuring method based on IPI focused image and defocused image
CN109001084A
Bubble flow field three-dimensional reconstruction method based on convolutional neural network and light field image
CN111709983A