You are on page 1of 6

International Journal of EmergingTrends & Technology in Computer Science(IJETTCS)

Web Site: www.ijettcs.org Email: editor@ijettcs.org, editorijettcs@gmail.com


Volume 2, Issue 1, January February 2013 ISSN 2278-6856


Volume 2, Issue 1 January - February 2013 Page 35

Abstract: With this paper we propose an iterative trimmed
median filter and an adaptive window trimmed median filter
for effective suppression of salt and pepper noise. The
iterative trimmed median filter works in a way that, when a
selected neighborhood window of a noise pixel is completely
noisy, such pixels will be left unchanged in the current
iteration and will be processed in the next iteration. The
adaptive window trimmed median filter works in a way, when
a selected neighborhood window of a noise pixel is completely
noisy, the size of the neighborhood window is adaptively
increased till an image pixel is found in the neighborhood.
The visual quality of the denoised image using the proposed
methods outperforms the Trimmed Median Filter (TMF) in
terms of Peak Signal-to-Noise Ratio (PSNR) and Structural
Similarity Index Measure (SSIM) values. At high noise
densities, the proposed iterative filter outperforms the
proposed adaptive window filter.
Keywords: Adaptive Window Filter, Impulse noise,
Median Filter, Trimmed Median Filter

1. INTRODUCTION
Impulse noise is a special type of noise which can have
many different causes. Thus, in the case of satellite or TV
images it can be caused through atmospheric
disturbances. In other applications it can be caused by
strong electromagnetic fields, transmission errors, etc.
Impulse noise is characterized by short, abrupt alterations
of the color values in the image. There are two major
impulse noise models used in contemporary literature: 1)
salt-and-pepper noise model, where noise pixels can have
only two valuesthe highest and the lowest value within
the dynamic range, and 2) uniform impulse noise model
where noisy pixels can have any value from the dynamic
range with equal probability. In this work, we proposed
two trimmed median filters for restoring images
corrupted by salt-and-pepper noise.
2. LITERATURE SURVEY
To remove impulse noise, many filters based on median
filters have been proposed in the literature. Very recently
it has been proved that trimmed median filtering (TMF)
[1] outperforms many of the variants of median filters [2-
8] available in the literature. TMF has the drawback that,
when a 3 X 3 window is completely corrupted by salt-
and-pepper noise, TMF replaces the center pixel with the
mean of the pixels in the window. It introduces false
colors (or false intensities in the case of grayscale images)
in the denoised image, which is not desirable. Thus,
trimmed median filter fails when all the pixels in the
selected neighborhood window are noisy (TMF failing
scenario), Figure.1 shows the trimmed median filtering
[1] output of an 80% corrupted lena image. In Figure.1,
we could easily notice the false colors introduced by TMF.
We overcome this drawback by i) unchanging such center
pixels in the current iteration and processing them in the
next iteration ii) adaptively increasing the selected
window size at TMF failure locations to obtain an image
pixel within the selected window. In this work, we
extensively compare the performance of TMF with our
proposed methods.



Figure 1 TMF output of 80% corrupted lena image

3. TRIMMED MEDIAN FILTER (TMF)
Trimmed Median Filter (TMF) [1] is a decision based un-
symmetric filter. TMF is a two stage filter. First it detects
the noisy pixels and then restores them. TMF considers
all saturated pixels (0 or 255) as noisy pixels. If a pixel
value lies within the dynamic range then it is considered
a noise free pixel. Noise free pixels are left unchanged in
the restoration stage. For each noisy pixel, the
neighboring pixels within the 3X3 window are analyzed
in the restoration stage. If all the pixels of the selected
3X3 window are deemed to be noisy, then the center pixel
is replaced by the mean of the 3X3 window in the
restored image. If the selected 3X3 window contains both
the noisy pixels and noise free pixels, then the center
pixel is replaced by the median of the noise free pixels in
the 3X3 window.
4. ITERATIVE TRIMMED MEDIAN
FILTER (ITMF)
In [1], the TMF failure scenario is handled by replacing
the center pixel with the mean value of all the pixels
within the selected window. This will introduce false
Trimmed Median Filters for Salt and Pepper
Noise Removal

S. Athi Narayanan, G. Arumugam, Prof. Kamal Bijlani


Amrita E-Learning Research Lab, Amrita University, Kollam, Kerala, India
International Journal of EmergingTrends & Technology in Computer Science(IJETTCS)
Web Site: www.ijettcs.org Email: editor@ijettcs.org, editorijettcs@gmail.com
Volume 2, Issue 1, January February 2013 ISSN 2278-6856


Volume 2, Issue 1 January - February 2013 Page 36

colors (or intensities in case of grayscale images) to the
center pixel due to the contribution of salt & peppers
within the selected window. In order to overcome this
drawback, a Iterative Trimmed Median Filter (ITMF) is
proposed. This ITMF considers all pixels with values 0 or
255 as noisy pixels and other pixels as image pixels. The
ITMF leaves the image pixels unchanged. This method
restores a noisy pixel by the median of the image pixels
within the selected neighborhood of the noisy pixel.
When all pixels in the selected neighborhood of a noisy
center pixel are deemed noisy, then the center pixel is left
unchanged in the current iteration and the noise pixel
count is incremented by 1. At the end of the current
iteration, the total unprocessed noise pixel count is
available and a new iteration is started if this count is non
zero. For the next iteration, the denoised image of the
current iteration becomes the input and the unprocessed
noise pixel count will be reset to zero. Thus the proposed
trimmed median filter iterates until the unprocessed noise
pixel count is zero at the end of a iteration. The flow
diagrams of the proposed iterative trimmed median filter
and the iteration control logic are shown in Figure.2 and
Figure.3. In Figure.2, I represents the input (noisy
image), D represents the output (denoised image), and
Cnt represents the total unprocessed noise pixel count.

Considering pixels with values 0 or 255 as noise pixels
and replacing them with the trimmed median of its
neighbor window performs well for natural images. It is
based on the assumption that normally only a small
portion of noise-free image pixels have these two extreme
values. Even if that is the case, they will be most likely
replaced by close approximations of their original values,
e.g., 0 with 1 or 2, and 255 with 254 or 253 (in 8-bit
images).

By design, the ITMF will detect and replace all noisy
pixels in an input image over time. Assuming all the
intensity values are equally probable in an image, the
probability that an image pixel is being considered as a
noisy pixel (false detection probability) by the ITMF is
very low. For a 50% salt-and-pepper noise corrupted
image, the false detection probability is 0.004.
5. ADAPTIVE WINDOW TRIMMED
MEDIAN FILTER (AWTMF)
The Adaptive Window Trimmed Median Filter
(AWTMF) handles the TMF failure scenario by
adaptively increasing the selected window size to obtain
an image pixel within the selected window. There is no
iteration process within the AWTMF. When using the
AWTMF, if the selected 3 X 3 window of a pixel is fully
noisy, then a 5 X 5 window is selected and trimmed
median filtering is applied. If the selected 5 X 5 window
is also fully noisy, then a 7 X 7 window is selected and
trimmed median filtering is applied and so forth. The
flow diagram of the proposed adaptive trimmed median
filter is shown in Figure.4. In Figure.4, I represents the
input (noisy image) and D represents the output (denoised
image).


Figure 2 Flow diagram of the proposed ITMF method


Figure 3 Flow diagram of the proposed Iteration Control
Logic


Figure 4 Flow diagram of the proposed AWTMF method
International Journal of EmergingTrends & Technology in Computer Science(IJETTCS)
Web Site: www.ijettcs.org Email: editor@ijettcs.org, editorijettcs@gmail.com
Volume 2, Issue 1, January February 2013 ISSN 2278-6856


Volume 2, Issue 1 January - February 2013 Page 37

6. EXPERIMENTAL RESULTS
We have compared the performance of ITMF and
AWTMF with TMF. Our test data set consists of ten
standard test images [10]. The color images and their
corresponding grayscale images (all size 256 X 256) were
used in our experiments. Figure.5 shows our test data set.
For each image in the test data set, the noise percentage is
varied from 10% to 95% and the denoising performances
are quantitatively compared using the PSNR (Peak
Signal-to-Noise Ratio) and SSIM (Structural Similarity
Index Measure) [9] values. The PSNR and SSIM values
are calculated by the equations (1), (2) and (3).



Figure 5 Input test data set images.
Peak signal-to-noise ratio (PSNR) is the ratio between the
maximum possible power of a signal and the power of a
corrupting noise that affects the fidelity of its
representation. Because many signals have a very wide
dynamic range, PSNR is usually expressed in terms of the
logarithmic decibel (dB) scale.
For an MXN image the mean squared error (MSE)
between the uncorrupted original image O and the
denoised image D is defined as:
- (1)

The PSNR is defined as:
- (2)

is the maximum possible pixel value of the image.
The Mean Square Error (MSE) is not well-correlated with
the human visual system. So, we have also used the
Structural Similarity Index Measure (SSIM) as the
performance measure for evaluating the proposed
algorithms. We have used the SSIM [9] with default
parameter settings. The SSIM is a method for measuring
the similarity between two images. SSIM is calculated
over local windows within the image. The SSIM metric is
calculated on various windows of an image. The measure
between two windows x and y of common size NN is:
- (3)
with
the average of x
the average of y
the variance of x
the variance of y
the covariance of x and y
, are two variables to
stabilize the division with weak denominator.
L the dynamic range of the pixel-values
(typically this is .
and by default
SSIM index is a decimal value between -1 and 1, and
value 1 is only reachable in the case of two identical
images.
In our experiments, unless otherwise mentioned, the
ITMF uses 3 X 3 windowing. The PSNR and SSIM
values of the proposed algorithms are compared against
the TMF at different noise densities and are shown in
Table.1 and Table.2. From Table.1 and Table.2, it is
observed that the performance of the proposed algorithms
outperforms the TMF at low and high noise densities. At
low and medium noise densities, the results of the ITMF
and the AWTMF are comparable. At high noise densities,
the ITMF outperforms the AWTMF. A plot of PSNR and
SSIM values against different noise densities for the
lena image and the house image for different
algorithms are shown in Figure.6 and Figure.7. Figure.8
and Figure.9 shows the results of TMF, ITMF and
AWTMF applied to the lena image and the house
image. From Figure.8 and Figure.9 it can be observed
that the visual quality of the TMF and AWTMF denoised
image is better than the TMF denoised image. Figure.10
shows the noise pixel locations and ITMF output for each
iteration of a corrupted grayscale lena image.
Table 1: Comparison of SSIM values of different
algorithms for the lena image at different noise densities



Table 2: Comparison of PSNR values of different
algorithms for the lena image at different noise densities


International Journal of EmergingTrends & Technology in Computer Science(IJETTCS)
Web Site: www.ijettcs.org Email: editor@ijettcs.org, editorijettcs@gmail.com
Volume 2, Issue 1, January February 2013 ISSN 2278-6856


Volume 2, Issue 1 January - February 2013 Page 38


Figure 6 Comparison graphs of PSNR and SSIM at
different noise densities for the lena image.




Figure 7 Comparison graphs of PSNR and SSIM at
different noise densities for the house image.


(a) (b) (c) (d)

Figure 8 Results of different algorithms for the lena
image. (a) Noisy image. (b) Output of TMF. (c) Output of
ITMF. (d) Output of AWTMF. Row1 and Row2 show the
noisy image and processed results of various algorithms for
image corrupted by 80% and 95% noise densities, respectively.



(a) (b) (c) (d)

Figure 9 Results of different algorithms for the house
image. (a) Noisy image. (b) Output of TMF. (c) Output of
ITMF. (d) Output of AWTMF. Row1 and Row2 show the
noisy image and processed results of various algorithms
for image corrupted by 80% and 95% noise densities,
respectively.



(a) (b) (c)
Figure 10 Noise pixel and denoised image after each, iteration
for 80% corrupted grayscale lena image in ITMF output.
Row1 shows the Noise pixel locations a) Iteration 1, noise pixel
count 8849. b) Iteration 2, noise pixel count 248. c) Iteration 3,
noise pixel count 0. Row 2 shows the restored images a)
Iteration 1 b) Iteration 2. c) Iteration 3.


We have also experimented with the ITMF by varying the
window sizes. The PSNR and SSIM values of the
proposed ITMF at different window sizes for grayscale
lena image and grayscale house image are shown in
Table.3 and Table.4. In Table.3 and Table.4, the iteration
column represents the number of iterations involved in
denoising through ITMF. Figure.11 shows the results of
ITMF for the lena image at different window sizes.
From Table.3, Table.4 and Figure.11 we observed that for
a noise density of 95%, the results of ITMF using a 5X5
window outperforms the usage of 3X3 and 7X7 windows.
At low and medium noise densities, the results of ITMF
using a 3X3 window outperforms the usage of 5X5 and
7X7 windows



International Journal of EmergingTrends & Technology in Computer Science(IJETTCS)
Web Site: www.ijettcs.org Email: editor@ijettcs.org, editorijettcs@gmail.com
Volume 2, Issue 1, January February 2013 ISSN 2278-6856


Volume 2, Issue 1 January - February 2013 Page 39


Table 3 Comparison of noise measures of ITMF results at different window sizes for the grayscale lena image


Table 4 Comparison of noise measures of ITMF results at different window sizes for the grayscale house image



Figure 11 Results of ITMF for lena image at different
window sizes. (a) Noisy Image. (b) 3X3. (c) 5X5. (d)
7X7. Row1 and Row2 show the noisy image and
processed results for image corrupted by 80% and 95%
noise densities, respectively.

7. CONCLUSION
In this paper, two new algorithms (ITMF & AWTMF) are
proposed to handle the failure scenario of TMF. ITMF &
AWTMF produce visually better quality denoised images
compared to the TMF in terms of SSIM values. The
performance of the algorithms has been tested at low,
medium and high noise densities on both grayscale and
color images. At high noise densities, ITMF outperforms
AWTMF. The proposed algorithms effectively restored
the images corrupted by high density salt and pepper
noise.


REFERENCES
[1] S. Esakkirajan, T. Veerakumar, Adabala N.
Subramanyam, and C. H. PremChand, "Removal of
High Density Salt and Pepper Noise Through
Modified Decision Based Unsymmetric Trimmed
Median Filter", IEEE Signal Process. Lett., vol. 18,
no. 5, pp. 287290, May 2011.
[2] J. Astola and P. Kuosmaneen, Fundamentals of
Nonlinear Digital Filtering. Boca Raton, FL: CRC,
1997.
[3] H. Hwang and R. A. Hadded, Adaptive median
filter: New algorithms and results, IEEE Trans.
Image Process., vol. 4, no. 4, pp. 499502, Apr.
1995.
[4] S. Zhang and M. A. Karim, A new impulse
detector for switching median filters, IEEE Signal
Process. Lett., vol. 9, no. 11, pp. 360363, Nov.
2002.
[5] P. E. Ng and K. K. Ma, A switching median
filter with boundary discriminative noise detection
for extremely corrupted images, IEEE Trans. Image
Process., vol. 15, no. 6, pp. 15061516, Jun. 2006.
International Journal of EmergingTrends & Technology in Computer Science(IJETTCS)
Web Site: www.ijettcs.org Email: editor@ijettcs.org, editorijettcs@gmail.com
Volume 2, Issue 1, January February 2013 ISSN 2278-6856


Volume 2, Issue 1 January - February 2013 Page 40

[6] K. S. Srinivasan and D. Ebenezer, A new fast
and efficient decision based algorithm for removal of
high density impulse noise, IEEE Signal Process.
Lett., vol. 14, no. 3, pp. 189192, Mar. 2007.
[7] V. Jayaraj and D. Ebenezer, A new switching-
based median filtering scheme and algorithmfor
removal of high-density salt and pepper noise in
image, EURASIP J. Adv. Signal Process., 2010.
[8] K. Aiswarya, V. Jayaraj, and D. Ebenezer, A
new and efficient algorithm for the removal of high
density salt and pepper noise in images and videos,
in Second Int. Conf. Computer Modeling and
Simulation, pp. 409413, 2010.
[9] Z. Wang, A. C. Bovik, H. R. Sheikh, and E. P.
Simoncelli, 2004, Image quality assessment: From
error visibility to structural similarity, IEEE Trans.
on Image Process., vol. 13, no. 4, pp. 600-612, 2004.
[10] USC-SIPI image database:
http://sipi.usc.edu/database/database.php?volume=mi
sc

You might also like