# Experimental Investigation on the Dynamic Characteristics of Bubble-in-Chain Near a Vertical Wall
## 2 Materials and Methods
### Bubble Tracking  
Bubble tracking is achieved by image processing techniques involving key steps such as image filtering, edge detection, feature extraction and feature matching [17]. The results \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Liquid Type** & **Density (kg/m3)** & **Viscosity (Pa s)** & **Surface Tension (N/m)** \\ \hline
35\% glycerin solution & 1071.6 & \(6.6\times 10^{-3}\) & \(64.14\times 10^{-3}\) \\ \hline \hline \end{tabular}
\end{table} 
Table 1: The solution properties at 20 \({}^{\circ}\)C.  
Figure 1: Experimental setup. of these processing steps are illustrated in Figure 2. Initially, a Gaussian low-pass filter is employed to mitigate the noise present in the image signal. The transfer function of this filter can be described as follows [18]:  
\[H(m,n)=e^{-\frac{D^{2}(m,n)}{2g^{2}}} \tag{1}\]  
The distance between the coordinate point (\(m\), \(n\)) and the center of the spectrum is represented by \(D(m\), \(n)\), while \(\delta\) denotes the standard deviation. The processed image results are illustrated in Figure 2b. The threshold segmentation technique is employed to mitigate the influence of the wall during bubble feature recognition. The transfer function utilized is as follows:  
\[g(a,b)=\left\{ \begin{array}{cc}1,&f(a,b)\geq T\\ 0,&f(a,b)<T\end{array} \right\} \tag{2}\]  
The functions \(f(a,b)\) and \(g(a,b)\) represent the gray value functions of the original image and the target image, respectively. \(T\) denotes a set threshold for gray levels that is utilized to differentiate various regions within an image. The outcome of the process is illustrated in Figure 2c. The application of threshold segmentation may introduce salt-and-pepper noise and fluctuation interference caused by accidental factors. To mitigate these disturbances, a median filter is employed:  
\[h_{ij}=\underset{f_{ij}\in Y}{Med}\big{\{}f_{ij}\big{\}} \tag{3}\]  
The gray value of the neighborhood surrounding a point in the original image, denoted as \(f_{ij}\), is considered within the neighborhood range \(Y\). The middle value obtained from this neighborhood, referred to as \(Med\), is then assigned as the gray value \(h_{ij}\) for that specific point in the output image. The processing results are visually depicted in Figure 2d. Figure 2: Bubble tracking processes. (**a**) original image; (**b**) low-pass filtering (**c**) threshold segmentation (**d**) median filtering (**e**) edge detection (**f**) feature matching. After applying threshold segmentation, the Sobel operator is employed to further delineate the boundaries of the bubbles. For a given image, the gray gradient based on positional coordinates can be represented as:  
\[\
abla f=\left[ \begin{array}{c}g_{a}\\ g_{b}\end{array} \right]=\left[ \begin{array}{c}\frac{\partial f}{\partial t}\\ \frac{\partial f}{\partial b}\end{array} \right] \tag{4}\]  
The gray-level function \(f\) is defined based on the position coordinates in the image. The edge strength is determined by calculating the magnitude of the gray gradient at each point:  
\[mag(\
abla f)=\sqrt{{g_{a}}^{2}+{g_{b}}^{2}}=\sqrt{\left(\frac{\partial f}{ \partial a}\right)^{2}+\left(\frac{\partial f}{\partial b}\right)^{2}} \tag{5}\]  
The gradient of each pixel in the target image is computed by taking the difference between the row and column values within a \(3\times 3\) neighborhood. The center pixel is given a weight of 2 to emphasize its contribution. The resulting calculation can be expressed as:  
\[\
abla f=\sqrt{\left[\left(l_{1}+2l_{8}+l_{9}\right)-\left(l_{1}+2l_{2}+l_{3} \right)\right]^{2}+\left[\left(l_{7}+2l_{6}+l_{9}\right)-\left(l_{1}+2l_{4}+l _{7}\right)\right]^{2}} \tag{6}\]  
Here, \(l_{i}\) represents the brightness value of the \(i\)-th pixel within the neighborhood. If the gradient value of \(\bigtriangledown f\) at a specific location (\(a\), \(b\)) in the image exceeds the threshold, this means that the location is a border pixel, which is an area where the brightness changes more dramatically in the image.