Abstract. A new switching-based trimmed median filter to remove high-density salt-and-pepper noise in digital
images is proposed. Initially, a 3 3 sliding window is applied on each pixel in the noisy image. The minimumand maximum-intensity values are trimmed, and the noisy pixels are detected based on the predefined threshold
value. In the filtering stage, the noisy pixels are replaced by median value of uncorrupted pixels in the trimmed
array. At very high noise density, if all the pixels in the sliding window are corrupted, then the proposed algorithm
replaces noisy pixels by the midpoint of recently processed pixels. The experimental results for various test
images show that the performance of the proposed algorithm is superior to the existing algorithms, namely
SMF, WMF, CWMF, AMF, DBA, and MDBUTMF in terms of visual quality and edge preservation, even at
noise levels as high as 95%. 2014 SPIE and IS&T [DOI: 10.1117/1.JEI.23.3.033011]
Keywords: edge preservation; impulse noise; nonlinear filter; trimmed median filter.
Paper 13352 received Jul. 3, 2013; revised manuscript received Mar. 16, 2014; accepted for publication May 2, 2014; published online
Jun. 9, 2014.
1 Introduction
Images are frequently corrupted by impulse noise due to malfunctioning of camera sensors, faulty memory locations in
hardware, and transmission of images in noisy channels,
which can seriously affect quality of the images.1 Salt-andpepper noise is also called fixed-valued impulse noise, which
can take two extreme-intensity values normally being the
minimum (0) and the maximum (255). In an image, edges
contain essential information and the objective of any filtering technique is to remove the impulses, so that the edge
details should be preserved. In general, linear filtering techniques for image restoration tend to blur the edges. The simplest nonlinear filter to remove the salt-and-pepper noise is
the standard median filter (SMF).2 Median filters are widely
used due to their effective noise suppression capability and
simplicity in implementation. But at higher noise levels, they
do not perform well and tend to remove the image details. In
response to these difficulties, modified median filters, such
as weighted median filter (WMF), center weighted median
filter (CWMF), and multistate median filter,35 are introduced. However, most of the median-based filters are operated uniformly across the image and thus tend to alter both
noisy and noise-free pixels and hence produce blurring on
output images.
In order to overcome the problem of median-based filters,
different kinds of decision-based median filters, such as
progressive switching median filter (PSMF)6 and adaptive
median filter (AMF),7 have been proposed. Since the
AMF uses larger window size and PSMF uses larger numbers of iterations to detect the presence of noise, their computation time is also very high. In addition to that, switching
strategies used in certain switching-based median filters
033011-1
MayJun 2014
Vol. 23(3)
Vijaykumar and Santhanamari: New decision-based trimmed median filter for high-density salt. . .
detects the presence of salt-and-pepper noise by maximumintensity value 255 and minimum-intensity value 0, the
detection accuracy is not enough to restore the images corrupted with more than 80% of noise level. In addition to
that, if all the pixels in the window are either 0 or 255,
then the MDBUTMF replaces the noisy pixel by mean value,
which is also either 0 or 255. Unlike the median filter,
mean filters smooth the images. Recently, an improved BDND
filter13 is proposed to overcome the blurring effect of BDND
by considering the spatial correlation between the noisy and
uncorrupted pixels in the filtering window. Though it reduces
the blurring effect, the computation time is still high since it
uses the same detection process as in BDND.
To overcome the above drawbacks in various filters, a new
decision-based trimmed median filter, to remove high-density salt-and-pepper noise with better performance in
terms of qualitative and quantitative results, is proposed in
this paper. In the proposed filter, a fixed 3 3 sliding window is applied to the current pixel being processed, and the
pixels are sorted. A trimmed array is obtained by eliminating
the minimum- and maximum-intensity values in the sorted
array. The noisy pixels are detected by comparing the absolute difference between the center pixel and the median value
of uncorrupted pixels in the trimmed array with a predefined
threshold value T. If it is identified as noisy pixel, then it
is replaced with the median value otherwise left unaltered.
The rest of this paper is organized as follows. In Sec. 2,
the proposed trimmed median filtering algorithm is
described and illustration is given in Sec. 3. The simulation
results of the proposed trimmed median filter in image
denoising application and performance comparisons with
the other existing algorithms are displayed in Sec. 4.
Section 5 concludes the paper.
2 Proposed Decision-Based Trimmed Median Filter
Initially, a 3 3 fixed sliding window is imposed on each
pixel being processed in the noisy image. The minimumintensity (Smin ) and maximum-intensity (Smax ) values
obtained in the selected window are trimmed, and remaining
pixels, which are not equal to Smin and Smax , are collected in
an array. Then, the absolute difference between the center
pixel and the mean value of those pixels collected in the
array is compared with a predefined threshold value T
to detect whether the center pixel is corrupted or not. If it
is detected as noisy pixel, then filtering is applied; otherwise
it is left unaltered. Because of the detection mechanism, the
proposed algorithm works well even above the 50% breakdown limit for a 3 3 fixed window. In the case of 90% and
above noise levels, if all the pixels in the 3 3 filtering window are corrupted, then the proposed algorithm replaces the
center pixel with the midpoint of previously processed four
pixels. The proposed algorithm is explained in the following
steps.
W 3 i; j Xi k; j l;
1 k; l 1:
(1)
Case (i)
Step 2: If Smin 0 and Smax 255 continue; else go to
Step 6.
Step 3: The Smin and Smax values in the array Zi are trimmed
and all the uncorrupted pixels, which are not equal to
Smin and Smax , are retained in the same array. The set
of noise-free coordinates are defined in Eq. (2), in
which f ik;jl is gray level intensity at pixel location
i k, j l. If Zi is empty go to Step 11; else
continue.
Si;j fi k:j 1; i k; j 1
W 3 i; j f ik;j1 Smin f ik;j1 Smax g
(2)
Step 4: Median (MED) of an array Zi is found. If
jX ij MEDj < T, then X ij is noise-free and actual
value is retained; otherwise X ij is replaced with MED,
in which the threshold value T lies in the range
[2730].
Step 5: Repeat the process from Step 1, until all the pixels in
the noisy image are processed.
Case (ii)
Step 6: If Smin 0 and Smax 255 continue; else go to
Step 8.
Step 7: The Smin and Smax values in the array Zi are trimmed
and all the uncorrupted pixels, which are not equal to
Smin , in trimmed array Zi are retained. The set of
noise-free coordinates are defined by Eq. (3), in
which f ik;jl is gray level intensity at pixel location
i k, j l. If Zi is empty go to Step 11; else go
to Step 4.
Si;j fi k; j 1; i k; j 1
W 3 i; j f ik;j1 Smin g:
(3)
Case (iii)
Step 8: If Smin 0 and Smax 255 continue; else go to
Step 11.
Step 9: The Smin and Smax values in the array Zi are trimmed
and all the uncorrupted pixels, which are not equal to
Smax , in trimmed array Zi are retained. The set of
noise-free coordinates is defined by Eq. (4), in which
f ik;jl is gray level intensity at pixel location i k,
j l. If Zi is empty go to Step 11; else go to
Step 4.
Algorithm Steps:
Step 1: Let Xij be a pixel being processed in the noisy
image. A 3 3 fixed window W 3 i; j defined in
Eq. (1) centered about X ij is applied, and elements in
W 3 i; j are collected in an array Ziji19. Smin and
Smax in the window are obtained by sorting the elements
in the array Zi
Journal of Electronic Imaging
Si;j fi k; j 1; i k; j 1
W 3 i; j f ik;j1 Smax g:
(4)
033011-2
MayJun 2014
Vol. 23(3)
Vijaykumar and Santhanamari: New decision-based trimmed median filter for high-density salt. . .
Table 1 Peak signal-to-noise ratio (PSNR) comparison for Lena and Bridge image.
Lena
ND (%) SMF WMF CWMF PSMF AMF
Bridge
DBA MDBUTMF Proposed SMF WMF CWMF PSMF AMF
10
41.15
39.26
31.16
28.31
20
37.25
37.27
28.55
27.58
30
34.75
35.67
26.64
26.96
40
32.26
34.47
25.08
26.29
50
30.27
33.11
23.53
25.53
60
12.32 11.51
10.8
28.03
31.51
21.85
24.58
70
10.07 9.45
9.05
25.75
29.73
9.77
9.18
8.79
20.16
23.43
80
8.14
7.86
7.56
22.81
27.74
7.85
7.61
7.37
18.20
22.00
90
6.6
6.51
6.36
18.14
24.48
6.42
6.32
6.19
15.45
20.00
Table 2 Mean absolute error (MAE) and image enhancement factor (IEF) for Lena image.
MAE
IEF
10
0.172
0.255
623.97
672.2
20
0.374
0.449
546.08
761.9
30
0.594
0.661
472.18
760.9
40
0.883
0.866
391.03
733.2
50
1.210
1.126
307.31
687.3
60
1.661
1.462
239.86
625.3
70
2.257
1.858
164.66
519.0
80
3.310
2.501
90.632
422.6
90
5.970
3.896
24.676
272.7
033011-3
MayJun 2014
Vol. 23(3)
Vijaykumar and Santhanamari: New decision-based trimmed median filter for high-density salt. . .
Case (i)
The case if the center pixel in the selected window is noisy and some neighborhood pixels add salt-and-pepper noise to the image
is illustrated in case (i). The pixels in the selected window are sorted, and Smin and Smax values are trimmed. Then, the uncorrupted
pixels, which are not equal to Smin and Smax in Zi , are retained. The median value of the array Zi is found. Since the absolute
difference between the median value and the center pixel value is greater than 30, the center pixel is noisy and replaced with the
median value as shown below:
0
49
50
255
255
46
255
48
Table 3 Mean absolute error (MAE) and image enhancement factor (IEF) for Bridge image.
MAE
IEF
10
0.482
1.410
48.28
25.21
20
0.991
1.824
62.80
55.64
30
1.576
2.257
67.90
82.99
40
2.220
2.723
65.54
97.54
50
3.025
3.228
55.65
106.0
60
3.929
3.917
46.19
107.0
70
5.154
4.766
35.62
99.67
80
7.023
5.940
24.89
86.02
90
9.754
7.953
11.21
61.82
Table 4 Structural similarity index (SSIM) for Lena and Bridge image.
Lena
ND (%) SMF WMF CWMF PSMF AMF
Bridge
DBA MDBUTMF Proposed SMF WMF CWMF PSMF AMF
10
0.990
0.995
0.976
0.924
20
0.978
0.976
0.950
0.894
30
0.965
0.963
0.917
0.875
40
0.947
0.949
0.877
0.846
50
0.924
0.931
0.820
0.812
60
0.891
0.908
0.751
0.768
70
0.845
0.877
0.653
0.709
80
0.769
0.835
0.514
0.629
90
0.622
0.759
0.333
0.492
033011-4
MayJun 2014
Vol. 23(3)
Vijaykumar and Santhanamari: New decision-based trimmed median filter for high-density salt. . .
Case (ii)
The case if the center pixel in the selected window is noisy and some neighborhood pixels add pepper noise to the image is
illustrated in case (ii). Since the absolute difference between the median value of the array Zi and center pixel value is greater
than 30, the center pixel is noisy and replaced with the median value as shown below:
0
205
206
205
209
208
205
Fig. 1 Comparison of (a) PSNR, (b) MAE, (c) IEF, (d) SSIM, (e) run time of various algorithms for Lena
image corrupted with various noise densities.
033011-5
MayJun 2014
Vol. 23(3)
Vijaykumar and Santhanamari: New decision-based trimmed median filter for high-density salt. . .
Case (iii)
The case if the center pixel in the selected window is noisy and some neighborhood pixels add salt noise to the image is
illustrated in case (iii). Since the absolute difference between the median value of the array Zi and center pixel value is greater
than 30, the center pixel is noisy and replaced with the median value.
255
49
57
51
255
50
48
52
255
Fig. 2 (a)(j) Restoration results for Lena image corrupted with 95% salt-and-pepper noise density.
(a) Original, (b) noisy, (c) SMF, (d) WMF, (e) CWMF, (f) PSMF, (g) AMF, (h) DBA, (i) MDBUTMF, (j) proposed.
033011-6
MayJun 2014
Vol. 23(3)
Vijaykumar and Santhanamari: New decision-based trimmed median filter for high-density salt. . .
Case (iv)
If the center pixel value is noise free, then the absolute difference between the median value and center pixel is less than 30,
then the processing pixel is left unaltered.
58
66
56
73
59
65
58
66
56
Fig. 3 (a)(j) Restoration results for bridge image corrupted with 80% salt-and-pepper noise density.
(a) Original, (b) noisy, (c) SMF, (d) WMF, (e) CWMF, (f) PSMF, (g) AMF, (h) DBA, (i) MDBUTMF, (j) proposed.
033011-7
MayJun 2014
Vol. 23(3)
Vijaykumar and Santhanamari: New decision-based trimmed median filter for high-density salt. . .
Fig. 4 (a)(j) Restoration results for Elaine image corrupted with 70% salt-and-pepper noise density.
(a) Original, (b) noisy, (c) SMF, (d) WMF, (e) CWMF, (f) PSMF, (g) AMF, (h) DBA, (i) MDBUTMF,
(j) proposed.
033011-8
MayJun 2014
Vol. 23(3)
Vijaykumar and Santhanamari: New decision-based trimmed median filter for high-density salt. . .
Fig. 5 (a)(j) Restoration results for Peppers image corrupted with 60% salt-and-pepper noise density.
(a) Original, (b) noisy, (c) SMF, (d) WMF, (e) CWMF, (f) PSMF, (g) AMF, (h) DBA, (i) MDBUTMF,
(j) proposed.
033011-9
MayJun 2014
Vol. 23(3)
Vijaykumar and Santhanamari: New decision-based trimmed median filter for high-density salt. . .
Fig. 6 (a)-(j) Restoration results for gray level variation of 100th row of Lena image corrupted with 90%
noise density. (a) Original, (b) noisy, (c) SMF, (d) WMF, (e) CWMF, (f) PSMF, (g) AMF, (h) DBA,
(i) MDBUTMF, (j) proposed.
033011-10
MayJun 2014
Vol. 23(3)
Vijaykumar and Santhanamari: New decision-based trimmed median filter for high-density salt. . .
lower PSNR values than the proposed filter for noise level
more than 60%.
The proposed algorithm produces much lower MAE and
better IEF than the existing filters at higher noise densities,
which are given in Tables 2 and 3. The proposed algorithm
also exhibits improved structural similarity index, which
is displayed in Table 4. The above discussed quantitative
performance comparisons are also presented graphically
in Fig. 1.
Fig. 7 (a)(j) Error images for Lena image corrupted with 90% salt-and-pepper noise density.
(a) Original, (b) noisy, (c) SMF, (d) WMF, (e) CWMF, (f) PSMF, (g) AMF, (h) DBA, (i) MDBUTMF,
(j) proposed.
033011-11
MayJun 2014
Vol. 23(3)
Vijaykumar and Santhanamari: New decision-based trimmed median filter for high-density salt. . .
Fig. 8 Restoration results of (a) Lena, (b) Bridge, (c) Elaine and
(d) Peppers images using various filters, namely SMF, WMF, CWMF,
PSMF, AMF, DBA, MDBUTMF, and proposed algorithm, for 90% saltand-pepper noise densities.
033011-12
MayJun 2014
Vol. 23(3)
Vijaykumar and Santhanamari: New decision-based trimmed median filter for high-density salt. . .
Lena
Bridge
ND (%) SMF WMF CWMF PSMF AMF DBA MDBUTMF Proposed SMF WMF CWMF PSMF AMF DBA MDBUTMF Proposed
10
5.49
6.04
5.65
38.85
7.12
6.51
1.62
7.44
5.5
6.04
5.65
1.60
7.41
20
5.53
6.06
5.68
36.59
7.13
6.54
2.57
7.45
5.54
6.04
5.70
2.59
7.48
30
5.51
6.03
5.62
36.75
7.14
6.50
3.48
7.48
5.51
6.04
5.67
3.56
7.51
40
5.48
6.09
5.71
36.87
7.37
6.54
4.39
7.49
5.48
6.03
5.70
4.43
7.54
50
5.51
6.04
5.70
36.91
7.85
6.51
6.89
7.51
5.51
6.04
5.67
5.32
7.48
60
5.50
6.03
5.75
36.65
8.70
6.56
7.73
7.51
5.50
6.04
5.73
6.23
7.45
70
5.53
6.04
5.69
8.48
7.48
5.53
6.03
5.68
7.09
7.46
80
5.53
6.04
5.70
9.31
7.48
5.53
6.03
5.7
7.98
7.42
90
5.53
6.03
5.70
10.15
7.37
5.53
6.06
5.71
8.78
7.39
Elaine
Peppers
ND (%) SMF WMF CWMF PSMF AMF DBA MDBUTMF Proposed SMF WMF CWMF PSMF
AMF
10
5.54 6.07
5.71
37.26
7.11
6.58
1.57
7.45
5.57 6.12
5.71
38.67
7.14
6.55
1.57
7.45
20
5.56 6.09
5.70
36.38
7.12
6.61
2.54
7.46
5.50 6.07
5.70
36.9
7.25
6.74
2.53
7.46
30
5.57 6.07
5.71
36.86
7.10
6.58
3.48
7.51
5.53 6.09
5.73
37.02
7.18
6.68
3.48
7.48
40
5.56 6.06
5.71
36.73
7.45
6.59
4.42
7.48
5.54 6.07
5.68
36.95
7.51
6.71
4.39
7.5
50
5.56 6.09
5.75
36.94
8.01
6.57
5.34
7.42
5.56 6.07
5.71
36.99
7.85
6.90
5.34
7.53
60
5.53 6.12
5.76
35.94
8.85
6.54
6.25
7.51
5.56 6.07
5.75
37.11
8.89
6.54
6.23
7.5
70
5.56 6.09
5.76
8.54
7.48
5.59 6.09
5.71
8.53
7.54
80
5.53 6.10
5.76
8.10
7.48
5.56 6.09
5.68
37.74
13.48
6.61
9.39
7.65
90
5.53 6.06
5.71
10.2
7.42
5.56 6.06
5.71
37.93
19.41
6.71
10.23
7.65
5 Conclusion
In this paper, a new decision-based trimmed median filter
with fixed window for effective removal of high-density
salt-and-pepper noise in images is proposed. The use of a
small 3 3 fixed window in the proposed algorithm leads
to preservation of fine details, such as edges, satisfactorily.
The better noise-removal capability of the proposed filter
over other fixed window algorithms, such as DBA and
MDBUTMF, is demonstrated using different test images.
Experimental results reveal that the proposed filter outperforms the existing state-of-the-art filters by providing better
Journal of Electronic Imaging
PSNR, IEF, SSIM, MAE values and visual quality for the
images corrupted up to 95% of noise level.
References
1. R. C. Gonzalez and R. E. Woods, Digital Image Processing, 2nd ed.,
Prentice Hall, Upper Saddle River, NJ (2002).
2. I. Pitas and A. N. Venetsanopoulos, Order statistics in digital image
processing, Proc. IEEE, 80(12), 18931921 (1992).
3. L. Yin et al., Weighted median filters: a tutorial, IEEE Trans. Circuits
Syst. II: Analog Digital Signal Process. 43(3) 157192 (1996).
4. S. J. Ko Chen and Y. Hoom Lee, Center-weighted median filters and
their applications to image enhancement, IEEE Trans. Circuits Syst.
38(9), 984993 (1991).
033011-13
MayJun 2014
Vol. 23(3)
Vijaykumar and Santhanamari: New decision-based trimmed median filter for high-density salt. . .
5. T. Chen and H. R. Wu, Impulse noise removal by multi-state median
filtering, in Proc. 2000 IEEE Int. Conf. on Acoustics, Speech, and
Signal Processing, 2000, ICASSP 00, Istanbul, Vol. 4, pp. 2183
2186 (2000).
6. Z. Wang and D. Zhang, Progressive switching median filter for the
removal of impulse noise from highly corrupted images, IEEE
Trans. Circuits Syst. II: Analog Digit. Signal Process. 46(1), 7880
(1999).
7. H. Hwang and R. A. Haddad, Adaptive median filters: new algorithms
and results, IEEE Trans. Image Process. 4(4), 499502 (1995).
8. P. E. Ng and K. K. Ma, A switching median filter with boundary discriminative noise detection for extremely corrupted images, IEEE
Trans. Image Process. 15(6), 15061516 (2006).
9. H. L. Eng and K. K. Ma, Noise adaptive soft-switching median filter,
IEEE Trans. Image Process. 10(2), 242251 (2001).
10. 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. 14(3), 189192 (2007).
11. 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 Proc. Second Int. Conf. Computer
Modeling and Simulation, Sanya, Hainan, Vol. 4, pp. 409413,
IEEE (2010).
12. S. Esakkirajan et al., Removal of high density salt and pepper noise
through modified decision based unsymmetric trimmed median filter,
IEEE Signal Process. Lett. 18(5), 287290 (2011).
033011-14
MayJun 2014
Vol. 23(3)