Top Banner
Performance enhancement and analysis o f a n adaptive median filter Yanming Zhao, Dongmei L i, a n d Zhaohui L i Abstract-The classical adaptive median filter i s designed t o remove t h e positive a n d negative impulse noise when t h e probability o f noise i s high. B u t simulation shows t h e filtered images remain t h e positive impulse noise i n t h e black background a nd t h e negative impulse noise i n t h e white background. In this paper, t h e classical adaptive median filter i s modified and i t s performance i s improved. Simulation results show t h e new scheme provides t h e better filtering performance. Index Terms-median filter, impulse noise, image restoration I . INTRODUCTION I N image processing, images a r e often corrupted b y th e positive a n d negative impulse noise d u e t o decoding error or noisy channel. S o i t is an important task to filter th e corrupted images. T he median filter ca n remove t h e impulse noise efficiently [1]. B u t i t is difficult t o remove the impulse noise a n d preserve image sharpness concurrently when th e probability o f impulse noise becomes high. To overcome this situation, adaptive median filter i s proposed [2-5]. T h e classical adaptive median filter [ 2 ] c a n efficiently remove the positive a n d negative impulse noise even though t h e probability o f impulse noise is high. B u t this h a s some deficiencies: the filtered images remain t h e positive impulse noise i n th e black background and t h e negative impulse noise i n t h e white background. T o solve the above questions, th e classical adaptive median filter is modified a n d i t s performance is improved. Experimental results show t h e modified scheme provides t h e better filtering performance. I I. T H E CLASSICAL ADAPTIVE MEDIAN FILTER T h e basic difference between t h e adaptive median filter [ 2 ] a n d standard median filter i s that, i n adaptive median filter, the window size i s variable. T h e algorithm i s described a s follows: Adaptive median filter works o n a rectangular region X Y I t changes t h e size o f Sx y during t h e filtering operation depending o n certain conditions a s listed below. T he output o f t h e filter i s a single value which replaces th e current pixel value a t (x, y ) , t h e point o n which S i s centered a t t h e time. T he Y . Zhao, D . L i , a n d Z. L i a r e with t he Information Engineering School, Communication University o f China, P . R. China (phone:+86-10-65779091; fax: +86-10-65779368; e-mail: yanmingzhao(cuc.edu.cn, 1dm(cuc.edu.cn, lizhh(cuc.edu.cn). following notation i s used: Z m n = minimum pixel value i n S Zmax = maximum pixel value i n S X Y Zmed = median pixel value in S X Y x y= pixel value a t coordinates ( x , y ) Smax = maximum allowed size of S X Y T h e adaptive median filter works i n t w o levels, denoted Level A a n d Level B , a s follows: Level A : I f z . < z < z m i n med max G o t o level B Else increasethe window size window size < = Smax repeat level A Else output Z X Y Level B : I f z <Z <Z m i n xy max I output z XY Else ( 1 ) output Zm ed - N o w w e analyze t h e adaptive median filter. Impulse noise c a n b e negative o r positive. Because impulse corruptionusually i s large compared with t h e strength of t h e image signal, negative impulse generally i s digitized a s t h e minimum values and positive impulses generally i s digitized a s t h e maximum values. I f Zmin < Zmed < Zmax Zmed i s n o t an impulse noise. I n this case, w e g o t o Level B . T h e basic idea o f Level B i s a s follows: Z i s evaluated to verify whether i t i s a n impulse o r not. If i t i s a n impulse, i t will b e replaced b y Zmed. Otherwise, Z x y i s n o t a n impulse. z xy i s retained i n t h e filtered image. Thus, unless t h e pixel being considered i s a n impulse, t h e pixel value i n th e filtered image i s t h e same a s that of t h e input image. This ca n avoid unnecessary loss o f detail. Adaptive median filter solves the dual purpose o f removing t h e impulse noise from the image a n d reducing distortion i n t h e Authorized licensed use limited to: PSG College of Technology. Downloaded on January 3, 2010 at 00:05 from IEEE X plore. Restrictions apply.
3

C Documents and Settings Pg.eee1234.000 Local Settings Application Data Mozilla Firefox Profiles

Apr 07, 2018

Download

Documents

Badri Nath
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: C Documents and Settings Pg.eee1234.000 Local Settings Application Data Mozilla Firefox Profiles

8/3/2019 C Documents and Settings Pg.eee1234.000 Local Settings Application Data Mozilla Firefox Profiles

http://slidepdf.com/reader/full/c-documents-and-settings-pgeee1234000-local-settings-application-data-mozilla 1/3

Performance enhancement and analysis of an

a d a p t i v emedian

f i l t e rYanming Z h a o , Dongmei L i , a n d Z h a o h u i L i

A b s t r a c t - T h e c l a s s i c a l a d a p t i v e m e d i a n f i l t e r i s d e s i g n e d t or e m o v e t h e p o s i t i v e a n d n e g a t i v e i m p u l s e n o i s e when t h e

p r o b a b i l i t y o f i m p u l s e n o i s e i s h i g h . B u t s i m u l a t i o n s h o w s t h e

f i l t e r e d i m a g e s r e m a i n t h e p o s i t i v e i m p u l s e n o i s e i n t h e b l a c k

b a c k g r o u n d a n d t h e n e g a t i v e i m p u l s e n o i s e i n t h e w h i t e

b a c k g r o u n d . I n t h i s p a p e r , t h e c l a s s i c a l a d a p t i v e m e d i a n f i l t e r i s

m o di f i ed a n d i t s p e r f o r m a n c e i s i m p r o v e d . S i m u l a t i o n r e s u l t s

s h o w t h e new s c h e m e p r o v i d e s t h e b e t t e r f i l t e r i n g p e r f o r m a n c e .

I n d e x Terms-median f i l t e r , i m p u l s e n o i s e , i m a g e r e s t o r a t i o n

I . INTRODUCTION

IN i m a g e p r o c e s s i n g , i m a g e s a r e o f t e n c o r r u p t e d b y t h ep o s i t i v e a n d n e g a t i v e i m p u l s e n o i s e d u e t o d e c o d i n g e r r o r o r

n o i s y c h a n n e l . S o i t i s a n i mp o rt a nt t a s k t o f i l t e r t h e c o r r u p t e di m a g e s . T h e m e d i a n f i l t e r c a n r e m o v e t h e i m p u l s e n o i s ee f f i c i e n t l y [ 1 ] . B u t i t i s d i f f i c u l t t o r e m o v e t h e i m p u l s e n o i s ea n d p r e s e r v e i m a g e s h a r p n e s s c o n c u r r e n t l y w h e n t h ep r o b a b i l i t y o f i m p u l s e n o i s e b e c o m e s h i g h . To o v e r c o m e t h i s

s i t u a t i o n , a d a p t i v em e d i a n f i l t e r i s p r o p o s e d

[ 2 - 5 ] .T h e c l a s s i c a l a d a p t i v e m e d i a n f i l t e r [ 2 ] c a n e f f i c i e n t l yr e m o v e t h e p o s i t i v e a n d n e g a t i v e i m p u l s e n o i s e e v e n t h o u g h

t h e p r o b a b i l i t y o f i m p u l s e n o i s e i s h i g h . B u t t h i s f i l t e r h a s s o m e

d e f i c i e n c i e s : t h e f i l t e r e d i m a g e s r e m a i n t h e p o s i t i v e i m p u l s en o i s e i n t h e b l a c k b a c k g r o u n d a n d t h e n e g a t i v e i m p u l s e n o i s e i nt h e w h i t e b a c k g r o u n d . To s o l v e t h e a b o v e q u e s t i o n s , t h ec l a s s i c a l a d a p t i v e m e d i a n f i l t e r i s m o d i f i e d a n d i t s p e r f o r m a n c e

i s i m pr o v ed . E x p e ri m en t a l r e s u l t s s h o w t h e m o d i f i e d s c h e m e

p r o v i d e s t h e b e t t e r f i l t e r i n g p e r f o r m a n c e .

I I . T HE CLASSICAL ADAPTIVE MEDIAN FILTER

T h e b a s i c d i f f e r e n c e b e t w e e n t h e a d a p t i v e m e d i a n f i l t e r [ 2 ]a n d s t a n d a r d m e d i a n f i l t e r i s t h a t , i n a d a p t i v e m e d i a n f i l t e r , t h ew i n d o w s i z e i s v a r i a b l e . T h e a l g o r i t h m i s d e s c r i b e d a s f o l l o w s :

A d a p t i v e m e d i a n f i l t e r w o r k s o n a r e c t a n g u l a r r e g i o n S X Y . I t

c h a n g e s t h e s i z e o f S x y d u r i n g t h e f i l t e r i n g o p e r a t i o n

d e p e n d i n g o n c e r t a i n c o n d i t i o n s a s l i s t e d b e l o w . T h e o u t p u t o f

t h e f i l t e r i s a s i n g l e v a l u e w h i c h r e p l a c e s t h e c u r r e n t p i x e l v a l u e

a t ( x , y ) , t h e p o i n t o n w h i c h S i s c e n t e r e d a t t h e t i m e . T h e

Y . Z h a o , D . L i , a n d Z . L i a r e w i t h t h e I n f o r m a t i o n E n g i n e e r i n g S c h o o l ,C o m m u n i c a t i o n U n i v e r s i t y o f C h i n a , P . R . C h i n a ( p h o n e : + 8 6 - 1 0 - 6 5 7 7 9 0 9 1 ;

f a x : + 8 6 - 1 0 - 6 5 7 7 9 3 6 8 ; e - m a i l : y a n m i n g z h a o ( c u c . e d u . c n , 1 d m ( c u c . e d u . c n ,l i z h h ( c u c . e d u . c n ) .

f o l l o w i n g n o t a t i o n i s u s e d :

Z m n = m i n i m u m p i x e l v a l u e i n S

Z m a x = maximum p i x e l v a l u e i n S X YZ m e d = m e d i a n p i x e l v a l u e i n S X Y

x y = p i x e l v a l u e a t c o o r d i n a t e s ( x , y )

S m a x = maximum a l l o w e d s i z e o f S X YT h e a d a p t i v e m e d i a n f i l t e r w o r k s i n t w o l e v e l s , d e n o t e d

L e v e l A a n d L e v e l B , a s f o l l o w s :

L e v e l A :

I f z. < z < zm i n med max

Go t o l e v e l BE l s e

i n c r e a s e t h e w i n d o w s i z e

I f w i n d o w s i z e <= S m a xr e p e a t l e v e l A

E l s e

o u t p u t Z X YL e v e l B :

I f z <Z <Zm i n xy max I

o u t p u t z X YE l s e

( 1 )

o u t p u t Zm e d -

Now we a n a l y z e t h e a d a p t i v e m e d i a n f i l t e r . I m p u l s e n o i s ec a n b e n e g a t i v e o r p o s i t i v e . B e c a u s e i m p u l s e c o r r u p t i o n u s u a l l yi s l a r g e c o m p a r e d w i t h t h e s t r e n g t h o f t h e i m a g e s i g n a l ,

n e g a t i v e i m p u l s e g e n e r a l l y i s d i g i t i z e d a s t h e minimum v a l u e sa n d p o s i t i v e i m p u l s e s g e n e r a l l y i s d i g i t i z e d a s t h e maximum

v a l u e s . I f Z m i n < Z m e d < Z m a x Z m e d i s n o t an i m p u l s e n o i s e .

I n t h i s c a s e , we g o t o L e v e l B . T h e b a s i c i d e a o f L e v e l B i s a s

f o l l o w s : Z i s e v a l u a t e d t o v e r i f y w h e t h e r i t i s a n i m p u l s e o r

n o t . I f i t i s a n i m p u l s e , i t w i l l b e r e p l a c e d b y Z m e d . O t h e r w i s e ,

Z x y i s n o t a n i m p u l s e . z x y i s r e t a i n e d i n t h e f i l t e r e d i m a g e .

T h u s , u n l e s s t h e p i x e l b e i n g c o n s i d e r e d i s a n i m p u l s e , t h e p i x e lv a l u e i n t h e f i l t e r e d i m a g e i s t h e s a m e a s t h a t o f t h e i n p u t i m a g e .T h i s c a n a v o i d u n n e c e s s a r y l o s s o f d e t a i l .

A d a p t i v e m e d i a n f i l t e r s o l v e s t h e d u a l p u r p o s e o f r e m o v i n g

t h e i m p u l s e n o i s e f r o m t h e i m a g e a n d r e d u c i n g d i s t o r t i o n i n t h e

Authorized licensed use limited to: PSG College of Technology. Downloaded on January 3, 2010 at 00:05 from IEEE Xplore. Restrictions apply.

Page 2: C Documents and Settings Pg.eee1234.000 Local Settings Application Data Mozilla Firefox Profiles

8/3/2019 C Documents and Settings Pg.eee1234.000 Local Settings Application Data Mozilla Firefox Profiles

http://slidepdf.com/reader/full/c-documents-and-settings-pgeee1234000-local-settings-application-data-mozilla 2/3

i m a g e . I t can h a n d l e an i m a g e c o r r u p t e d w i t h i m p u l s e n o i s e o f

p r o b a b i l i t y g r e a t e r t h a n 0 . 2 . And g i v e a much b e t t e r o u t p u t

i m a g e t h a n s t a n d a r d m e d i a n f i l t e r .

III. T HE IMPROVED ADAPTIVE MEDIAN FILTER

A . T h e m o d i f i e d a d a p t i v e m e d i a n f i l t e r

T h e r e are some d e f i c i e n c i e s i n t h e a b o v e a l g o r i t h m . I t i s

known t h a t t h e c o n d i t i o n Z m i n l <Zmed Z i s a l w a y s

s a t i s f i e d . When Z m i n < Zmed < Z m a x go t o l e v e l B . O t h e r w i s e ,

when Z m i n M Zmed<max Zmin <Zmed Zmax or

Zmin Zmed =Z m a x . i t i s k e p t i n l e v e l A a n d t h e window s i z e i s

i n c r e a s e d . When Smax i s r e a c h e d , t h e a l g o r i t h m o u t p u t s t h e

v a l u e o f zxy

N e g a t i v e i m p u l s e appears as b l a c k p o i n t ( p e p p e r n o i s e ) i n an

i m a g e a n d p o s i t i v e i m p u l s e appears as w h i t e p o i n t ( s a l t n o i s e ) .When t h e b l a c k i m a g e i n a window i s c o r r u p t e d b y i m p u l s e

n o i s e s , t h e r e are b l a c k a n d w h i t e p i x e l s . F o r an 8 - b i t i m a g e , i t

means t h e p i x e l v a l u e s are 0 or 2 5 5 . B u t most o f t h e p i x e l

v a l u e s are 0 . S o Z m i n = Zmed = 0 Zmax = 255. E v e n t h e

window s i z e i s i n c r e a s e d t o m a x i m u m ,

Zmin = Zmed =°Z =255. In this c a s e , the o u t p u t valuem'n med max

s h o u l d b e 0 . B u t , a c c o r d i n g t o t h e a l g o r i t h m , t h e o u t p u t v a l u e i s

e q u a l t o zX . Z X Y may b e any v a l u e b e t w e e n 0 a n d 2 5 5 . S o t h e

s a l t n o i s e can n o t b e f i l t e r e d i n t h e b l a c k b a c k g r o u n d o f

c o r r u p t e d i m a g e . F o r t h e same reason, t h e pepper n o i s e can n o t

b e r e m o v e d i n t h e w h i t e b a c k g r o u n d .

I f t h e o u t p u t v a l u e i s c h a n g e d f r o m Z x y t o Zmed i n t h e

e x p r e s s i o n ( 1 ) , t h e a b o v e q u e s t i o n s can b e s o l v e d . F o r t h e b l a c k

i m a g e , Z m i n= Z < Zmax o u t p u t i s Z

-Z m i n 0 . F o r, m i nm e d m Z m e d mi

the white image, zmi <Zme =m ,output is

Zmed Zmax 255 F o r t h e g e n e r a l i m a g e ,

Z m i n < Zmed <Z the algorithm goes to level B.min m e d max~teagrtmge olvlB

B . S i m u l a t i o n r e s u l t s

To v a l i d a t e t h e m o d i f i e d a l g o r i t h m , s i m u l a t i o n s are

p e r f o r m e d on an X -r a y i m a g e o f a c i r c u i t b o a r d u s e d i n [ 2 ] a n da f i n g e r p r i n t p i c t u r e . F i g u r e 1 ( a ) i s t h e c o r r u p t e d c i r c u i t b o a r d

i m a g e w i t h t h e i m p u l s e n o i s e p r o b a b i l i t i e s o f 0 . 2 5 . H e r e t h en o i s e l e v e l i s h i g h e n o u g h t o o b s c u r e most o f t h e d e t a i l i n t h e

i m a g e . T h e i m a g e i s f i l t e r e d f i r s t l y u s i n g s t a n d a r d m e d i a n f i l t e r .

T h e r e s u l t i s s h o w n i n f i g u r e 1 ( b ) . A l t h o u g h n o i s e i s e f f e c t i v e l yr e m o v e d , t h e f i l t e r causes s i g n i f i c a n t l o s s o f d e t a i l i n t h e i m a g e .

F i g u r e l ( c ) s h o w s t h e r e s u l t o f u s i n g a d a p t i v e m e d i a n f i l t e r .

N o i s e i s m o s t l y r e m o v e d a n d i m a g e d e t a i l s are p r e s e r v e d .H o w e v e r , pepper n o i s e s t i l l can b e o b s e r v e d i n t h e b l a c k r e g i o n

o f t h e i m a g e , s u c h as t h e c o n n e c t o r s a t t h e l e f t - t o p o f t h e i m a g e .

F i g u r e l ( d ) s h o w s t h e r e s u l t o f t h e m o d i f i e d a d a p t i v e m e d i a n

f i l t e r . P e p p e r n o i s e i n t h e b l a c k r e g i o n o f t h e i m a g e i s r e m o v e d

e f f i c i e n t l y . I m p r o v e m e n t over t h e c l a s s i c a l a d a p t i v e median

f i l t e r i s q u i t e s i g n i f i c a n t . T h e s i m i l a r c o n c l u s i o n can b e d r a w n

f o r t h e f i n g e r p r i n t p i c t u r e .

T h e PSNR r e s u l t s are s h o w n i n T a b l e 1 .

F i g . 1 . C o m p a r i s o n o f t h e d i f f e r e n t m e t h o d s . ( a ) N o i s y image; ( b ) S t a n d a r d

m e d i a n f i l t e r ; ( c ) A d a p t i v e m e d i a n f i l t e r ; ( d ) M o d i f i e d a d a p t i v e m e d i a n f i l t e r .

T A B L E I

PSNR ( D B ) RESULTS FOR SEVERAL M E T H O D S

I V . C O N C L U S I O N

T h e c l a s s i c a l a d a p t i v e m e d i a n f i l t e r h a s some d e f i c i e n c i e s :

t h e f i l t e r e d i m a g e s r e m a i n t h e p o s i t i v e i m p u l s e n o i s e i n t h e

b l a c k b a c k g r o u n d a n d t h e n e g a t i v e i m p u l s e n o i s e i n t h e w h i t e

b a c k g r o u n d . To s o l v e t h e a b o v e q u e s t i o n s , a m o d i f i e d s c h e m e

i s p r o p o s e d . E x p e r i m e n t r e s u l t s s h o w s t h e p r o p o s e d s c h e m e

can i m p r o v e t h e f i l t e r i n g p e r f o r m a n c e s i g n i f i c a n t l y .

REFERENCES

[ 1 ] P . G o u c h o l , J . C . L i u , a n d A . S . N a i r , S e l e c t i v e r e m o v a l o f i m p u l s e noise

b a s e d on h o m o g e n e i t y l e v e l i n f o r m a t i o n , IEEE T r a n s . I m a g e P r o c e s s i n g ,1 2 , 8 5 ( 2 0 0 3 ) .

[ 2 ] R . C . G o n z a l e z a n d R . E . W o o d s , D i g i t a l I m a g e P r o c e s s i n g - S e c o n d

E d i t i o n ( B e i j i n g , P u b l i s h i n g House o f E l e c t r o n i c s I n d u s t r y , 2 0 0 3 ) .

[ 3 ] H . H w a n g , a n d R . A . H a d d a d , A d a p t i v e median f i l t e r s : new a l g o r i t h m sa n d r e s u l t s , IEEE T r a n s . I m a g e P r o c e s s i n g , 4 , 499 ( 1 9 9 5 ) .

t h e i m p u l s e noise p r o b a b i l i t i e s0 . 1 0 0 . 1 5 0 . 2 0 0 . 2 5

c i r c u i t b o a r d

f i l t e r 2 2 . 4 2 2 . 2 2 2 . 0 2 1 . 6

a d a p t i v e m e d i a n 2 6 . 8 2 5 . 3 2 3 . 6 2 2 . 7fi lte r__

m o d i f i e da d a p t i v e m e d i a n 3 2 . 8 3 0 . 8 2 8 . 8 2 7 . 7

filter I _ _f i n g e r p r i n t

s t a n d a r d m e d i a n 1 9 . 3 1 8 . 9 1 8 . 5 1 8 . 1fi lte r__

a d a p t i v e m e d i a n 2 4 . 8 2 3 . 7 2 2 . 6 2 1 . 8

fi lte r__

m o d i f i e d

a d a p t i v e m e d i a n 2 5 . 1 2 4 . 2 2 3 . 0 2 2 . 2f ilte

I I

Authorized licensed use limited to: PSG College of Technology. Downloaded on January 3, 2010 at 00:05 from IEEE Xplore. Restrictions apply.

Page 3: C Documents and Settings Pg.eee1234.000 Local Settings Application Data Mozilla Firefox Profiles

8/3/2019 C Documents and Settings Pg.eee1234.000 Local Settings Application Data Mozilla Firefox Profiles

http://slidepdf.com/reader/full/c-documents-and-settings-pgeee1234000-local-settings-application-data-mozilla 3/3

[ 4 ] H . L . E n g a n d K . K . M a , N o i s e a d a p t i v e s o f t - s w i t c h i n g m e d i a n f i l t e r ,

I E E E T r a n s . I m a g e P r o c e s s i n g , 1 0 , 2 4 2 ( 2 0 0 1 ) .[ 5 ] E . A b r e u , M . L i g h t s t o n e , S . K . M i t r a , a n d K . A r a k a w a , A new e f f i c i e n t

a p p r o a c h f o r t h e r e m o v a l o f i m p u l s e n o i s e f r o m h i g h l y c o r r u p t e d i m a g e s ,

I E E E T r a n s . I m a g e P r o c e s s i n g , 5 , 1 0 1 2 ( 1 9 9 6 ) .Yanming Z h a o r e c e i v e d t h e P H . D . d e g r e e f r o m S c h o o l o f T e l e c o mm u n i ca t i o n

E n g i n e e r i n g i n B e i j i n g U n i v e r s i t y o f P o s t s a n d T e l e co m m u ni c a t io n s i n 2 0 0 5 .S h e i s now a n a s s i s t a n t p r o f e s s o r i n t h e I n f o r m a t i o n E n g i n e e r i n g S c h o o l ,C o m m u n i c a t i o n U n i v e r s i t y o f C h i n a , P . R . C h i n a . H e r m a i n r e s e a r c h i n t e r e s t sa r e i m a g e p r o c e s s i n g a n d v i d e o c o d i n g .

Authorized licensed use limited to: PSG College of Technology Downloaded on January 3 2010 at 00:05 from IEEE Xplore Restrictions apply