# Application of Image Segmentation in Surface Water Extraction of Freshwater Lakes using Radar Data
## Materials and Methods
### Otsu Method  
In this section, we firstly introduce the main idea of the Otsu Method [25, 26] in a general framework and then we discuss how the Otsu Method is applied on this thresholding problem with a radar value density histogram. Here we use the following notations:  
* set \(C\) is the index set of all elements. * \(i\) is the index of \(i\)-th element, where \(i\in C\) refers to \(i\)-th element belonging to the whole set \(C\) we are considering. \(x_{i}\) is the value for this \(i\)-th element and without loss of generality, we can assume that \(x_{i}\) are sorted. Explicitly, \(x_{i}<x_{j}\), if \(i<j\), for \(i,j\in C\). * \(p_{i}\) is the probability or density of the element \(i\). It is clear that \(\sum\limits_{i\in C}p_{i}=1\). * we try to split up the set \(C\) into two disjoint subclusters of index \(C_{0}\), \(C_{1}\), where \(C_{0},C_{1}\subset C\) and \(C_{0}\dot{\cup}C_{1}=C\). * \(\mu_{j}\) is the center or the mean value of cluster \(C_{j}\), for \(j=0,1\): \[\mu_{j}=\frac{\sum\limits_{i\in C_{j}}p_{i}\cdot x_{i}}{\sum\limits_{i\in C_{j} }p_{i}}\quad,\text{ for }j=0,1\]
* \(\mu\) is the center or the mean value of the whole set \(C\): \[\mu=\sum\limits_{i\in C}p_{i}\cdot x_{i}=\sum\limits_{i\in C_{0}\dot{\cup}C_{1 }}p_{i}\cdot x_{i}\] \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Platform** & **Type** & **Spatial Resolution** & **Date** & **Band** & **Instrument** & **Orbit** \\ \hline Sentinel 1 B & GRD & 10 m & 4 January 2020 & VV & IW & 19666 \\ Sentinel 1 B & GRD & 10 m & 9 January 2019 & VV & IW & 14416 \\ Sentinel 1 B & GRD & 10 m & 2 January 2018 & VV & IW & 8991 \\ Sentinel 1 B & GRD & 10 m & 7 January 2017 & VV & IW & 3741 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Data Collection for Inundation Area Detection. * \(V_{j}\) is denoted as the inner-variance of the cluster \(C_{j}\), which is defined as the weighted summation of the squared distance of cluster \(C_{j}\)'s each data point from its center \(\mu_{j}\), for \(j=0,1\): \[V_{j}=\sum_{i\in C_{j}}p_{i}\cdot(x_{i}-\mu_{j})^{2}\quad\text{, for }j=0,1\]
* \(V_{0,1}\) is denoted as the interclass variance between the cluster \(C_{0}\) and cluster \(C_{1}\)[25], which is defined as the weighted summation of the squared distance of each cluster's center \(\mu_{j}\) from the center of the whole set \(\mu\): \[V_{0,1}=\sum_{j=0,1}((\sum_{i\in C_{j}}p_{i})\cdot(\mu_{j}-\mu)^{2})\]
* \(V\) is denoted as the total-variance, which is defined as the weighted summation of the squared distance of all data points from the center of the whole set \(\mu\). Furthermore, we can see that \(V\) is actually exactly the variance \(\sigma_{C}^{2}\) of the set \(C\): \[V=\sum_{i\in C}p_{i}\cdot(x_{i}-\mu)^{2}\]  
The main idea of the Otsu Method is to minimize the summation of the inner-variance \(V_{j}\) of all clusters \(C_{j}\), which is called intraclass variance [25]. The inner-variance of a cluster shows the summation of squared distance of each element to the center of the cluster as we defined, and the smaller value of the inner-variance presents the closer distance of each point toward the center of the cluster, which shows a closer relationship or higher similarity that the elements in this cluster share. Therefore, the best separation of the whole set of elements should group the similar elements in the same cluster as optimally as possible. In mathematics, this is equivalent to minimizing the summation of inner-variance inside each cluster. The objective function is formulated as follows:  
\[\min_{C_{0},C_{1}}\sum_{j=0,1}V_{j}=\min_{C_{0},C_{1}}\sum_{j=0,1}\sum_{i\in C _{j}}p_{i}\cdot(x_{i}-\mu_{j})^{2} \tag{1}\]  
Furthermore, the summation of each cluster's inner-variance and the interclass variance should be equal to the total-variance of the whole set [25], which is a constant for a fixed data set.