# An Improved Image Filtering Algorithm for Mixed Noise
## 2 The Filtering Algorithm for Mixed Noise with Salt and Pepper + Gaussian Noise
### The Improved Wavelet Threshold Denoising Algorithm
#### 2.2.1 The Theory of Wavelet Threshold Denoising  
Wavelet transform is a linear operation. After wavelet transform, the wavelet coefficients of noise image are equal to the sum of wavelet coefficients of the original image and the wavelet coefficients of noise. Separating noise means removing the wavelet coefficients of noise and retaining the wavelet coefficients of the original image in the wavelet domain.  
After multi-scale wavelet decomposition, the wavelet coefficients of effective information of the image and the wavelet coefficients of noise have different characteristics. The part of low-frequency is wavelet approximation; the part of high-frequency is wavelet details. The effective information of image is mainly distributed in wavelet approximation; the high-frequency part mainly contains image edge and noise. The effective information of image is mainly concentrated in larger wavelet coefficients, while noise is mainly concentrated in smaller wavelet coefficients. With the increase of wavelet decomposition scale, the wavelet coefficients of the effective signal of the image become increasing larger, while the wavelet coefficients of noise information become increasing smaller. Therefore, the wavelet coefficients of the image between effective information and noise information tend to separate after repeated decomposition. According to this principle, image signal and noise signal can be separated.  
Therefore, the process of wavelet threshold denoising can be summarized as follows: first decompose the original image with appropriate wavelet basis, and then select a proper threshold value to deal with noise, and finally reconstruct the wavelet coefficients to obtain an ideal denoised image.  
It is very important to construct an appropriate threshold function and select a proper threshold. The threshold function commonly used is the one proposed by [PERSON]; the hard threshold function [12] and the soft threshold function [13] are shown in Formulas (4) and (5), respectively.  
\[\widetilde{W}_{j,k}=\left\{\begin{array}{cc}W_{j,k}\,,&\left|W_{j,k}\right| \geq\lambda\\ 0,&\left|W_{j,k}\right|<\lambda\end{array}\right. \tag{4}\]  
\[\widetilde{W}_{j,k}=\left\{\begin{array}{cc}sign(W_{j,k})\Big{(}\left|W_{j, k}\right|-\lambda\Big{)},&\left|W_{j,k}\right|\geq\lambda\\ 0,&\left|W_{j,k}\right|<\lambda\end{array}\right. \tag{5}\]  
where \(W_{j,k}\) is the \(k\)-th wavelet coefficient under the \(j\)-th scale of noise image after wavelet decomposition; \(\widetilde{W}_{j,k}\) is the wavelet coefficients obtained through threshold processing; \(\lambda\) is the threshold selected by the algorithm; and \(sign\) is the symbolic function.  
When \(\left|W_{j,k}\right|\geq\lambda\), the hard threshold function will not compress the wavelet coefficients, so the edges and details of the image will be preserved. When \(\left|W_{j,k}\right|=\lambda\), the discontinuity of the function will distort the restored image. The soft threshold functionis continuous when \(\left|W_{j,k}\right|=\lambda\), and the image is smoother after threshold processing. When \(\left|W_{j,k}\right|\geq\lambda\), the wavelet coefficients will shrink to zero. There is a constant deviation between the estimated wavelet coefficients and the real wavelet coefficients, resulting in the blurred edge of the reconstructed image. Both the threshold functions can result in the loss of details and some important features of image.