# Edge-Preserving Image Denoising Based on Lipschitz Estimation
## 4 Lipschitz Based Image Restoration
### Restoration  
In order to obtain a noise-free image from the background, the method utilizes data samples and performs non linear functioning to estimate the best fit. We defined an adaptive restoration method for two classes: one for the edges and one for the background. The concept of the class definition is given in Figure 8a. The edge points belong to class 1 and rest of the image belong to class 2. While denoising, we centered the pixel on a \(3\times 3\) window.  
The weighting factor depends on the adjacent neighborhood of the respective class. The method restores each pixel by taking into account extracted edge and background pixel based on their respective Lipschitz exponents. The method preserve edges and restores the background by utilizing noisy samples and their smoothness to estimate the best fit. Initially, we defined the deterministic function in terms of the smoothness and mean square error estimation as:  
Figure 6: (**a**) Original Lena image, (**b**) modulus maxima after thresholding, (**c**) histogram of Lipschitz exponents correspond to maxima lines in (**b**).  
Figure 7: (**a**) Original House image, (**b**) modulus maxima after thresholding, (**c**) histogram of Lipschitz exponents correspond to maxima lines in (**b**).  
Thus,  
\[\lambda_{i,j}^{k}=\frac{d^{2}C_{i,j}^{MSE,k}}{dy^{k^{2}}} \tag{17}\]  
and we can simplify the equation to  
\[y_{i,j}^{k+1}=y_{i,j}^{k}+\lambda_{i,j}^{k}(-\frac{\partial C_{i,j}^{MSE}}{ \partial y}) \tag{18}\]  
Similarly by using the Taylor series on the smoothing criteria, \(\gamma_{i,j}^{k}\) is as follows:  
\[\gamma_{i,j}^{k}=\frac{d^{2}C_{i,j}^{MSO,k}}{dy^{k^{2}}} \tag{19}\]  
In order to determine the best estimation of the deterministic function and minimum error between the restored pixel and the original pixel of either background or an edge, the algorithm works in the iterative mode. We assume the least smoothness of the respective pixels for initialization. Two optimization factors, \(w^{M}\) for noisy samples and \(w^{S}\) for smoothness, are introduced (in Equation (10) to investigate the most optimal compromise between the data samples containing noise and their smoothness such that Equation (10) will become:  
\[y_{i,j}^{k+1}=y_{i,j}^{k}+w^{M}\lambda_{i,j}^{k}(-\frac{\partial C_{i,j}^{MSE,k}}{\partial y_{i,j}})+w^{S}\gamma_{i,j}^{k}(-\frac{\partial C_{i,j}^{MSO,k}}{ \partial y_{i,j}}) \tag{20}\]  
Parametric Estimation  
In order to estimate \(w^{M}\) and \(w^{S}\), we can write Equation (20) in the discrete case by simplifying as,  
\[y_{i,j}^{k+1}=y_{i,j}^{k}-4w^{M}(y_{i,j}^{k}-y_{oi,oj})+32w^{S}(y_{adj}^{k}-2 y_{i,j}^{k}) \tag{21}\]  
where \(y_{adj}\) correspond to the adjacent neighbors, The value of \(w^{M}or\,w^{S}\) is dependent on whether the current pixel belongs to the edge or background but, in any case, should satisfy the stability conditions. The term that corresponds to the mean square error in Equation (20) is stable due to the presence of the original noisy pixel, and hence these factors were computed in terms of the smoothness criteria, and Equation (21) can be rewritten as:  
\[y_{i,j}^{k+1}=(1-64w^{S})y_{i,j}^{k}+32w^{S}(y_{adj}^{k}) \tag{22}\]  
The Equation (22), should satisfy the following condition in order to ensure the stability of the signal:  
\[\left\{\begin{array}{c}0<1-64w^{S}<1\\ 0<32w^{S}<1\end{array}\right\}\]  
The stable range to define the constant \(w^{S}\) term in numerical form between 0 to \(\frac{1}{64}\) is obtained by considering the above conditions. Hence, based on these findings, we define two constant factors in term of an equation:  
\[w^{S}+w^{M}=\frac{1}{64} \tag{23}\]  
All pixels were restored individually taking into account the neighbor pixels of the same class. The complete algorithm is given in the Appendix A.