1€¦ · Web viewThere are many different filtering algorithms for the noise removal, following...

10
Denoising of Images – a Comparison of Different Filtering Approaches PIOTR BOJARCZAK 1 , STANISLAW OSOWSKI 2 1 Department of Automatics and Telematics of Transport Radom University of Technology Ul.Malczewskiego 29, 26-600 Radom POLAND 2 Department of Theory of Electrical Engineering, Measurement and Information Systems Warsaw University of Technology Pl. Politechniki 1, 00-661Warsaw POLAND Abstract: The paper will compare different filtering techniques for reduction of noise that don’t need to know in advance the spectral properties of the data. They will be based either on the averaging techniques (low-pass mean and median filter) or on the application of the compression/decompression of the noisy data. Key-Words: denoising, wavelet transform, PCA network, low-pass mean filter, median filter 1 Introduction The elimination or reduction of the noise is an important subject in such areas as medicine, sonar or radar imaging, since practical digital images are often degraded to some extent and need to be restored to improve their quality [2,3,11]. There are many different filtering algorithms for the noise removal, following from the Wiener or Kalman filter theory [1]. However to get good results of filtering using these methods we have to know in advance the spectral properties of the noise free data and the noise itself. The other methods rely on different kinds of filtering of the data [3,7,10,11,12] without any special knowledge of the noise. The paper will compare different filtering techniques for reduction of random noise that don’t need to know in

Transcript of 1€¦ · Web viewThere are many different filtering algorithms for the noise removal, following...

Page 1: 1€¦ · Web viewThere are many different filtering algorithms for the noise removal, following from the Wiener or Kalman filter theory [1]. However to get good results of filtering

Denoising of Images – a Comparison of Different Filtering Approaches

PIOTR BOJARCZAK1, STANISLAW OSOWSKI2

1Department of Automatics and Telematics of TransportRadom University of Technology

Ul.Malczewskiego 29, 26-600 RadomPOLAND

2Department of Theory of Electrical Engineering, Measurement and Information Systems

Warsaw University of Technology Pl. Politechniki 1, 00-661Warsaw

POLAND

Abstract: The paper will compare different filtering techniques for reduction of noise that don’t need to know in advance the spectral properties of the data. They will be based either on the averaging techniques (low-pass mean and median filter) or on the application of the compression/decompression of the noisy data.

Key-Words: denoising, wavelet transform, PCA network, low-pass mean filter, median filter

1 IntroductionThe elimination or reduction of the noise is an important subject in such areas as medicine, sonar or radar imaging, since practical digital images are often degraded to some extent and need to be restored to improve their quality [2,3,11]. There are many different filtering algorithms for the noise removal, following from the Wiener or Kalman filter theory [1]. However to get good results of filtering using these methods we have to know in advance the spectral properties of the noise free data and the noise itself. The other methods rely on different kinds of filtering of the data [3,7,10,11,12] without any special knowledge of the noise.The paper will compare different filtering techniques for reduction of random noise that don’t need to know in advance the spectral properties of the data. They will be based either on the averaging techniques (low-pass

mean filter, median filter) or on the application of the compression and decompression

2 Filtering techniques based on averaging

2.1 Low-pass mean filteringBecause of the simplicity this method is very often used. The spatial low-pass filter uses the averaging operator defined in some neighborhood of the considered pixel [2,3]. By limiting ourselves to the constant elements of the mask we can define the averaging operator in a neighborhood by the matrix h

(1)

(reconstruction) of the noisy data (principal component analysis, wavelet transform).

In the filtering process the transformed intensity of the pixel in (m, n) position of the image is calculated as the 2-dimensional

Page 2: 1€¦ · Web viewThere are many different filtering algorithms for the noise removal, following from the Wiener or Kalman filter theory [1]. However to get good results of filtering

convolution of the original image and the averaging operator h, i.e.,.

(2)The mask is moved to the next pixel location in the image and the calculating process is repeated until the mask reaches the end of the image. Thanks to the shape of the frequency characteristics, the filter removes higher frequency components, which correspond to the small details of the processing image including also the noise.

2.1 Median filtersThe main drawback of the previous filter is the blurring process accompanying filtering. Some improvement of averaging may be obtained by applying the median filtering. The median filter considers each pixel in the image in turn and looks at its nearby neighbors to decide whether or not it is representative of its surroundings [2,14]. Instead of simply replacing the pixel value with the mean of neighbor’s pixel values, it is replaced with the median of those values. The median is calculated by first sorting all the pixel values from the surrounding neighborhood into numerical order and then replacing the pixel under consideration with the middle pixel value. It turns out that this method is particularly effective when the noise consists of strong spike-like components (known as salt and pepper noise).

3 Filtering methods based on lossy compression Let fn and rn denote the sample sequences composed of n independent samples of the image function f and random variable r, respectively. These sequences can be mathematically presented as

and

. Let

denotes the sequence of data fn

corrupted with noise, characterized by the vector rn. Let us introduce the notion of strength of the noise, understood here as the norm .

The elimination of noise is achieved in the algorithm through the lossy compression and then decompression of the noisy signal [7]. At high compression ratio Kr the noise introduced by coding/decoding plus additional random noise contaminating the data is relatively high. At small compression ratio both signal and noise are passing through the filter almost unchanged and no effect of filtering is observed. To obtain good results of noise elimination we have to find some compromise point, at which the attenuation of noise is high enough and coding/decoding error is on the acceptable level. This is the breaking point of the rate - distortion characteristics, corresponding to the PSNR value equal to the strength value of the noise, corrupting the data. Knowing the value of the noise strength it is enough to adjust the compression ratio corresponding to this value.

3.1 Principal component analysis approach to the noise reductionThe principal component analysis (PCA) is the statistical method defining the linear transformation of the form [9]y=Wx (3)transforming the stationary stochastic data

into the vector using the matrix in such a way that the output space y of the reduced dimension K<N preserves the most important information of the input space x. Let x be the random vector of zero mean and Rxx – the correlation matrix of all vectors xi, that is Rxx=E[xxT]. The correlation matrix is symmetrical and non-negative definite. It means that all eigenvalues of Rxx are real and non-negative. Let the orthogonal eigenvectors associated with be denoted by wi. We arrange the eigenvalues in decreasing order, i.e,  and in similar way the eigenvectors wi associated with them. According to the eigen-decomposition principle the correlation matrix Rxx can be reconstructed as follows

(4)

Page 3: 1€¦ · Web viewThere are many different filtering algorithms for the noise removal, following from the Wiener or Kalman filter theory [1]. However to get good results of filtering

At orthogonal vectors wi their contribution to the correlation matrix is measured by the value of the corresponding eigenvalues . In most of the practically important cases only small fraction of eigenvalues are large enough to contribute significantly to the reconstruction of Rxx. The eigenvalues corresponding to the random noise have uniformly decreasing magnitudes of usually negligible importance. The smallest magnitude eigenvalues as well as the eigenvectors associated with them can be discarded. Therefore instead of N eigenvalues we can use in equation (4) only K the most important, with K<N. In this way the PCA transformation matrix W can be simplified to

. The reconstruction of the original vector x, denoted here by , is described by the relation [1,5]

(5)Neural networks are usually utilized to calculate eigenvectors and eigenvalues. To the most known neural algorithms of PCA belong APEX of Kung and algorithms of Oja and Sanger [3,5].Application of PCA approach to the noise reduction of the image consists of division of the whole image into the frames. Each frame is transformed to the individual vector x processed according to the procedure described above. In our experiments we have used the

frame resulting in 64-dimensional vector x.

3.2 Wavelet approach to the noise reductionThe wavelet transform decomposes the analyzed function on finite lasting components (t) called wavelets [4,5]. The continuous-time wavelet transform (CWT) of the function f(t) generates CWT coefficients W(a,b) according to the relation:

(6)

where: is a wavelet

function of time scale (dilation) equal a and time shift (translation) described by b, and

denotes

complex conjugation. For a=1 and b=0 1,0(t) = (t) is called the mother wavelet. The wavelet transformation is reversible and the original function can be reconstructed on the basis of the values of W(a,b) coefficients [4,5,13].It turns out that it is not necessary to take into account all possible values of variables a and b. Instead it is possible to choose finite set of their values satisfying following conditions: a = 2k, b = 2kn where k and n are integer (dyadic series). In this case the original function f(t) can be represented as the superposition of dilated and translated wavelets with the weights d(k,n) denoting the discrete wavelet transform (DWT) coefficients

(7)The values d(k,n) are the discrete versions of W(a,b) at a = 2k and b = 2kn. Formula (7) may be treated as the inverse discrete-time wavelet transform and the coefficients d(k,n) form the discrete wavelet transform representation. DWT can continuously split the given original function f(t) into two parts: f0(t) corresponding to the coarser approximation of f(t) and g0(t) corresponding to the high frequency detail function, defined as the difference between f(t) and its approximated version. The approximated version f0(t) can be further split into two parts – the coarser approximation f1(t) and the detail part g1(t). This process can be continuously performed up to some assumed level.The discrete wavelet transform can be obtained very efficiently by applying the so called Mallat pyramid algorithm [4] and application of two orthogonal (or biorthogonal) quadrature low-pass and high-pass filters. Different wavelet bases result in different forms of filters. According to Mallat algorithm the low-pass and high-pass filterings are performed step by step producing respectively, the coarse approximation of the function and the coefficients containing high frequency details. In the case of 2-dimensional images in each step the wavelet decomposition is performed twice: first on the rows of the image and then on its columns. Thanks to this the 1-dimensional wavelet decomposition technique can be easily adapted for the image analysis.

Page 4: 1€¦ · Web viewThere are many different filtering algorithms for the noise removal, following from the Wiener or Kalman filter theory [1]. However to get good results of filtering

Wavelet transform is able to separate the useful signal and the noise. DWT accumulates the energy in small number of DWT coefficients having large amplitudes and it spreads the energy of the noise over a large number of DWT coefficients having small amplitudes. Therefore denoising process consists in simply removing DWT coefficients whose amplitudes are smaller than some assumed threshold value [4].

5 Simulation results In order to compare the presented above de-

noising methods the appropriate program in Matlab environment was written. The program allows us to incorporate different types and levels of the noise. Two of them have been checked in practice: the ‘salt and pepper’ and Gaussian type noise. The noisy images undergo filtering processing by using different kind of filters: the mean low pass filtering, the median filtering and the filtering based on the PCA and DWT. Filtering by the low pass and median filters have been carried out at the different sizes of the masks. The investigations of the PCA and DWT filtering methods have aimed at checking the influence of the number of cut coefficients for the quality of the de-noised image.

Fig.1 presents one of the original images taking part in experiments. The image has been then made noisy by applying the ‘salt and pepper’ and Gaussian noise

Fig. 1 The original image and its histogram

Fig. 2 presents the image corrupted by ‘salt and pepper’ noise (Fig. 2a) and Gaussian noise (Fig. 2b).

a)

b)Fig. 2 The noisy image corrupted by ‘’salt and pepper’ of density 0.14 (a) and Gaussian (b) noise of the variance 0.04

Especially difficult is the Gaussian type noise, deforming the histogram of the image completely.In the case of ‘salt and pepper’ noise the absolutely uncompetitive was the median filter. Fig. 3 shows the results of different filtering types of this noise in the form of PSNR (Peak-Signal-to-Noise Ratio) of the filtered image. Fig. 3a and b represent the averaging low-pass filtering. The x-axis means the size of the mask (the number of pixels in the neighborhood). The best results correspond to 25 pixels for low-pass mean filter and 9 pixels for median filter.Fig.3c and d show the dependence of PSNR value of the filtered image on the number of principal components of PCA filter (Fig. 3c) and the percentage number of remaining wavelet detailed coefficients at the application of 3 level wavelet transformation.

Page 5: 1€¦ · Web viewThere are many different filtering algorithms for the noise removal, following from the Wiener or Kalman filter theory [1]. However to get good results of filtering

Fig. 3 The PSNR values of the filtered image at different kinds of filters: a) the low-pass mean filter, b) median filter, c) PCA filter, d) wavelet filter for ‘salt and pepper’ noise

It is evident that in the case of median filtering the quality of the filtered image is almost 5dB better than in the other cases.The situation is not so evident for Gaussian type noise. In this case the efficiency of filtering of different type filters is comparable. Fig. 4 presents the summary of investigations of these four filtering methods in the form of PSNR, similarly to the case of ‘salt and pepper’ noise.

Fig. 4 The PSNR values of the filtered image at different kinds of filters: a) the low-pass mean filter, b) median filter, c) PCA filter, d) wavelet filter at the Gaussian type noise

For the Gaussian type corruption of the image at the variance of 0.04, the highest possible level of PSNR of the filtered image in each case is similar and is close to 22dB (5 dB lower in comparison to ‘salt and pepper’ noise). At increased level of noise we observe some advantage of the wavelet type de-noising. Table 1 presents the dependence of the best obtained PSNR value on the noise variance for different types of filters.

Table 1 Dependence of the PSNR value on the noise variance of the Gaussian noiseVarian

ofnoise (dB)

PSNR valueLow-pass

mean filter

Median filter

PCA filter

Wavelet filter

0.01 24.984 25.024 24.812 24.6420.04 22.103 21.724 22.411 22.0830.08 20.852 20.164 21.025 21.1660.1 20.323 19.708 20.513 20.7720.15 19.267 18.880 19.612 19.9090.2 18.542 18.161 18.795 19.225

At low noise the best results were due to the median filter. At higher noise variance the wavelet filter was the best. Almost in all operation regions, except the starting point of very low noise variance, the lossy compression/decompression techniques produced better quality results. On the other side the median filter performance was the worst.

Fig.6 Image after processing by the median filter (the size of the mask 9) at ‘salt and pepper’ noise of density 0.14. PSNR = 26.8241

It is interesting to compare the reconstructed images for both types of noise. In the case of

Page 6: 1€¦ · Web viewThere are many different filtering algorithms for the noise removal, following from the Wiener or Kalman filter theory [1]. However to get good results of filtering

‘salt and pepper’ noise the reconstructed image (Fig. 6) was almost ideal (PSNR=26.82 db) and the histogram closely resembling the original one.

Fig.7 Image after processing by the PCA Filter (5 principal components ) at Gaussian noise of variance 0.04. PSNR = 22.411

For Gaussian type noise the best filtering technique was wavelet filter. However the reconstructed image in this case was far from ideal quality (Fig. 7). The PSNR value of the reconstructed image was this time equal 22.41 dB and the histogram shape far from original.

6 Conclusions The process of filtering the noise of unknown spectral properties, corrupting the image, belongs to difficult tasks. The paper has presented and compared four different approaches to the solution of this problem. It has compared the results of filtering the noise, belonging to two types: the ‘salt and pepper’ and Gaussian. Different variances of the noise have been investigated. Two groups of filtering have been compared. The first relies on the averaging operations, and applies either mean or median filters. The second approach uses more complex idea, based on compression/decompression technique and applies in practice the principal component analysis or wavelet decomposition.

In the case of “salt and pepper “ noise the application of median filtering leads to the best noise reduction of the image. More complex is the case of Gaussian type noise, where both methods based on compression/decompression have proved some advantages overt simple averaging approaches and led to the best results of image denoising.

References:[1] S. Haykin, Adaptive Filter Theory, Prentice Hall, Englewood Cliffs, NJ, 1996[2] R. C. Gonzalez, R. E. Woods, Digital Image Processing. Addison-Wesley 1993[3] A. Bovik, : Handbook of Image and Video Processing, Academic Press 2000[4] S. Mallat, A theory for multiresolution signal decomposition: the wavelet representation, IEEE Trans. PAMI, 1989, vol. 11, pp. 674 – 693[5] I. Daubechies, Ten lectures on wavelets, SIAM Press, 1988[6] E. Oja, L. Wang , Image compression by MLP and PCA neural networks, SCIA-93, Tromso, 1993, pp. 1317 - 1324[7] B. Natarajan, Filtering random noise from deterministic signals via data compression, IEEE Trans. SP, 1995, vol. 43, pp. 2595 – 2605[8] K. I. Diamantras, S. Y. Kung, Principal component neural networks, Wiley, 1996[9] G. Golub, C. Van Loan, Matrix computations, Academic Press, 1991, NY [10] N. H. Young, A. H. Lai, Performance evaluation of a feature-preserving filtering algorithm for removing additive random noise in digital images, Optical Engineering, 1996, vol. 35, pp. 1871 – 1885[11] J. L. Stark, E. Candes, D. Donoho, The curvelet transform for image denoising, IEEE Trans. Image Processing, 2002, vol. 11, pp. 670-684[12] Y. You, M. Kaveh, Fourth-order partial differential equation for noise removal, IEEE Trans. Image Processing, 2000, vol. 9, pp. 1723-1730