ARTICLE IN PRESS
Signal Processing 88 (2008) 69–74 www.elsevier.com/locate/sigpro
Image denoising via gradient approximation by upwind scheme Rong-Hong Huang, Xiao-Hong Wang College of Science, Nanjing University of Aeronautics & Astronautics, Nanjing 210016, China Received 2 June 2006; received in revised form 23 May 2007; accepted 4 July 2007 Available online 14 July 2007
Abstract A novel hybrid filter based on gradient approximation by upwind scheme is proposed to restore images corrupted by impulsive and Gaussian noises, and simultaneously to preserve the details. In this work, the gradient is approximated by the hybrid upwind scheme, and then the impulses are separated according to the characteristic classification. The remaining pixels are processed by Gaussian filter (GF) with their corresponding weights that are acquired from the hybrid upwind scheme and are distinct in edges and smooth domains. The simulation results demonstrate that the proposed filter achieves better performance in restoring the images corrupted by different noise while the details are preserved. r 2007 Elsevier B.V. All rights reserved. Keywords: Image denoising; Upwind scheme; Gradient; Hybrid filter
1. Introduction Images can be corrupted by various noises when they are acquired, transmitted and processed, therefore, image denoising is essential for the subsequent processing stages. Impulsive and Gaussian noise are two kinds of typical noises, up to now, multifarious approaches have been developed to eliminate them. However, two problems still exist. Firstly, a class of filters can only be used to eliminate one kind of the noises significantly, e.g. the median filters have a good performance in reducing the impulsive noise, but they are poor in reducing the Gaussian noise, while the linear filters can reduce the Gaussian noise well but the impulsive noise poorly. Secondly, preservation of image details while eliminating the image noise is Corresponding author.
E-mail address:
[email protected] (R.-H. Huang).
usually impossible. They are the irreconcilable conflict during the restoration process. While eliminating the noise, the linear filters blur the image details, and the median filters remove the image features such as long, thin lines and bands. To solve the two problems presented above, the linear and median filters are combined to derive novel filers suitable for the mixed noise environment composed of the Gaussian and impulsive noises in the past two decades. A FIR median hybrid filter [1], which is a cascade of linear phase FIR filters and a median filter, has been developed, and extended to a linear median hybrid filter [2]. The median mean neural hybrid filters has been presented in [3]. And some other hybrid filters are presented in [4–6]. However, the quality of image filtering is still not satisfying, especially when there are many image features. In this paper, we propose a novel hybrid filter based on gradient approximation by upwind scheme
0165-1684/$ - see front matter r 2007 Elsevier B.V. All rights reserved. doi:10.1016/j.sigpro.2007.07.004
ARTICLE IN PRESS R.-H. Huang, X.-H. Wang / Signal Processing 88 (2008) 69–74
70
(HFGAU). As we know, the gradient values in edges, noise and smooth domain are distinct. The proposed filter approximates the gradient by the hybrid upwind scheme, and then the impulses are separated according to the characteristic classification. The remaining pixels are processed by Gaussian filter (GF) with their corresponding weights that are acquired from the hybrid upwind scheme. The simulation results demonstrate that the proposed filter has a good noise-reducing ability in the mixed noise environment while the details are preserved. 2. Proposed filter 2.1. Introduction of the hybrid upwind scheme The gradient is an important measure of image features. The gradient value will be small when the domain is smooth and large when the pixel is in edge regions. Upwind scheme is adopted to approximate the gradient in this paper. Assume that X is the noisy image, Xi,j is the current pixel to be processed, D+Xi,j and DXi,j denote the forward and backward finite difference, respectively. Let Dþi X i;j ¼ X iþ1;j X i;j ,
(1)
Di X i;j ¼ X i;j X i1;j ,
(2)
Dþj X i;j ¼ X i;jþ1 X i;j ,
(3)
Dj X i;j ¼ X i;j X i;j1 .
(4)
Then the upwind difference scheme [7] developed by Osher and Sethian [8] is defined as follows:
hybrid diffusive scheme is proposed: 8 0 rþ X i;j ¼ 0 > < or r X i;j ¼ 0 . rX i;j ¼ > : ðrþ X þ r X Þ=2 otherwise i;j i;j (7) The value will be large in edges, small in smooth domain and zero at the corrupted pixel. 2.2. Impulsive noise separation There is still one drawback when the hybrid scheme was used to denoise the image. Some details such as bands, roof edges, and lines will be considered as noise too. So we must decide whether it is an edge pixel or a corrupted one when the r value equals zero. There are three cases when r equals zero: a. r ¼ 0 and r+ ¼ 0 The pixel Xi,j is in the completely homogeneous domain, it should be left unaltered. b. r ¼ 0 and r+40 A four-neighborhood model is introduced. The pixel Xi,j with the adjoined pixels like Fig. 1 is considered as an edge pixel and left unaltered, while the pixel in Fig. 2 is considered as noise and processed by median filter. Then the method for distinguishing the noise is presented as follows: The four items, |max(DiXi,j,0)|, |min(D+iXi,j,0)|, |max(DjXi,j,0)|, |min(D+jXi,j,0)|, denote the differences of Xi,j in four directions respectively.
rþ X i;j ¼ ½maxðDi X i;j ; 0Þ2 þ minðDþi X i;j ; 0Þ2 þ maxðDj X i;j ; 0Þ2 þ minðDþj X i;j ; 0Þ2 1=2 , ð5Þ Fig. 1. Three kinds of pixels, which are considered as edge pixels, with their adjoined pixels.
r X i;j ¼ ½minðDi X i;j ; 0Þ2 þ maxðDþi X i;j ; 0Þ2 þ minðDj X i;j ; 0Þ2 þ maxðDþj X i;j ; 0Þ2 1=2 . ð6Þ According to this scheme, when the impulse is a white pixel or cluster, r+ is positive and r equals zero, when the impulse is a black pixel or cluster, r is positive and r+ equals zero. Consequently, it can only distinguish one kind of noise by utilizing one form of the upwind scheme presented above. Then a
Fig. 2. Two kinds of pixels, which are considered as noise, with their adjoined pixels.
ARTICLE IN PRESS R.-H. Huang, X.-H. Wang / Signal Processing 88 (2008) 69–74
Let D ¼ ½j maxðDi X i;j ; 0Þj; j minðDþi X i;j ; 0Þj j maxðDj X i;j ; 0Þj; j minðDþj X i;j ; 0Þj,
ð8Þ
and D0 ¼ D= maxðDÞ,
(9)
where D is an array whose four elements are the differences of Xi,j in four directions. The integer n is defined as the total amount of the elements in D0 where D0 (i)ph (i ¼ 1,2,3,4), and the threshold h is given beforehand which is relative to the richness of the processed image’s details. Then the noise detection can be described as follows: ( edge pixel n ¼ 2 or n ¼ 3 X i;j ¼ . (10) corrupted pixel otherwise When n ¼ 2 or n ¼ 3, the pixel Xi,j coincide with the phase in Fig. 1, otherwise Xi,j coincide with the phase in Fig. 2. A problem should be pointed out that some of the pixels, whose corresponding n is equal to 4, are not corrupted, but they are considered to be in the smooth domain and are processed by median filter, therefore, the change of these pixels’ value can be ignored. The threshold h is of great importance because it refers to whether the pixel Xi,j would be considered as a corrupted pixel or not. The value of h must range from 0 to 1. When h is small, more pixels will be considered as noise, and when the value of h increases, fewer pixels will be considered corrupted. According to the experiments, the best restoration results are obtained when h is around 0.3. The value of h should be properly larger when the image is rich in details. For the subsequent processing, if the pixel is considered as edge pixel, the r value of this pixel should be updated by rX i;j ¼ ðrþ X i;j þ r X i;j Þ=2,
The idea of Gaussian smoothing is to use this 2-D distribution as a ‘point-spread’ function, and this is achieved by convolution. Since the image is stored as a collection of discrete pixels we need to produce a discrete approximation to the Gaussian function before we can perform the convolution. A suitable integer valued convolution mask that approximates a Gaussian with s2 ¼ 1/2 is adopted here: 2 3 1 2 1 1 6 7 (13) G 33 ¼ 4 2 4 2 5. 16 1 2 1 The purpose of this part is to select the output from the current pixel and the GF. If the current pixel is in edge region, the final output should approach the value of the current pixel. Otherwise, the final output should approach the output of GF. Assume that Yi,j is the final output, Gi,j is the output of the GF. The output Yi,j is represented by Y i;j ¼ ð1 gðrX i;j ÞÞX i;j þ gðrX i;j ÞG i;j .
(14)
Here, the function g is defined by
gðxÞ ¼
x 1þ meanðrX Þ
2 !1 ,
(15)
where mean (rX) denotes the mean of all the pixels’ r values of the image. The function g is to achieve the purpose presented above. When the pixel is in the edge region, its r value is large and g(r) is small, so the final output Yi,j will be close to the value of the current pixel. By contrast, when the pixel is in the smooth region, Yi,j will be close to the output of the GF.
2.4. Structure of the proposed filter
(11)
c. r+ ¼ 0 and r40. The processing manner is similar to the case b. 2.3. Pixel processing based on Gaussian filter An isotropic Gaussian distribution in 2-D has the form: 1 x2 þy2 =2s2 e , (12) 2ps2 where s is the standard deviation of the distribution. Gðx; yÞ ¼
71
The processing procedure includes three main steps. The first step is to calculate the discrete approximation of the gradient via the hybrid upwind scheme as explained in Section 2.1. The second step is to separate the impulsive noise as explained in Section 2.2 based on median filter. If the final processing result still has several impulses, this step can be repeated once again. And the third step is to process the remaining pixels mainly corrupted by Gaussian noise based on GF as explained in Section 2.3.
ARTICLE IN PRESS 72
R.-H. Huang, X.-H. Wang / Signal Processing 88 (2008) 69–74
Fig. 3. The restoration of the noisy board image (200 250) for the impulsive noise density of 10% and Gaussian noise with m ¼ 0, s ¼ 500. (a) Noise-free image, (b) noisy image, (c) ACWM, (d) GF, (e) MMNHF, (f) HFGAU (h ¼ 0.2), (g) HFGAU (h ¼ 0.4)(proposed), (h) pixels treated by median filter, (i) error (i,j) ¼ |P(i,j)–I(i,j)|.
Fig. 4. The restoration of the noisy Barbara image (200 240) for the impulsive noise density of 10% and Gaussian noise with m ¼ 0, s ¼ 500. (a) Noise-free image, (b) noisy image, (c) ACWM, (d) GF, (e) MMNHF, (f) HFGAU (h ¼ 0.2) (proposed), (g) HFGAU (h ¼ 0.4), (h) pixels treated by median filter, (i) error (i,j) ¼ |P(i,j)-I(i,j)|.
ARTICLE IN PRESS R.-H. Huang, X.-H. Wang / Signal Processing 88 (2008) 69–74
In the simulation, the Board and Barbara images were both corrupted by salt–pepper impulse at the noise density of 10%, 20% and Gaussian noise with m ¼ 0, s ¼ 500 and m ¼ 0, s ¼ 600, respectively. To evaluate the performance of the proposed filter, several filters were simulated, such as adaptive center weighted median filter (ACWM) [10], GF [11] and the median mean neural hybrid filter (MMNHF) [3]. The restoration results of the proposed and compared filters for the Board and Barbara image with the impulsive noise at the density of 10% and Gaussian noise with m ¼ 0, s ¼ 500 are illustrated in Figs. 3 and 4. Their respective restoration performances are provided in Tables 1 and 2 in which each Average Runtime is obtained from the average runtime of 10 runs. Since the Board image is rich in details and the Barbara image involved fewer details relatively, we proposed the value of the threshold h 0.4 for the Board image and 0.2 for the Barbara image. To show more information of the processing effect, we also offer the results of error (i,j) ¼ |P(i,j)–I(i,j)| and which pixels are treated by the median filter in the simulation. It can be easily seen from Figs. 3
3. Simulations The simulations are carried out on the 256-level grayscale images, and the original test images are corrupted by additive Gaussian noise and salt– pepper impulses. To implement the HFGAU algorithm, the threshold h mentioned in Section 2.2 should be predetermined. According to the experiments, the best restoration results are obtained when h is around 0.3. Peak signal to noise ratio (PSNR) [9] is used to quantitatively evaluate the restoration performance, which is defined as 2552 PSNR ¼ 10 log10 , (16) MSE where mean square error(MSE) is defined as MSE ¼
M X N 1 X ðPm;n I m;n Þ2 , M N m¼1 n¼1
73
(17)
where Im,n and Pm,n denote the original image pixels and the restored image pixels, respectively, and M N is the size of the image.
Table 1 Comparison of the restoration performances in PSNR and average runtimes for the Board test image Methods
Corrupted ACWM GF MMNHF HFGAU (h ¼ 0.2) HFGAU (h ¼ 0.4) (proposed)
Noise salt-pepper: 10% (density) Gaussian noise: m ¼ 0, s ¼ 500 MSE
PSNR
2705.1 1351.7 2105.6 1899.2 1230.3 1088.5
13.8089 16.8219 14.8970 15.3451 17.2307 17.7625
Average runtime (10 times) – 13.0250 0.0520 5.2790 1.7210 1.7230
Noise salt-pepper: 20% (density) Gaussian noise: m ¼ 0, s ¼ 600 MSE
PSNR
4912.1 2163.7 2650.8 2369.9 1882.8 1692.5
11.2181 14.7788 13.8970 14.3835 15.3828 15.8455
Average runtime (10 times) – 13.1330 0.0520 5.3010 1.7920 1.7930
Table 2 Comparison of the restoration performances in PSNR and average runtimes for the Barbara test image Methods
Corrupted ACWM GF MMNHF HFGAU (h ¼ 0.2) (proposed) HFGAU (h ¼ 0.4)
Noise salt-pepper: 10% (density) Gaussian noise: m ¼ 0, s ¼ 500 MSE
PSNR
2150.2 395.9655 507.7932 371.2465 324.6600
14.8060 22.1542 21.0739 22.4342 23.0165
353.4049
22.6481
Average runtime (10 times)
Noise salt-pepper: 20% (density) Gaussian noise: m ¼ 0, s ¼ 600
Average runtime (10 times)
MSE
PSNR
– 17.0940 0.0600 6.8400 2.2130
3958.6 798.6809 856.9852 585.6757 503.7876
12.1553 19.1071 18.8011 20.4542 21.1083
– 16.8640 0.0560 6.8500 2.3540
2.2630
577.2263
20.5173
2.3030
ARTICLE IN PRESS 74
R.-H. Huang, X.-H. Wang / Signal Processing 88 (2008) 69–74
and 4 that the visual effects of HFGAU are more satisfying than the other filters especially at the edge domain like bands, lines, and roof edges. As seen in Tables 1 and 2, the proposed filter also has a better restoration performance and the average runtime that is an important measure of computational complexity is endurable too.
4. Conclusion In this paper, a novel hybrid filter based on gradient approximation by upwind scheme is proposed. The gradient is approximated by hybrid upwind scheme, and according to the properties of this scheme, the impulsive noise are distinguished and removed. Then the remaining pixels are processed by the approach based on GF as explained in 2.3. The proposed filter is suitable for the processing of images that contain many details and are not corrupted badly. The effect will trail off when the noise density or the noise variance increases. Compared with the other filters, the proposed filter has the stronger ability to preserve details while eliminating the noise.
References [1] P. Heinonen, Y. Neuvo, FIR-median hybrid filters, IEEE Trans. ASSP 35 (1987) 832–833. [2] J. Astola, P. Heinonen, Y. Neuvo, Linear median hybrid filters, IEEE Trans. CAS 36 (1989) 1430–1438. [3] M. Muneyasu, K. Hotta, T. Hinamoto, A. Taguchi, Edgepreserving smoothing using median mean neural hybrid filters, J. Franklin Inst. 335 (1998) 1145–1156. [4] R. Fried, T. Bernholt, U. Gather, Repeated median and hybrid filters, Comput. Stat. Data Anal. 50 (2006) 2313–2338. [5] T.X. Zheng, A.A. Girgis, E.B. Makram, A hybrid waveletKalman filter method for load forecasting, Electric Power Syst. Res. 54 (2000) 11–17. [6] F. Russo, Hybrid neuro-fuzzy filter for impulse noise removal, Pattern Recogn. 32 (1999) 1843–1855. [7] Y.M. Chen, B.C. Vemuri, Image denoising and segmentation via nonlinear diffusion, Comput. Math. Appl. 39 (2000) 131–149 (HYBRID). [8] S.J. Osher, J.A. Sethian, Fronts propagation with curvature dependent speed: algorithms based on Hamilton-Jacobi formulations, J. Comput. Phys. 79 (1988) 12–49. [9] E. Bes-dok, M. Emin Yu¨ksel, Impulsive noise suppression from images with Jarque-Bera test based median filter, AEU Int. J. Electron. Commun. 59 (2005) 105–110. [10] T. Chen, H.R. Wu, Adaptive impulse detection using center weighted median filters, IEEE Signal Process. Lett. 8 (2001) 1–3. [11] R.C. Gonzalez, R.E. Woods, Digital Image Processing, second ed, Publishing House of Electronics Industry, Beijing, 2002, pp. 220–281.