## 2 Materials and Methods
### Bubble Processing Methodology by Virtue of Computer Vision Approach  
As mentioned, the frames obtained as a result of video filming by a high-speed camera during the experimental runs were taken as input data for processing and analysis. In the current subsection we dwell in detail on the method of processing, extracting the individual bubble parameters and ultimately determining the total phase contact area. One classical methodology for solving a similar class of problems is deep learning methods, including labeling the training data set, model training and its validation on a dataset that was not used during the training. Meanwhile the labeling of the collected set is quite a resource-intensive task, in particular since deep learning would require re-labeling and training for each new type of the measurement, also discussed later, so at the first stage classical computer vision methods were deemed for bubble processing. The methodology approach might be partitioned down into several steps, i.e., (i) image pre-processing of the original image (Figure 2) including contrast enhancement; (ii) filters applied to highlight bubble boundaries, as well as clustering to extract individual bubbles; (iii) the overlap compensation methodology; (iv) determining the parameters of selected bubbles by classical analysis methods. Assuming the bubble is defined by its boundary one should keep in mind the light reflection effects which might result in a false boundary appearance not related to the real bubble. Therefore, before clusterization we take the first step related to separate the real boundary from the false one, i.e., by the filter or the combination of filters to be determined. A number of neat transformations should be applied to the image in order the make the boundary more clear. Among a number of approaches the black-hat transform was chosen due to its advantages in visual allowance to highlight the edges better with no additional noise effect production affecting in a negative way the original image (Figure 3a). Meanwhile the contract increase for the desired bubble boundaries leads to the corresponding increase for false boundaries, in fairness not as strong. Applying a blur filter should thus improve the selection of the desired boundaries. A normal distribution filter is chosen and after image preprocessing the boundary selection filter is applied, namely the Canny filter. It should be noted that, depending on the threshold parameters, this filter leads either to an excessive quantity of false boundaries or too little of the real ones; therefore, finally the Frangi filter is considered as having fewer problems with false boundaries, while the real ones are blurry. As mentioned this problem might be now solved by the Canny filter and so finally the following combination of filters is chosen: black-hat transform on the original image, then blurring by Gaussian kernel, the Frangi filter and the Canny filter as the final transformation as seen in Figures 3 and 4. Now after extracting bubble boundaries (Figure 5) the next step would be to separate the bubbles into clusters: the DBSCAN method is chosen due to its feature of group nested circles as separate clusters. However, we understand the remaining possibility of tuning its parameters possibly allows the number of different bubbles combined into one cluster to be reduced. Figure 2: Sample image of the frame from F3 video described in Table 1 under consideration within the current study. Despite the filming of bubble flows being performed by means of the high-speed and high-resolution camera as well as with additional lighting, the flow’s specificity determined the complexity of the primary task, namely, marking and model training. Figure 4: Examples of (**a**) Canny filter and (**b**) Frangi filter applied on a sample frame from the F3 video. One can see that the Canny filter produces more false edges while Frangi filter’s edges are wide which is not an easement for the following analysis.