A Digital Image Denoising Algorithm Based on Gaussian Filtering and Bilateral Filtering

Bilateral filtering has been applied in the area of digital image processing widely, but in the high gradient region of the image, bilateral filtering may generate staircase effect. Bilateral filtering can be regarded as one particular form of local mode filtering, according to above analysis, an mixed image de-noising algorithm is proposed based on Gaussian filter and bilateral filtering. First of all, it uses Gaussian filter to filtrate the noise image and get the reference image, then to take both the reference image and noise image as the input for range kernel function of bilateral filter. The reference image can provide the image’s low frequency information, and noise image can provide image’s high frequency information. Through the competitive experiment on both the method in this paper and traditional bilateral filtering, the experimental result showed that the mixed de-noising algorithm can effectively overcome staircase effect, and the filtrated image was more smooth, its textural features was also more close to the original image, and it can achieve higher PSNR value, but the amount of calculation of above two algorithms are basically the same.


Introduction
Image shall be such a very important information carrier, but during the process of image forming, transmitting and receiving, due to the existence of various interference factors, it may systematically introduce certain noise, and some detailed features may also be submerged in noise, this shall bring great difficulty on subsequent image processing procedure. To adopt proper method to eliminate the pollution noise in image shall be a very important preprocessing procedure.
The noise in image was usually eliminated by filtering method. The non-linear filtering technique can protect the edge of image while eliminating the noise, such as bilateral filtering [1]. Bilateral filtering shall be the non-linear filtering technique in spatial domain, same as the classical Gaussian filter, bilateral filtering do also utilize the spatial distance information (geometric distance) among the pixels in neighborhood for locally weighted average, the difference between these two methods is that, bilateral filtering do also utilize the grey similarity information of the pixels in neighborhood, this enables such algorithm maintaining the edge of image quite well, and effectively smoothing Gaussian noise. Due to the simple, non-iterative and local characteristics of bilateral filtering, it then has been widely applied in image processing accordingly [2][3][4][5].
In practical application, it found that in the high gradient region of grey value, there's the "staircase effect" with bilateral filter, that the grey value in such region of original image is smoothly changed, after the bilateral filter treatment on its noise image, the grey value in such region can be changed like ladder. In addition, while the noise variance is quite big, the de-noising effect of bilateral filtering shall not be quite ideal.
In order to solve such problem and improve the de-noising effect of bilateral filter, there are many scholars proposed some improved algorithms. Choudhury et al proposed the trilateral filter [6], the trilateral filter can achieve quite smooth image but with quite large calculation amount. Yu Bo proposed the bilateral filtering algorithm with controllable kernel function [7]. Eisemann, Petschnigg et al proposed the joint bilateral filter [8.9], Laurent et al proposed guided bilateral filter [10], Ba T et al proposed semi-guided bilateral filter [11], but the joint bilateral filter, guided bilateral filter and semi-guided bilateral filter may only need the guiding image in high quality to achieve quite good de-noising effect, but it's very hard to estimate the guiding image in high quality from noise image [12].
According to the grey value of pixels in neighborhood bilateral filter can allocate the weight value accordingly. In the neighborhood, if the grey value of a certain pixel is more closer to the central point, its weight value shall be bigger then. While there's Gaussian noise in the image, the observed grey value of each pixel shall deviate from the original real grey value of such point, and fluctuate around the real grey value accordingly, the bigger noise variance, the more obvious deviation it may have accordingly. By taking the grey value of central point as reference datum, it may cause the fluctuation of reference datum accordingly. In the high gradiant region of image, such fluctuation shall be more obvious, bilateral filter may regard such kind of edge as the ladder-shaped edge incorrectly, so as to generate the "staircase effect".
From above analysis it can be seen that, the reason of bilateral filter generating the "staircase effect" shall be that it takes the grey value of central point as reference datum and does not fully utilize the characteristic of white Gaussian noise -"zero-mean". in order to solve such problem existed in bilateral filtering, in this paper such a mixed de-noising algorithm based on both the Gaussian filter and bilateral filtering is proposed. In such mixed de-noising algorithm, the input for range kernel function of bilateral filtering can be determined by reference image and noise image mutually. In this paper, it first introduces the principle of such mixed de-noising algorithm, then compares the de-noising effect of both the mixed de-noising algorithm and bilateral filtering through experiment.

Basic principle of mixed de-noising algorithm
In digital system, the additive white Gaussian noise is a common noise type. To assume that through a degradation process, it can get the observed signal I from the original "true" signal X, the degradation process means to add the white Gaussian noise V with zero mean into X, then the observed signal I can be expressed as below, The purpose of filtering is to recover the original signal X from the observed signal I. Bilateral filtering can be regarded as such a particular form of local mode filtering [13]. the local mode filtering can be came down to a minimization problem, as shown in equation (2), In equation (2), p, q represents the pixels, S p represents the neighborhood of pixel p, I p , I q represent the grey value of the signal (image) at pixels p, q, X p represents the grey value of pixel p that need to be solved, ||p-q|| represent the Euclidean distance between point p and point q. h(·) represents the weight function of 2-dimensional linear phase filter, its expression can usually be Gaussian function. ρ(·) is error norm. In order to solve equation (2), it can differentiate the equation (2) to get equation (3), , and substitute it into equation (3), then get the equation (4), By simplifying equation (4), to get equation (5), Equation (5) is the filtering Equation of local mode filtering, W p represents the normalization coefficient of filtering formula. If h(·) and δ(·) are taken as Gaussian functions, the equation (5) can be expressed with equation (6), In equation (6), G σs (·) represents the Gaussian function with the standard deviatio as σ s , it's so called as spatial kernel function, G σr (·) represents the Gaussian function with standard deviation as σ r , it's so called as range kernel function, σ s and σ r can respectively determine the expansion degree of spatial kernel function and range kernel function. In order to solve equation (6), it then can rewrite equation (6) into equation (7), In equation (7), t=1,2,3,... in order to solve equation (7), it may need to estimate the initial value of X p (1) , one of the most simple methods is to let X p (1) =I p , then to perform iterative computation only once. At this time, equation (7) can be converted into standard bilateral filtering equation, thus bilateral filtering shall be such a special solution for local mode filtering, it can also be regarded such a special form of local mode filtering. From the analysis in previous paragraph it can be seen that, bilateral filtering does not fully utilize the characteristic of white Gaussian noise in "zero mean", thus it can not be the optimal solution of local mode filtering at all. The de-noising effect of local mode filtering does relate to the value of σ r parameter closely. When σ r has quite small value, the local mode filtering shall have better edge maintaining effect accordingly, but it can easily converge to local extreme point, and its denosing effect may also become bad; along with the raised σ r value, the local mode filtering may gradually approach to global extreme point with enhanced de-noising effect, but the edge maintaining effect may become bad accordingly; while σ r value tended to infinity, the local mode filter will then turn into Gaussian filter. From above analysis it can be seen that, to avoid filtering equation converging so quickly to local extreme point can effectively improve the de-noising effect of local mode filtering. Based on such analysis, in this paper a mixed de-noising algorithm based on both the Gaussian filter and bilateral filtering is proposed. First of all it uses Gaussian filter to filtrate noise image, then takes the image treated with Gaussian filter as reference image and input it into bilateral filter, then to take both of reference image and noise image as the input for range kernel function of bilateral filter. The reference image provides the low frequency information of image, and noise image provides the high frequency information of image. Due to the existence of reference image, the mixed de-noising algorithm can more effectively utilize the characteristics of white Gaussian noise-"zero mean", thus it then can better eliminate white Gaussian noise.

Selection of parameters of σ s and σ r
The performance of bilateral filter is mainly determined byσ s and σ r parameter, the bigger σ s parameter, the higher degree of smoothness in the image, and there would be more textural features have been smoothed out. In comparison with them, σ r parameter shall have more obvious influence on filtering effect, and σ r can control the smoothness and edge maintaining ability of bilateral filter at the same time. The less σ r parameter, the better edge maintaining effect the bilateral filtering may get, but its de-noising effect may become bad; the bigger σ r parameter, the better de-noising effect bilateral filtering may have, but its edge maintaining effect may become poor accordingly.
C.Liu has studied the relation between σ r parameter and noise variance σ n 2 [14] , when σ s =3, σ r =1.95σ n , bilateral filtering may have quite good de-noising effect.
In this paper, the given value of σ s , σ r parameters in the algorithm are different from normal bilateral filtering. The effect of Gaussian filter is to mainly eliminate the noise and achieve the "zero mean" of white Gaussian noise. The bigger given value for standard deviation of Gaussian function shall be beneficial for eliminating noise, but the bigger σ s parameter value, the more obscure edge the image may have, and it may also lower the PSNR accordingly. In order to reduce the obscure degree of the edge, the given value of σ s parameter should be quite small, but too small value may be hard to effectively eliminate noise, through several experiments, it was found that when σ s =1 the effect was quite good and it then got the better balance between de-noising and edge maintaining.
For the given value of σ s parameter in Gaussian filter, thus it cannot effectively eliminate noise at all, it may need subsequent bilateral filter to further eliminate noise and protect image's edge. In mixed de-noising algorithm, the effect of reference image is to act as the "zero mean" of white Gaussian noise. For the white Gaussian noise in reference image is lower than that in noise image, thus the given value of σ s parameter in bilateral filter can be smaller than that in general bilateral filter, thus it can be beneficial for achieving better edge maintaining effect and to offset the loss in high frequency caused by Gaussian filter to the certain extent.
Through several experimental validation, while σ s =1 in Gaussian filter, and σ s = 3 in bilateral filter, and both the σ r parameter in bilateral filter and noise variance σ n 2 meet the relation in equation (8), it can achieve very good de-noising effect on most images, and the image's PSNR value after filtration was also quite high. In equation (8), the value range of σ n parameter can be within 10-40.

Experiments
In this section, it compares the de-noising effects of mixed filtering algorithm and bilateral filtering on white Gaussian noise, and uses imnoise function in Matlab to add white Gaussian noise in the image. In this paper, it uses the peak signal-to-noise ratio (PSNR) value to evaluate image's quality, the definition of PSNR is shown in equation (9), In equation (9) M, N represent the size of images, I(i,j) is original image, X(i,j) is the filtered image, L is the dynamic range of image grey value, the L value of 8-bit image is usually set as 255. In this paper, the grey level of grey image is 8bit with resolution as 512×512.
The template size of Gaussian filter is 3×3 and σ s =1. The template size of bilateral filter in the mixed algorithm is 15×15, σ s =3, σ r parameter value is set as specified in equation (8). The template size of bilateral filter is 15×15, σ s =3, σ r =1.95σ n .   figure 1 it can be seen that, in comparison with bilateral filtering, the image treated by the mixed de-noising algorithm was more smooth, and the textural features of the image was more closed to original image, for the edge maintaining effect, the two algorithms basically maintained the equal level. Figure 2 is the one-dimensional horizontal gray section of the original pepper image and the filted image (the white underlined part in figure 1).

Fig. 2. One dimension horizontal gray level profile of pepper image
From figure 2 it can be seen that, in comparison with bilateral filtering, the image treated with the mixed de-noising algorithm was more smooth. In the section of 210-240 at the horizontal ordinate, the grey value of original image was changed smoothly, bilateral filtering did not have the good effect for processing such kind of edge, and there occurred the obvious "staircase effect", but the mixed de-noising algorithm did have quite good effect for processing such edge. In the section of 190-200 at the horizontal ordinate, there's the mutation in grey value of original image, the mixed de-noising algorithm did basically have the same processing effect on such edge as well as that of bilateral filtering. Table 1 shows the comparison on the PSNR value of pepper image processed by mixed de-noising algorithm and bilateral filtering respectively under different noise variance conditions. It can be seen that, while the noise variance was quite small, in comparison with bilateral filtering, the mixed de-noising algorithm did not have the obvious advantage, but along with the enlarged noise variance, the PSNR value of the image processed by the mixed de-noising algorithm was obviously higher than that processed by bilateral filtering.  is the image with added white Gaussian noise in σ n =20, (c), (d) are the images processed by mixed de-noising algorithm and bilateral filtering respectively. Similar with figure 1, in comparison with bilateral filtering, the mixed de-noising algorithm did retain more textural features of the image while eliminating the noise, the image after filtration was more closer to the original image.
(a) Lena image (b) with noise of σ n =20 (c) filtered by mixed denoising (d) filtered by bilateral filtering  Table 2 shows the comparison on the PSNR value of Lena image processed by mixed de-noising algorithm and bilateral filtering respectively under different noise variance conditions. From table 2 it can be seen that, the PSNR value of Lena image processed by mixed de-noising algorithm was obviously higher than that processed by bilateral filtering, its advantage was more obvious than that of pepper image. In addition, the comparative experiments were also carried out on many other images, the results showed that the mixed de-noising algorithm were always better than bilateral filtering. Gaussian filter can be realized by frequency domain fast algorithm, in comparison with bilateral filtering, its calculation amount can be basically ignored, thus the calculation amount of mixed de-noising algorithm was basically the same as the traditional bilateral filtering. Experimental results showed that the two methods did spent the basically same time to process the same image. From experimental results it can be seen that, the denoising effect of the mixed de-noising algorithm proposed in this paper on Gaussian noise was obviously better than that of bilateral filtering, But because Gaussian filter has been carried out, thus there may be some losses in the high frequency information of the image, it shall be a defect of mixed de-noising algorithm.
In this paper, a mixed de-noising algorithm based on both Gaussian filter and bilateral filtering is proposed. In comparison with routine bilateral filtering algorithm, the mixed denoising algorithm did more effectively utilize the characteristics of white Gaussian noise with "zero mean", while eliminating the noise it can select quite smaller σ r parameter, according to the experimental results, in comparison with bilateral filtering, the image treated with mixed de-noising algorithm was more smooth with more natural shading effect, its textural feature is more closer to original image, and such method can get even higher PSNR value. The mixed de-noising algorithm inherited the local and non-iterative characteristics of bilateral filtering, its calculation amount only had a little bit increase in comparison with bilateral filtering, and its de-noising effect was obviously better than that of bilateral filtering, thus such method can be expected to be widely used then.