## 3 Proposed methodology
### Feature Extraction
The structure element \(b\) for the gray expansion and gray corrosion of image \(f\) are denoted as \(f\oplus b\) and \(f\ominus b\), respectively, which are defined as follows:  
\[(f\oplus b)(x,y)=max\big{\{}f\big{(}x-x^{\prime},y-y^{\prime}\big{)}+b\big{(}x ^{\prime},y^{\prime}\big{)}\big{|}\big{(}x^{\prime},y^{\prime}\big{)}\in D_{b} \big{\}} \tag{13}\]  
\[(f\ominus b)(x,y)=\min\big{\{}f\big{(}x+x^{\prime},y+y^{\prime}\big{)}-b\big{(} x^{\prime},y^{\prime}\big{)}\big{|}\big{(}x^{\prime},y^{\prime}\big{)}\in D_{b} \big{\}} \tag{14}\]  
where \(D_{b}\) is the domain of \(b\), and \(f(x,y)\) is assumed to be \(+\infty\) outside the domain of \(f\). If \(\varrho\) is the mask and \(f\) is the marker, the reconstruction of \(\varrho\) from \(f\) can be denoted as \(R_{\varrho}(f)\), which is defined by the following iteration process:  
Figure 4: (**a**) Mineral flotation froth images in flotation cell are collected online. (**b**) Color texture unit distribution of mineral flotation froth images. Figure 5: Flow chart of froth image preprocessing. * Step 1: Initialize \(\phi_{1}\) to tag image \(f\);
* Step 2: Create the structural elements: \(B=\mathit{strel}\left({}^{\prime}\mathit{disk}^{\prime},1\right)\);
* Step 3: Repeat \(\phi_{k+1}=(\phi_{k}\oplus B)\cap g\) until \(\phi_{k+1}=\phi_{k}\). * Here, the marker \(f\) must be a subset of \(\varrho\), that is, \(f\subseteq\varrho\). The accurate segmentation of the flotation foam image is eventually obtained after image smoothing, along with distance transformation and the watershed segmentation algorithm with varied precision. The segmentation result of the flotation froth image is shown in Figure 6a. Figure 6b is the result of segmenting the flotation froth image using a classical watershed segmentation algorithm. It is clear that the improved watershed segmentation algorithm can segment the flotation froth image well, which is conducive to the accurate extraction of subsequent size features. According to the principle of mathematical statistics, the size value of each segmented region is tallied after the froth image has been segmented, and the SD is described by the frequency of the size value of each region. The image of the froth acquired online in the flotation cell is shown in Figure 7a. Figure 7b shows the SD of the flotation froth. It can be found from the figure that most froth sizes are small, and the froth SD span is large and presents a non-Gaussian distribution. The PDF curve of SD has a high peak value and large skewness, which has the characteristics of left skewness and a long tail. Figure 6: (**a**) The segmentation result of the improved watershed segmentation algorithm. (**b**) The segmentation result of the traditional watershed segmentation algorithm. Figure 7: (**a**) Froth image acquired online by flotation cell. (**b**) SD of mineral flotation froth. CTD Feature Extraction  
Supposing that the input of the mineral flotation dynamic system is \(u(t)\in R^{m}\) and the output is \(x(t)\in[a,b]\), the probability that the output \(x(t)\) is in the range \([a,b]\) is defined as:  
\[P(a\leq x(t)\leq b)=\int_{a}^{b}f_{ker}(x,u)dx \tag{15}\]  
where \(f_{ker}(x,u)\) is the actual CTD or SD of the froth image. The actual CTD and SD can be estimated by the following kernel density operators:  
Figure 5.0  
where \(\hat{f}_{ker}(x,u)\) is the approximate froth CTD function or SD function, and \(K\left(\frac{x-X_{i}}{\text{h}}\right)\) is the \(i\)th kernel function and satisfies \(\int K\left(\frac{x-X_{i}}{\text{h}}\right)dt=1\) to ensure true density estimation. \(w_{i}\) is the weight corresponding to the \(i\)th kernel function, and \(h\) is the bandwidth of the kernel function. The normal kernel function was chosen to estimate the kernel density of the CTD PDF and SD PDF of the froth based on the features of the CTD and SD of mineral flotation froth.