## 3 Application of the Developed Classical Computer Vision Method to the Bubble Dynamics Problem
### Bubble Distribution Investigation  
As mentioned above, the peculiarities of the bioreactor design and the hydrodynamic processes occurring in its circuit determine the problem of video camera focusing due to the fact that the bubbles are located in the volume; as a result some bubbles are closer while others are further from the camera lens. As a result, there is a certain distance with clear bubble boundaries, while all the other (closer or farther) bubbles become less clear, which means that their boundaries are less clarified and thus are more difficult to detect. At the same time, due to the camera settings and the installation design, more distant bubbles should be larger than nearby ones, so blurred bubbles will have smaller sizes than the real ones. We can then consider the problem of determining the distance at which the bubble will be too blurred for detection in order to get the estimate of the bubble size correction. Adding another smoothing might also be considered to detect less blurry  
Figure 12: Bubble segmentation using pre-trained Mask R-CNN.  
Figure 13: Bubble segmentation using pre-trained StarDist.  
bubbles but this might negatively affect the overall assessment, so we will assume that all the detected bubbles are clear and come from the general selection in order to proceed with the determination of different bubble types.  
Let us consider the distributions of the ellipse parameters (Figure 11): coordinate centers, inclination angle and principal semi-axes. The fact that the coordinate distributions (Figure 11a,b) are not uniform, as one might expect, can be explained by the fact that various parts of the frame were illuminated differently and bubbles are better defined in brighter parts. The angle distribution (Figure 11c) is symmetrical and most of the bubbles turned out to be horizontal. This is due to the bubble dynamics, which actually go more along with the horizontal axis. Additionally, the more round the bubble, the less pronounced its slope. The minor semi-axis (Figure 11d) has two peaks. If only points on one side are selected from the ellipse, then the second semi-axis is poorly determined, because there is not enough information on it. This causes uncertainty, which can give rise to two peaks in the distribution. It should also be noted that we can measure only a projection of a bubble which might also cause a second peak. If ellipses were formed from circles by the movement along the horizontal axis, the third axis should also be a minor one. As a result these two axes can substitute one another. The eccentricity distribution (Figure 11f) seems to be a combination of two exponential distributions requiring additional analysis on the reasons. No signs that could be associated with fuzzy bubbles were found in the distributions. This means that there are not enough of them among the detected, or the size change caused by the camera focus does not make a significant contribution. Note that we can also use the error distribution (Figure 11g) to cut bad detected ellipses. In fact, we can change the error metrics to improve this cut. In [44; 45], it was earlier noted that the bubble size distribution is related to the intensity of the gas-liquid flow in the system. Thus, as the flow rate increases, the distribution tends to shift from a lognormal to a normal form. Despite the difference in experimental apparatus and methods of estimating the bubble shape, we also observe a similar ratio between the fluid dynamics of the medium and the bubble size distribution.