Mar 2007 Journal of Electronic Science and Technolog of China Vol5 No Adaptive Threshold Median Filter for Multiple-Impulse Noise JIANG Bo HUANG Wei School of Communication and Information Engineering Universit of Electronic Science and Technolog of China Chengdu 60054 China Abstract Attenuating the noises plas an essential role in the image processing Almost all the traditional median filters concern the removal of impulse noise having a single laer whose noise gra level value is constant In this paper a new adaptive median filter is proposed to handle those images corrupted not onl b single laer noise The adaptive threshold median filter (ATMF) has been developed b combining the adaptive median filter (AMF) and two dnamic thresholds Because of the dnamic threshold being used the ATMF is able to balance the removal of the multiple-impulse noise and the qualit of image Comparison of the proposed method with traditional median filters is provided Some visual examples are given to demonstrate the performance of the proposed filter Ke words median filter; adaptive median filter (AMF); adaptive threshold median filter (ATMF); multiple-impulse noise; image processing Images are often corrupted b impulse noise due to errors generated from sensors or communicational channels It is important to eliminate noise from images before edge detection image segmentation and object recognition procedures The well-known median filter (MF) and its derivatives have been recognized as an effective means of removing impulse noise [-6] The success of median filters is based on two main properties: edge preservation and efficient noise attenuation with robustness against the impulsive-tpe noises Edge preservation is essential in image processing owing to the nature of visual perception [7] Despite its effectiveness in smoothing noise MF tends to remove fine details when applied to an image uniforml To eliminate this drawback a famous modified median filter the adaptive median filter (AMF) has been proposed [8] It has variable window sizes for removing impulses while preserving sharpness at the same time In this wa the integrit of edge and detail information becomes better [9] The filters mentioned above are not good at removing multiple-impulse noise However practical situation is that images are often corrupted b multiple-impulse noises including single laer noise In this paper a decision-based and signal-adaptive median filter is proposed Not onl does it achieve both the strong detection of impulse noise and the visual qualit for restoration results but also it does well in anti-multiple noise For the identification of the noise a new criterion has been added in AMF to increase the effect handling multiple noises Thereafter the new filter named adaptive threshold median filter (ATMF) adds two dnamic thresholds of the local kernel area to help detect noises Simulations demonstrate that this filter is as good as AMF for one laer impulsive noise but better than man other median filters for multiple-impulse noise Adaptive Median Filter The novel filter processing principles are based on the AMF AMF works in a rectangular kernel area S and changes (increases) the size of S during filtering operation depending on certain conditions listed below If the filter does find that the pixel at ( ) is noise in the kernel center the value of the pixel will be replaced b the median value in S Otherwise the pixel gra level value will remain the same Consider the following definition: min = minimum gra level value in S max = maximum gra level value in S med = median of gra level in S = gra level at coordinates ( ) S max = maximum allowed size of S The adaptive median filtering algorithm works in two levels denoted level A and level B as follows: Level A A = med min A2 = med max If A >0 AND A 2 <0 go to level B Or else increase the window size If window size S max repeat level A Or else output Received 2006-03-3
No JIANG Bo et al: Adaptive Threshold Median Filter for Multiple-Impulse Noise 7 Level B B = x m in B = 2 x med If B >0AND B 2 <0 output Or else output med Ever time the algorithm outputs a value the window S is moved to the next location in the image The algorithm then is reinitialized and applied to the pixels in the new location AMF can achieve good results in suppressing noises of various densities It sometimes changes its kernel maximum size in order to suit for different conditions One wa is to use different kernel mean filters to process images and determine the AMF kernel maximum size 2 Adaptive Threshold Median Filter In some applications images to be processed are often corrupted b multiple-impulse noise Experiments have shown that AMF has certain effect on images of low densit multiple-impulse noise such as the probabilit less than 0 If removing higher probabilit such as 02 03 or even more than 04 AMF fails to give content results Increasing kernel size could do better in suppressing noises but at the same time the image would become worse in details The extended adaptive median filter (EAMF) testifies that the impulsive noise values sometimes are not onl 255 or 0 [0] The noise ma be slightl less than 255 or higher than 0 Thus in the EAMF algorithm the pixel values close to 255 or 0 in a filter window are also discarded before computing median value Therefore EAMF can suppress more diverse noise while keeping details In our experiments we find that in some situations EAMF can not give a satisfied improvement from AMF Thus we change our AMF based on the theor similar to Refs[6] and [0] Motivated b the randoml valued impulse detection mechanisms developed in Refs[] and [2] two dnamic thresholds T and T 2 are introduced to the AMF The are defined as follows: T ( ) = Xmin 2 Xmin () T2( ) = Xmax X max2 (2) where X min is the smallest value X min2 is the second small in the initial window X max is the largest value and X max2 is the second large Then we adjust the AMF judging condition: A = med min T A2 = med max + T2 B = x min T B2 = x max + T 2 However in some circumstances the multiple-noise does not indicate that the noise value has onl two laers such as value 255 253 3 and 0 If the image is affected b more laer noises the reasonable T and T 2 can not be obtained b above wa b Eqs() and (2) Therefore we change the identification principle to deal with these complicated situations The identification principle in ATMF algorithm is given as follows ) Initialization: Let P be a vector used to store the gra level at coordinates (i j) and initiate all the elements P () t = 0 The vector size W = K K varies among 9 25 or 49 correspond to the kernel size K of 3 5 or 7 respectivel At the same time initiate T =T 2 =0 2) LOOP: () Define the value of PT ( = W/2+ ) corresponding to the pixel gra level at ( ) in processing image on the particular point ( ) the window S is centered at a given time The values of P( t = K j+ i) are initiated again as follows: Pt () = { i j x ( K ) /2 i x+( K )/2 ( K ) /2 j + ( K )/2 } (2) Rearrange the values of P(t): store the smallest one in P (0) then the values from the smaller ones to the larger ones; finall the largest one stores in P( n ) where n equals W (3) Get T For T affects min the analsis begins with P (0) to the larger ones (4) LOOP: a) Get D ab (a and b are the sequence numbers of compared pixels Initial value of a = 0 b = ) D ab is the difference between P( a ) and P( b ) If D ab =0 go to b) else if D ab = go to c) else if Dab go to e) b) If Da+ b+ go to f) c) If Da+ b+ go to f) d) If b= R T = D quit (4) where D = D0b else a= a+ b= b+ return to ) e) T = D quit (4) where D = D0b
72 Journal of Electronic Science and Technolog of China Vol5 f) T = D quit (4) where D = D 0 b + (5) Get T 2 The procedure is similar with T For the T 2 affects max there are some changes The analsis starts from P(n) to the smaller ones And initial values of a= n b= n In d) before returning a) let a= a b= b 3) UNTIL terminating condition In the above algorithm T d is used to judge whether pixel is corrupted or not in some area of an image It can be get from the histogram To real-time applications it can be initiated from 5 to 20 R=W P a is decided b the noise probabilit P a In e) and f) in order to avoid eliminating P(b) or P(b+) processed as the non-corrupted pixel let T = D or T 2 = D In d) since the algorithm can not determine with T d whether P( b ) is corrupted or not let T = D For man images the values of pixels assemble in the center of the histogram Some values are distributed to the two poles of histogram (approximates 0 or 255) but when considering filtering impulsive noise the are ignored like MF and its derivatives Based on those presuppositions the principle of dnamic threshold is to compare different pixel values Firstl the pixel values of one area are arranged from the smallest to the biggest one Secondl the difference of the two neighboring pixels is computed from the largest or smallest one If the difference compared with T d is big enough the smallest or largest non-corrupted value can be got Thus T determined b non-corrupted smallest value or T 2 determined b non-corrupted largest value can be obtained Then new T and T 2 replace the old ones obtained b Eqs() and (2) to adjust the AMF judging condition 3 Experimental Results and Analsis The noise considered in this work is bipolar impulse noise The one laer impulse noise means fixed value 255 (salt) and 0 (pepper) for all the impulses The probabilit of impulse noise is equal To multiple-impulse noises the values of noises are also presumed to have the same probabilit However those values are correspondingl evenl distributed in the two poles For the experiments 8-bit 272 256 Blood image and 256 256 Lara image are corrupted b 20% and 40% of single-laer impulse noise and 30% and 40% of multiple-impulse noise respectivel A number of simulations are performed b varing the kernel size of each method: 3 5 or 7 For performance measurements we use the mean square error (MSE) and the peak signal-to-noise ratio (PSNR) Moreover in order to better displa the function of the dnamic threshold a special ATMF with static thresholds (T =T 2 =5) (ASTMF) is compared with the ATMF One important characteristic of AMF ASTMF and ATMF is that the can attenuate almost all the one laer impulse noise as illustrated in Fig and Fig2 Their performances are better than MF especiall in high noise pollution when saving details like the edge of bloods In Fig Fig2 and Tab after the new identification principle is introduced in AMF algorithm the performance of ATMF is the same as AMF even better in static data Also it is better than ASTMF The reason is that dnamic save more details than static thresholds Moreover as the number of noise laers graduall increases the performance of proposed filter becomes better as shown in Fig3 and Fig4 Fig3(a) is the Lara image corrupted b 30% multiple-impulse noises where the value is 255 253 250 6 3 and 0 Fig3(b) displas that MF removes almost all the noises but the details have been severel damaged Fig3(c) is the result from AMF The detail is better than that of the median filter However marked impulse noises are left in images It is not good at reducing multiple-impulse noise Fig4(d) and (e) reveal the results of ASTMF and ATMF (T d = 7) Their performances are obviousl better than that of AMF not onl in details Both of them remove almost all of the multiple noises Compared with MSE and PSNR data are mostl the same The former MSE is 50 and PSNR 303 the latter MSE 4937 and PSNR 320 Those data show that the static threshold filter can well remove multiple-impulse noise if the value of static threshold is sound In simulations the same results are revealed in the Lara image To displa the advantage of dnamic threshold we have designed some special images to testif the efficienc of two kinds of threshold In Fig4 the Lara image is corrupted b 40% multiple-impulse noise The impulsive noises value 235 and 9 are beond the range that can be detected b ASTMF threshold The results are shown in Fig4 Although the ATMF with T d = 7 cannot remove all the noise it can remove noises far more than ASTMF In fact if we adjust T d to a suitable value it can do as well as Fig3(e) under more possible circumstances On the other hand although increasing the static threshold can also handle more problems the details of images will continuousl and largel decrease even more severe than ATMF
No JIANG Bo et al: Adaptive Threshold Median Filter for Multiple-Impulse Noise 73 Algorithms Tab Comparative restoration results in MSE and PSNR Blood (MSE) Blood (PSNR) /db Lara (MSE) Lara (PSNR) /db 02 04 02 04 02 04 02 04 AMF (3 3) 552 6244 30 307 5437 6697 3078 2987 AMF (5 5) 5005 5038 34 3 5267 5286 309 3090 AMF (7 7) 5004 5024 34 32 5267 5265 309 3092 ASTMF (3 3) 577 6248 3099 307 5400 6668 308 2989 ASTMF (5 5) 4987 5037 35 3 5200 5249 3097 3093 ASTMF (7 7) 4983 5022 36 32 596 5324 3097 3095 ATMF (3 3) 543 6209 30 3020 5384 6628 3082 2992 ATMF (5 5) 499 4930 32 32 599 5226 3097 3095 ATMF (7 7) 4907 4874 322 325 597 592 3097 3098 (a) Corrupted blood image (b) Image filtered b MF (c) Image filtered b AMF (d) Image filtered b ASTMF (e) Image filtered b ATMF Fig Restoration results of corrupted Blood image with 02 impulse noise in kernel size 7 7 a) Corrupted Lara image (b) Image filtered b MF (c) Image filtered b AMF (d) Image filtered b ASTMF (e) Image filtered b ATMF Fig2 Restoration results of corrupted Lara image with 04 impulse noise in kernel size 7 7 (a) Corrupted Lara image (b) Image filtered b MF (c) Image filtered b AMF (d) Image filtered b ASTMF (e) Image filtered b ATMF Fig3 Restoration results of corrupted Lara image with 03 multiple-impulse noise in kernel size 7 7 (a) Corrupted Lara image (b) Image filtered b MF (c) Image filtered b AMF (d) Image filtered b ASTMF (e) Image filtered b ATMF Fig 4 Restoration results of corrupted Lara image with 04 multiple-impulse noise in kernel size 7 7
74 Journal of Electronic Science and Technolog of China Vol5 4 Conclusions In this paper we propose a new noise removal algorithm to deal with multiple-impulse noise The ATMF algorithm integrates the AMF and two dnamic thresholds The dnamic thresholds enhance the abilit of the filter to detect the multiple noises and balance the noise removal and image qualit According to the results of our experiments the proposed method is superior to the conventional methods in the aspect of multiple-impulse noise and perceptual image qualit It provides a quite stable performance over a wide variet of images with various probabilities of noise corruption Meanwhile it can do as well as even better than AMF regarding to normal impulse noise References [] GONALE R C WOODS R E Digital Image Processing[M] Second Edition Beijing: Publishing House of Electronics Industr 2002 [2] POK G LIU J NAIR A S Selective removal of impulse noise based on homogeneit level information[j] IEEE Trans Image Processing 2003 2(): 85-92 [3] LIN H M WILLSON A N Median filter with adaptive length[j] IEEE Transactions on Circuits and Sstems 988 35(6): 675-690 [4] CHAN P LIM J S One-dimensional processing for adaptive image restoration[j] IEEE Trans Acoust Speech Signal Processing 985 33(2): 7-26 [5] LU S M PU H C LIN C T A HVS-directed neuralnetwork-based approach for impulse-noise removal from highl corrupted images[j] IEEE Transactions on Circuits and Sstem for Video Technolog 2003 : 72-77 [6] HAN W Y LIN J C Minimum-maximum exclusive mean (MMEM) filter to remove impulse noise from highl corrupted images[j] Electron Letters 997 33(2): 24-25 [7] YIN L YANG R GABBOUJ M et al Weighted median filters: a tutorial[j] IEEE Trans Circuits Sstems 996 43(3): 57-92 [8] HWANG H HADDAD R Adaptive median filters: new algorithms and results[j] IEEE Trans Image Processing 995 4(4): 499-502 [9] ANDREADIS I LOUVERDIS G Real-time adaptive image impulse noise suppression[j] IEEE Trans Instrumentation and Measurement 2004 53(3): 798-806 [0] JIA H T HU Y C WANG J H The principle and implementation for extended adaptive median filter[j] Journal of Image and Graphics 2004 9(8): 947-950 (in Chinese) [] LIGHTSTONE M ABREU E MITRA S K et al A new filtering approach for the removal of impulse noise from highl corrupted images[j] IEEE Trans on Image Processing 996 5(6): 02-025 [2] SUCHER R A Recursive Nonlinear Filter for the Removal of Impulse Noise[C]// IEEE Int Conf on Image Processing (ICIP 95) Washington DC USA 995: 83-86 Brief Introduction to Author(s) JIANG Bo ( 姜波 ) was born in Sichuan China 98 He received the BS degree from Chegndu Universit of Technolog (CDUT) in 2004 He is currentl pursuing his MS degree in the School of Communication and Information Engineering Universit of Electronic Science and Technolog of China (UESTC) His research interests include image processing and pattern recognition HUANG Wei ( 黄炜 ) was born in Beijing China 952 He received the BS and MS degrees both from UESTC in 98 and 984 respectivel He is currentl an associate professor with UESTC His research interests include signal processing in modern communication audio and visual signal processing