# Spatially Adaptive Regularization in Image Segmentation
## 4 Results and Comparisons  
The three spatially adaptive regularization techniques were implemented in MATLAB, while using the Image Processing Toolbox. Algorithm 1 was implemented by modifying the Fast Global Minimization Algorithm for Active Contour Models by [PERSON], available from [[http://htmlpreview.github.io/?https://github.com/xbresson/old_codes/blob/master/codes.html](http://htmlpreview.github.io/?https://github.com/xbresson/old_codes/blob/master/codes.html)]([http://htmlpreview.github.io/?https://github.com/xbresson/old_codes/blob/master/codes.html](http://htmlpreview.github.io/?https://github.com/xbresson/old_codes/blob/master/codes.html)). This is a C code with a MATLAB MEX interface. \(L_{\sigma}\) in (7) is defined as a rotationally symmetric Gaussian filter with size 3 and standard deviation \(\sigma=2\). The mean and median filters use windows of size 3 and 7, respectively, and the parameter \(t\) in (10) is set as \(t=0.5\). The parameter \(\alpha=0.5\) is used to identify the domain \(\Sigma\) according to (4). In the original and modified codes, the SB iterations are stopped, as follows:  
\[|\texttt{diff}^{k}-\texttt{diff}^{k-1}|\leq\texttt{tol}\quad\text{and}\quad k> \texttt{maxit}, \tag{18}\]where  
\[\mathtt{diff}^{l}=\frac{\mathtt{sd}(u^{l})}{\mathtt{sd}(u^{l})\cdot\mathtt{sd}(u^{ l-1})},\quad\mathtt{sd}(u^{l})=\sum_{i,j}(u^{l}_{i,j}-u^{l}_{i,j})^{2},\]  
tol is a given tolerance and maxit denote the maximum number of outer iterations. The stopping criterion for the GS iterations is  
\[E(u^{k})=1-\frac{|\mathtt{msd}^{k}-\mathtt{msd}^{1}|}{\mathtt{msd}^{1}}\leq \mathtt{tol}_{\mathtt{GS}}\quad\text{and}\quad k>\mathtt{maxit}_{\mathtt{GS}}\]  
where  
\[\mathtt{msd}^{l}=\frac{1}{mn}\sum_{i,j}(u^{l}_{i,j}-u^{l-1}_{i,j})^{2},\]  
and \(\mathtt{tol}_{\mathtt{GS}}\) and \(\mathtt{maxit}_{\mathtt{GS}}\) are the tolerance and the maximum number of iterations for the GS method, respectively. In our experiments we set \(\mathtt{tol}=10^{-6}\), \(\mathtt{maxit}=30\), \(\mathtt{tol}_{\mathtt{GS}}=10^{-2}\) and \(\mathtt{maxit}_{\mathtt{GS}}=50\). The adaptive models are compared with the original CEN model on different images widely used in image processing tests, as listed in Table 1 and shown in Figures 1-4. In particular, the images bacteria, bacteria2, brain, cameraman, squirrel, and tiger are included in [PERSON]'s code distribution, flowerbed has been downloaded from the Berkeley segmentation dataset [34] available from [[https://www2.eecs.berkeley.edu/Research/Projects/CS/vision/grouping/resources.html](https://www2.eecs.berkeley.edu/Research/Projects/CS/vision/grouping/resources.html)]([https://www2.eecs.berkeley.edu/Research/Projects/CS/vision/grouping/resources.html](https://www2.eecs.berkeley.edu/Research/Projects/CS/vision/grouping/resources.html)) (image #86016), and ninetyeight is available from [[https://tineye.com/query/2817](https://tineye.com/query/2817) cf0d186 fbfe263a188952829a3b5e699d839]([https://tineye.com/query/2817](https://tineye.com/query/2817) cf0d186 fbfe263a188952829a3b5e699d839). We note that tiger is included in [PERSON]'s code as a test problem for a segmentation model specifically developed for images with texture [35], which is also implemented in the code. This model uses the well-known Kullback-Leibler divergence function regularized with a TV term. The model is solved with the SB method. We perform the segmentation of tiger with the CEN model, the textural segmentation model, and our approaches, in order to investigate whether our locally adaptive model can be also suitable for textural images. The cameraman image is perturbed with additive Gaussian noise, with zero mean and two values of standard deviation, \(\sigma=15,25\), with the aim of evaluating the behavior of our adaptive approaches on noisy images. The noisy images are called cameraman15 and cameraman25. For the images provided with [PERSON]'s code, the values of \(\lambda\) and \(\mu\) associated with the original CEN model are set as in that code.