Inte rnatio nal Jo urnal o f Sc ie ntific & Eng inee ring Re se arc h, Vo lume 3, Issue 2, February -2012 1

ISS N 2229-5518

Switching Median Filter for Image Enhancement

R. Pushpavalli, G.Sivaradje

AbstractIn this paper, a new nonlinear f iltering technique is introduced f or enhancement of images that are highly contaminated by impu lse noise. The proposed f iltering technique is more eff ective in eliminating impu lse noise and preserving the image f eatures. The f ilter replaces a corrupted pixel by the median value or by its processed neighboring pixel value. The uncorrupted pixels are lef t undisturbed. Simu lation studies show that the proposed f ilter can eliminate impulse noise of densities up to 70% w hile preserving the edges and f ine details satisf actorily. The perf ormance of the f ilter is evaluated by applying it on diff erent test images and the results ob tained are presented.

In dex Te rms Impulse Noise, Med ian Filtering, Nonlinear Filter, Order Statistics Filter, Image Enhancement .

—————————— ——————————

1 INTRODUCTION

ILTERING is a vital part of any s ignal process ing s ystem, which entails es timation of s ignal degradation and restoring the s ignals atis factorily with its features pres erved intact. Several
filtering techniques have been reported in the literature over the
years , suitable for various applications . Nonlinear filtering tech- niques are preferred for denois ing images which are degraded by impuls e nois e. These nonlinear filtering techniques take into account for nonlinear nature of the h uman visual sys tem. Thus , the filters having good edge and image detail pres ervation properties are highly des irable for visual perception. The median filter and its variants are among the most commonly used filters for impuls e nois e removal. The median filters , when applied uniformly across the image, modify both noisy as well as nois e free pixels , resulting in blurred and dis- torted features [1-2]. Recently, some modified forms of the median filter have been proposed to overcome these limitations . In these variants , namely, the s witching median filters , a pixel value is altered only if it is detected to have been corrupted by impuls e nois e [3-5]. These variants of the median filter s till retain the bas ic rank order structure of the filter. Sa lt-and-pepper nois e is relatively cons idered for two intens ity levels in the noisy pixels , that is , 255 and 0. The impuls e nois e is detected us ing decis ion mechanis m with a pre -s et threshold value [6] and the corrupted pixels alone are subjected to filtering. The window s ize is increas ed to achieve better nois e re- moval; however, the increased window s ize results in less correlation between the corrupted pixel values and replaced median pixel values .
A Switching Median Filter with Boundary Dis criminative Noise Detection for Extremely Corrupted Images has been propos ed [7]. This technique is proficient in eliminating high dens ities of impulse nois e as well as preserving the edges and fine details . However, the computational complexity involved in restoring the images is quite high. An Improved Decis ion – Bas ed Algorithm for Impuls e Noise

————————————————

R.Pushpavalli is currently pursuing Ph.D in the departm ent of Electronics and Communication Engineering in Pondicherry Engineering College, Pu- ducherry, India-605 014.

E-mail: pushpavalli11@pec.edu

G.Sivaradje is working as Associate Professor in the departm ent of Electronics and Communication Engineering in Pondicherry Engineering College, Puducherry, India -605 014.

E-mail: shivaradje@pec.edu

Removal has been inves tigated [8]. In this method, a corrupted pixel is replaced by the average value of already process ed neighbouring pixels ins ide the filter window. Although this filter suppresses im- puls e nois e satis factorily, it is found to exhibit inadequate perfor
-mance in terms of pres erving edges and fine details due to the aver- aging process involved in filtering. A New Adaptive Decis ion Bas ed Robus t Statis tics Estimation Filter for High Dens ity Impulse Nois e in Images and Videos has been recently propos ed [9]. In this filter, the corrupted pixel is replaced by the median of the pixels in- s ide the filter window. If the median value is als o an impuls e, s ize of the window is increased for eliminating it. Although this filte r elimi- nates impulse noise satis factorily, it entails more computation time to perform filtering. A Highly Effective Impulse Nois e Detection Algo- rithm for Switching Median Filters has been experimented [10].This algorithm has been s hown to remove high dens ity impulse nois e. However, the computational complexity is quite high.
A new Switching Median Filtering Technique (SMFT) for remo v-
ing impuls e noise from the images is proposed. This filtering tech- nique detects whether a pixel is nois y or nois e -free. If the pixel is nois e-free, the filtering window is moved forward to process the next pixel. On the other hand, if the pixel is a noisy one, then it is re- placed by the median pixel value if it is not an impuls e; otherwis e, the pixel is replaced by the already p rocessed immediate top neigh- bouring pixel in the filtering window. The propos ed filter will be shown to exhibit good respons e at s ignal edges bes ides filtering out nois e sufficiently. The paper is organized as follows . Section II dis- cusses the scheme proposed for impuls e nois e detection and elimin a- tion. The s imulation results obtained by applying the filter on diffe r- ent images are presented in section III to illus trate its efficacy. The conclus ions are summarized in section IV.

2 PROPOS ED FILT ERING A LGO RIT HM

2.1 Impuls e Nois e Detection

The impulse nois e detection is based on the assumption that a co r- rupted pixel takes a gray value which is s ignificantly different from its neighboring pixels in the filtering window, whereas noise -free regions in the image have locally s moothly varying gray levels s ep a- rated by edges . In widely used Standard Median Filter (SMF) and Adaptive Median Filter (AMF), only median values are us ed for the

IJSER © 2012

http :// www.ijser.org

Inte rnatio nal Jo urnal o f Sc ie ntific & Eng inee ring Re se arc h, Vo lume 3, Issue 2, February -2012 2

ISS N 2229-5518

replacement of the corrupted pixels .
In s witching median filter, the difference between the median value of pixels in the filtering window and the current pixel value is co m- pared with a threshold to determine the presence of impuls e. If the current pixel is detected to have been corrupted by impuls e noise then the pixel is subjected to filtering; otherwis e, the pixel is left undis turbed and des cribed in Fig.1.
filtering window, if the median value is not an impuls e. If the median value itself is an impuls e then the central pixel is replaced by the already processed immediate
top neighbouring pixel Ai-1,j in the filtering window. In the present
cas e, the median value is als o an impuls e and therefore, the pixel is
replaced by its already processed top neighbour pixel value 214.

161

167

164

63

255

255

165 0 255 255 255

166 255 159 255 167

Noisy

Image

Decision

Mechanism

Fig. 1 Impulse Det ection

Filter

Restored

Image

Then the window is moved to form a new set of values , with the next pixel to be processed at the centre of the window. This process is repeated until the las t image pixel is processed. This Impuls e noise detection and filtering is based on the following condition:

if Amin < Ai,j < Amax

{Ai,j is a noiseless pixel;

no filtering is performed on Ai,j }

else

2.2 Filtering Algorithm

The filtering technique proposed in this paper detects the impulse nois e in the image us ing a decis ion mechanis m. The corrupted and uncorrupted pixels in the image are detected by comparing the pixel value with the maximum and minimum values in the s elected window. If the pixel intens ity lies between thes e minimum and ma ximum values , then it is an uncorrupted pixel and it is left undis turbed. If the value does not lie within the range, then it is a corrupted pixel and is replaced by the median pixel value or already process ed immediate neighboring pixel in the current filtering window.
Cons ider an image of s ize M×N having 8-bit gray s cale pixel
resolution. The steps involved in detecting the pres ence of an im- puls e or not are described as follows :
Step 1) A two dimens ional s quare filtering window of s ize 3 x 3 is
s lid over a highly contaminated image as shown in below.

162

159

163

255

0

255

255

255

255

Step2) The pixels ins ide the window are s orted out in as cending order.

0 159 162 163 255 255 255 255 255
Step 3) Minimu m, ma ximu m and median of the pixel values in the process ing window are determined. In this cas e, the minimum, ma x- imu m and median pixel values , respectively, are 0, 255 and 255.
Step 4) If the central pixel lies between minimum and maximum
values , then it is detected as an uncorrupted pixel and the pixe l is left undis turbed. Otherwis e, it is cons idered a corrupted pixel value. In the pres ent cas e, the central pixel value 255 does not lie between minimum and maximu m values . Therefore, the pixel is detected to be a corrupted pixel.
Step 5) The corrupted central pixel is replaced by the median of the

{Ai,j is a noisy pixel;

determine the median value}

if median 0 and median 255

{Median filter is performed on Ai,j } Ai,j = Amed

else

{Median itself is noisy} Ai,j = Ai-1,j

end;

end;

where, Ai,j is the intens ity of central pixel ins ide the filtering window, Amin, Amax and Amed are the minimu m , ma ximum and median pixel value in filtering window of noisy image. Ai-1,j is the intens ity of the already processed immediate top neighboring pixel.
In order to process the border pixels , the firs t and last columns , respectively are replicated at the front and rear ends of the image matrix; s imilarly, the firs t and las t rows , respectively, are replicated
The propos ed SMFT algorithm is s impler than Boundary Discri- minative Noise Filtering technique [6] and Improved Dec is ion Bas ed Algorithm (IDBA) [8] in terms of computational requirements . Fu r- ther, the Boundary Discriminative Noise Filtering technique is con- s iderably more complex in terms of computation; therefore, it has not been taken into account for perfo rmance comparis on with the proposed filter algorithm. The proposed filter exhibits s uperior pe r- formance than the IDBA in terms of eliminating impuls e noise up to
70 % and pres erving edges and fine details .

3 RES ULT AND DIS CUSSION

The performance of proposed filter is compared with that of IDBA
by applying them on Lena image of s ize 256 x 256, co rrupted with

IJSER © 2012

http :// www.ijser.org

Inte rnatio nal Jo urnal o f Sc ie ntific & Eng inee ring Re se arc h, Vo lume 3, Issue 2, Fe

ISS N 2229-5518

various dens ities of impuls e nois e. SMFT has als o been evaluated by applying it on s everal tes t images including Lotus and Boat of s ize

256 x 256. The objective measures used for quantitatively evaluating the performance of the filters are Mean Square Error (MSE) and Peak Signal to Noise ratio (PSNR) and thes e metrics are defined as follows :

a b c

(1)
(2)

d e f

where, x(i,j) and f(i,j) denote, respectively, the intens ity of (i,j)th pixel of the original and filtered images . In order to prove the better performance of propos ed filter, exis ting filtering techniques are experimented and compared with the propos ed filter for visual perception and subjective evaluation on Lena image including the
standard Median Filter (MF), the Weighted Median Filter (WMF), g h i
the Center Weighted Median Filter (CWMF), the Tri State Median
Filter (TSMF), a New Impuls e Detector (NID), Multiple Decis ion Bas ed Median Filter (MDBMF), DBSM filter, IBA and propos ed filter in Fig.2. The values of objective meas ures obtained by apply- ing the filters on Lena tes t image contaminated with the impulse nois e of various nois e dens ities are s ummarized in Tables 1 and are
illustrated graphically in Fig.3. j k

Fig.2 P erformance of Test image: Lena (a) Noise free images, (b) image corrupt ed by 50% impulse noise, (c) images restored by MF, (d) images rest ored by WMF,(e)images rest ored by CWMF, (f)images restored by T SMF,(g) images restored by MDBSMF, (h) images restored by NID,

(i) images rest ored by DBSMF, (j)images rest ored by IDBA, (k) images


Fig.3 illus trates the performance of proposed filter and compares with other filtering algorithms in terms of PSNR when applied on Lena image contaminated with nois e dens ities up to 90%. This s witching median filter outperforms the exis ting filtering algorithms for the noise dens ities up to 50%.

40

MF WMF

35 CWMF

TSMF

NID

MDBSMF

30 DBSMF IDBA

PROPOSED NNFT

25

20

15

10

5

10 20 30 40 50 60 70 80 90

Noise percentage

IJSER © 2012

http:// www.ijser.or

Fig.3 P SNR obt ained using proposed filter on Lena image co rrupt ed wit h different densit ies of imp ulse noise compared with other exist ing filt ering t echniques

Inte rnatio nal Jo urnal o f Sc ie ntific & Eng inee ring Re se arc h, Vo lume 3, Issue 2, February -2012 4

ISS N 2229-5518

TABLE 1

PERFORMANCE OF PSNR FOR DIFFERENT FILTERING TECH- NIQ UES ON LENA IMAGE

Filt ering

Techniques

Noise percent age

10 20 30 40 50 70 90

MF 31.74 28.23 23.20 18.80 15.28 9.98 6.58

WMF 23.97 23.06 22.58 21.65 20.11 15.73 8.83

CWMF 28.72 23.80 20.28 17.28 14.45 10.04 6.75

T SMF 31.89 27.35 23.96 19.46 15.82 10.33 6.58

MDBSMFS 34.83 30.03 24.79 20.59 16.99 11.28 6.97

NID 37.90 31.85 28.75 26.52 23.42 14.65 7.77

DBSMF 38.42 34.28 30.47 27.38 24.92 18.84 10.03

IDBA 36.5 33.39 29.72 28.64 26 23.5 19.3

NFT 39.30 35.66 32.70 30.01 27.73 23.73 17.69

Proposed

Filt er 51.29 43.46 39.89 35.86 33.07 26.31 18.72



The filtered images are pres ented in Fig.4 for vis ual perception and subjective evaluation. The propos ed new nonlinear filter can be seen to have eliminated the impuls e noise completely. The filter is s een to exhibit s uperior noise cleaning properties on Pepper image in co m- parison with the other test images in the presence of impuls e nois e. This is due to the fact that the Pepper image is replete with the ho- mogeneous regions and fine details . At the same time, the filter is s een to exhibit poor nois e cleaning properties on Baboon image in
co o impuls e 45
nois h lete with
the i i are non- 40
stat e ges are cha n this filter

Baboon Lena rice

Pepper

is b a1

t b1 c1

roved
deci it

30

25

a2 b2 c2 20

15

10 20 30 40 50 60 70 80 90

Noise percentage

a3 b3 c3

a4 b4 c4

Fig.4 Subject ive performance illust rat ion of proposed filtering algo- rit hm for Baboon, Lena, Rice and Pepper images:(a1 ,2 & 3)noise free image (b1 ,2 ,& 3) Lena image corrupted wit h 50% impulse noise, (c1 ,2 &

3 ) proposed filt ered images.

Fig.5 PSNR obtained by applying proposed filter for different im- ages corrupted with various densities of impulse noise

The values of objective measures obtained by applying the filters on different tes t images contaminated with the impulse nois e of v arious nois e dens ities are summarized in Table 2 and are illus trated graphi- cally in Figure.5

IJSER © 2012

http :// www.ijser.org

Inte rnatio nal Jo urnal o f Sc ie ntific & Eng inee ring Re se arc h, Vo lume 3, Issue 2, February -2012 5

ISS N 2229-5518

4 CONCLUS ION

A s witching median filtering technique has been developed in this paper. The filter has been shown to be quite effective in elimina ting the impuls e nois e. The filtering operation is performed only on co r- rupted pixels , uncorrupted pixels are undisturbed; as a result, mis- class ification of pixels is avoided. So that the propos ed filter output images are found to be pleasant for visual perception and als o the essential features of the images , namely, edges and fine details are pres erved satis factorily. The proposed filter has been shown to ou t- perform other exis ting filters in terms of nois e elimination and fe a- ture pres ervation properties .

REFERENCES

[1] Pitas. I and Venetsanopolous . “A Nonlinear Digital Filters: Prin- ciples and Application‖, Norwell, MA: Kluwer, 1990 .

[2] Astola. Jand Kuosmanen.P, ― Fundamentals of Nonlinear

Digital Filtering‖, Boca Raton, FL: CRC, 1997.

[3] Sun.T and Neuvo.Y, ―Detail – preserving median based fil-

ters in image processing‖, Pattern Recognition Letter, Vol.15,pp.

341– 347, 1994.

[4] Tzu - Chao Lin and Pao –TaYu, Salt – Pepper Impulse noise detection and removal using Multiple Thresholds for image restoration ‖, Journal of Information science and Engineering, vol.4, pp 189-198, June 2006.

[5] R. H. Chan Chung– Wa Ho, M. Nikolova, ―Salt and Pepper

Noise Removal by Median Type Noise Detectors and Detail – Preserving Regularizatio‖, IEEE Trans on Image Processing, Vol. 14, No.10, pp.1479-1485, Oct. 2005.

[6] P ei - Eng Ng and Kai - Kuang Ma, ― A Swit ching Median Filt er

wit h Boundary Discriminat iv Noise Det ect ion for Extremely Corrupt ed Images‖, IEEE Trans. on Image Process, Vol.15, no.6, Jun. 2006.

[7] Florencio.D and Schafer.R, ″ Decision–based median filter

using local signal statistics ‖, in Proc. SPIE Int Symp. Visual

Communications image Processing, Chicago, Sept. 1994.

[8] Madhu S. Nair, K.Revathy, Rao Tatavarti, "An Improved Deci- sion Based Algorithm for Impulse Noise Removal" , Proceed- ings of International Congress on Image and Signal Processing - CISP IEEE Computer Society Press, Sanya, Hainan, China, Vol.1, pp.426- 431, May 2008.

[9] V. Jayaraj and D. Ebenezer, ―A New Adaptive Decision Based Robust Statistics Estimation Filter for High Density Impulse Noise in Images and Videos‖,International Conference on Control, Automation, Communication and Energy conversion, 2009.

[10] Fei Duan and Yu – Jin Zhang, ―A Highly Effective Impulse

Noise Detection Algorithm for Switching Median Filters‖,

EEE Signal Processing Letters,Vol.17, No.7, July, 2010.

TABLE 2

PSNR VALUES OBTAINED USING PROPSED FILTER ON

DIFFERENT TEST IMAGES CONTAMINATED WITH

VARIOUS DENSITIES OF IMPULSE NOISE

Noise percent age

Baboon

Lena

Rice

P epper

10

34.22

39.57

38.27

43.35

20

30.91

35.63

34.17

38.92

30

28.51

32.41

31.27

36.28

40

26.67

30.37

28.95

33.88

50

24.91

28.13

27.89

31.08

60

23.69

25.91

24.68

28.61

70

22.10

23.68

22.36

25.95

80

20.52

21.16

19.95

22.12

90

18.34

17.52

16.90

19.39

IJSER © 2012

http :// www.ijser.org