Comparison study of nonlinear filters in image ... - Semantic Scholar

2 downloads 0 Views 3MB Size Report
in the bidirectional filters the mask of the subfilters is either in the horizontal and ... The motivation behind the algorithm is to select the output value in such a way ...
Comparison image Comparison study study of nonlinear filters in image processing applications processing Yu-Shan Fong, MEMBERSPIE SPIE Yu -Shan Fong, MEMBER Carlos A. Pomalaza Pomalaza-Rdez -Ráez Xiao-HuaWang* Xiao -Hua Wang* Clarkson Clarkson University Department of Electrical and Computer Engineering Engineering Potsdam, Potsdam, New New York York 13676

Abstract. Nonlinearfilters filtersare areused usedin in many many applications, applications, including includingspeech speech and Abstract. Nonlinear ability to to suppress suppress noise noise and and preserve signal image processing, processing, owing to their ability signal features such as as edges. edges. This This study study presents presents aa performance performance evaluation of nonlinear filters estimation theory. theory. The The first first part of the filters derived from the robust point estimation the work is is a classification of various approaches approaches to into three to nonlinear nonlinear filtering into types of estimators according to the process process of the filter. filter. The The second second part part is is aa computer implementation implementationand and evaluation evaluationof ofall all of of the the filters filters discussed. discussed. Finally, aa computer results isis presented. presented. summary of experimental results Subject terms: image processing; filters; detaildetail-preserving processing; nonlinear nonlinear filters; preserving filters; robust point point location parameters. estimators; location Optical Engineering 28(7), 28(7), 749 749-760 1989). -760 (July 1989).

CONTENTS 1.1. Introduction 2. Classification of nonlinear filters 2. Classification 2.1. Terminology and 2.1. Terminology and notation 2.2. LL-type 2.2. -type filters 2.2.1. aa-trimmed 2.2.1. trimmed mean filter 2.2.2. Modified Modified-trimmed 2.2.2. -trimmed mean mean (MTM) (MTM) filter 2.2.3. DoubleDouble-window 2.2.3. window MTM filter K-nearest-neighbor (K-NN) 2.2.4. Knearest -neighbor (K -NN) filter 2.2.5. Modified Modified KK-NN 2.2.5. -NN filter 2.3. RR-type -type filters 2.3.1. Wilcoxon Wilcoxon filter 2.3.1. 2.3.2. Limited Limited degree Wilcoxon filter 2.3.2. 2.3.3. Finite Finite-impulse-response 2.3.3. -impulse- response median median hybrid filter M-type 2.4. M -type filters 2.4.1. Standard-type M-filter 2.4.1. Standard -type Mfilter 2.4.2. Adaptive Adaptive mean mean filter filter 2.4.2. 2.4.3. Adaptive Adaptive median filter 2.4.3. 2.5. Median Median class class filters filters 2.5. 2.5.1. Conventional Conventional median filter 2.5.1. 2.5.2. Separate median median filter 2.5.2. Separate 2.5.3. Max/median 2.5.3. Max /median filter 3. Comparison study 3. Comparison 3.1. Structure of of test test images images 3.1. Structure 3.2. Experimental study 3.2. Experimental 3.3. 3.3. Statistical analysis analysis by by simulation 3.3.1. Mean square 3.3.1. Mean square error 3.3.2. 3.3.2. Subregion analysis 3.3.2.1. 3.3.2.1. Step response 3.3.2.2. 3.3.2.2. Line response Conclusion 4. Conclusion 5. References References 5. Services, International SOS AssisAssis* Current Current affiliation: affiliation: Worldwide Medical Services, International SOS tance, 19047. tance, One One Neshaminy Neshaminy Interplex, lnterplex, Trevose, PA 19047. Invited Paper Paper VI VI-107 -107 received received Nov. Nov. 3,1988; 3, 1988;revised revisedmanuscript manuscript received Feb. 14, 1989; 11, 1989. 1989. This 14, 1989;accepted acceptedfor forpublication publication April 11, This paper paper is is aa revision revision of of Paper 1001 1001-18, -18,presented presentedatat the the SPIE conference Visual Communications Image Processing, Processing, Nov. 99-11, and Image -11, 1988, 1988,Cambridge, Cambridge, Mass. Mass. The The paper paper presented Proceedings Vol. Vol. 1001. 1001. sented there there appears appears (unrefereed) (unrefereed) in in SPIE Proceedings © 1989 Society of Photo-Optical Engineers. e 1989 Photo -Optical Instrumentation Instrumentation Engineers.

1. INTRODUCTION INTRODUCTION 1. Linear nonlinear filters filters are are used used extensively extensively in in signal signal Linear and nonlinear processing applications to remove remove noise. noise. ItIt has has been been shown by applications to many experimental studies that that although althoughlinear linearfilters filters possess possess good noise attenuation capabilities, they they smear smear the the edges edges and attenuation capabilities, attenuate thin lines lines present in the original original signal signal because because of of the linear averaging averaging operation operation that that they they perform. On the other hand, nonlinear nonlinear filtering filteringisis aawell well-known noise filtering and -known noise edge-preserving of filters has become popedge -preserving method. method. This class of ular in digital speech and image image processing processing and and has has achieved achieved some interesting results in many image processing applications. Tukey lI first first used usedthe themedian median filter filter for for nonlinear nonlinear smoothing smoothing This filter filter became became attractive attractive because because it is is easy easy to of data. This implement and can reduce reduce quite quite effectively effectively the the impulsive impulsive implement and can noise component. component. Median Median filtering filtering is is aa local local filtering filtering techtechnoise nique nique in which which each pixel is is replaced replaced by by aa value value obtained obtained through a "median" "median" operation operation performed performed within within aawindow. window. The The term window window refers refers to aa neighborhood neighborhood of of the the pixel, pixel, centered at that centered that pixel. pixel. As As an an example, example, Fig. Fig. 11 shows shows the the perperformance of ofaa median medianfilter filterwith withaasquare squarewindow windowofofsize size33X3 formance X3 for the removal removal of of impulse impulse noise. noise. Median filters have been applied to to several several areas areas of of digital digital including image image processing processingand andspeech speechpro pro-signal processing, including cessing.2 ' 3 One cessing.2,3 Onemain mainfeature featureofofthe the median median filter filter isis that that it that has has a duration durationof ofless less than than half half the eliminates the impulse that window size. window size. Since Since the the degree degree of smoothing smoothing of the median filter can be influenced only by the processing window window size, size, itit does not generally generally allow the user user sufficient sufficient control control over over its its characteristics. does not not have have the the averaging averaging characteristics. Futhermore, it does operation that that is is particularly appropriate appropriate in in reducing reducing additive operation Gaussian noise noise components. Several Several techniques techniques have have been been Gaussian in an effort to to overcome overcome these these limitations. limitations. One One is introduced in The combination to combine linear and and nonlinear operations. The over the the relative relative influence influence of of these allows a degree of control over operations. Bednar Bednar and and Watt4 Watt 4 proposed proposedsuch suchaa new new algorithm operations. for applying median filtering. ItIt is is called the aa-trimmed trimmed mean (a-TM) Suppose that thatXX isis aa finite finite set set of of N numbers. The (a -TM) filter. Suppose aa-TM -TM of X X isisobtained obtained by by sorting sorting X X into into rank order, removing OPTICAL / July OPTICALENGINEERING ENGINEERING / July1989 1989// Vol. Vol.28 28 No. No.77//

Downloaded From: http://opticalengineering.spiedigitallibrary.org/ on 08/02/2013 Terms of Use: http://spiedl.org/terms

749

WANG POMALAZA-RAEZ, FONG, POMALAZA FONG, -RAEZ, WANG

(b)

impulse noise by median of impulse Removal of Fig. Fig. 1. 1. Removal median filtering, filtering. (a) Signal Signal with with impulse impulse noise, noise. (b) (b) Signal Signalafter afterfiltering. filtering.

ends low ends andlow highand fixed fraction fractionaa (0 (0 C C, i xk(N 1) - xk(i)I

fori 1,2,...,2N+1. fori = 1,2,...,2N +1. The The value value of of CCininthe theequation equation depends depends on the variance of the contaminating noise. It can be chosen according to some some optimization optimization criterion criterion that that equals equals 3a 3a (standard (standard deviation deviation of of noise). noise). The The concept concept behind behind this this processing processing isis to to have have a filter whose window The window whose window dimensions dimensions adjust adjust automatically. The size depends nature of of the thesignal signalbeing beingprocessed, processed, size depends on on the nature is an edge or a smooth region. region. whether it is 2.4.3. Adaptive median filter 2.4.3. This filter isissimilar similar to tothe theadaptive adaptive mean filter. filter. The output of an adaptive is adaptive median filter is Yk == median medianofof{xk(i) {xk (i)|xk (i) EE S} S} ,, Yk lxk(i)

(22)

Z2 Z2 = - median medianofof{xi {xi _ m,i> mj ,...,xij Xi,j+,...,xi+mj , xi +m,i}} , Z3 = Z3 - median medianof of{xi {xi+mj ,...,xi _ mj+m } ,, +m,i _ m ,...,xij Xi,P..., Xi_m.i+m}

(27) (27)

Z 4 -= median Z4 median of of Ix;_m,l {xi _ mj _ m ,...,xij -m. . xi,j>,...,xi+mj+m , Xi +m}} .

This is is aa two-pass two -passprocess. process. In In the the first first pass, pass, the the median of the the points lines through the the center center pixel pixel points along along each each of the four lines (vertical, is taken. (vertical, horizontal, horizontal, and the two diagonals) is taken. In the second pass, the maximum of of these medians medians is is identified and regarded regarded as as the output. 3. COMPARISON STUDY 3. COMPARISON 3.1. of test test images images 3.1. Structure of Two test images images are used used in in this this experimental experimental study. study. Each Each Two consists of of 128 128 X 128 the effects effects of of image image 128 pixels. pixels. To To eliminate the OPTICAL ENGINEERING / July OPTICAL ENGINEERING / July1989 1989// Vol. Vol. 28 28 No. No.77//

Downloaded From: http://opticalengineering.spiedigitallibrary.org/ on 08/02/2013 Terms of Use: http://spiedl.org/terms

753

FONG, FONG, POMALAZA-RAEZ, POMALAZA -RAEZ, WANG WANG

TABLE images. TABLE I.I. Mean Mean square square error error of of filtered filtered images. MSE,

MSEJI MSE,,

RI R,

RBI

R,,

38.0585

0.29

4.37

LL-type -type filters filters a- Trimmed Trimmed Mean Mean

(a = = 0.1) 0.1)

2.5127

(a = = 0.2) 0.2)

2.3708

38.3516

0.26

4.40

(a = 0.3) 0.3)

2.2293

38.7371

0.25

4.45

(a = 0.4) 0.4)

2.1699

39.8591

0.24

4.57

(q (9 = 5)

2.2283

40.1211

0.25

4.61

(q = 10)

1.6587

39.6491

0.19

4.55

(q = 15)

1.7694

38.6622

0.20

4.44

(q = 20)

2.0195

36.5613

0.22

4.19

(K = 2)

6.4841

41.7984

0.75

4.79

(* = 4) (K

4.2446

48.0683

0.48

5.51

2) (K = 2)

1.8589

13.2974

0.21

1.52

(K = 4)

2.0640

10.8941

0.23

1.24

(9 = 5) (q

1.4634

14.4683

0.17

1.65

(9 (q = 10)

1.2072

14.7382

0.14

1.68

Modified-Trimmed Modified -Trimmed Mean

Fig. Fig. 5. 5. Test Test image I.

K-nearest K- nearest neighbor

ono

Modified-KNN Modified -KNN

Fig. Fig. 6. 6. Test image II.

boundaries, we analyze all of of the the algorithms algorithmsininthe the126 126X126 boundaries, we X 126 central area of the image. image. Test image in aa three three-dimensional image I, shown in Fig. 55 in -dimensional perspective solid spective view, view,consists consistsof ofaa solid solid square square object object and a solid triangular object object on The gray gray level level of on aa darker background. The the triangle isis 40, square is the triangle 40, that that of of the the square is 30, 30, and and that that of the background is is 20. Test several lines lines and Test image image II, II, shown shown in Fig. 6, contains several patterns in a variety of directions with widths of either either one one or two pixels. The gray either 40 or 30, gray levels levels of ofthese these patterns patterns are either that of of the the background backgroundisis20. 20. This This test test image image was was used used to and that examine examine the the filter's filter's ability ability to to preserve preserve thin thin lines lines and and sharp corners. 3.2. Experimental Experimental study study 3.2. zero-mean The generated test images are added with zero -mean Gaussian previously disrandom noise. After implementing all of the previously cussed filters cussed filters on on test test images images II and and II, we we compare compare the performance of the the filters filters using using empirical empirical statistical statistical analysis. analysis. mance Performance Performance evaluation evaluation of of the the filter filter in noise noise reduction reduction is is out from from the MSE MSB viewpoint. viewpoint. The Theevaluation evaluationofofdetail detail-carried out preserving preserving capabilities capabilities of of the the filters filters isis carried carried out using local local statistics. The 33X3 X 3window windowisisused usedininall allof ofthe thefilter filterimplementations implementations filters (including the the SM SM filter), filter), for for which which aa except for FMH filters window is is used. 5X5 window

Double window Double window MTM MTM

(9 (q = 15)

1.4211

14.6064

0.16

1.67

(q (q = 20)

2.1690

14.0933

0.24

1.61

R -type filters filters R-type

Wilcoxon filter Wilcoxon 2.6733

8.6948

0.30

0.99

(M=2, D=2) (M =2, D =2)

1.9255

14.0006

0.22

1.61

(M=3, D=3) (M =3, D =3)

1.8589

13.2971

0.21

1.51

S moot h- medi an Smoothmedian

2.1200

10.3743

0.25

1.19

LFMH

1.8067

6.5721

0.20

0.75

RFMH

2.3012

6.6043

0.34 0.76

MFMH

2.1667

3.8850

0.24

0.45

LDW

M-type M -type filters filters Adaptive Mean Mean

(C = 27) 27)

1.7182

1.9751

0.19

0.23

2.8154

23.9411

0.32

2.75

0.19

1.54

Median Adaptive Median (C 27) (C = 27)

class filters Median class

3.3. Statistical Statistical analysis analysis by simulation 3.3. 3.3.1. MSE 3.3.1. MSE The criterion criterion used used to compare compare the the performance performance of of various various The types of filters is is the the MSE. MSE. We use the the MSE of an image (noisy 754

Conv. Median Cony.

1.7086

13.3853

Separate Median Separate

1.9400

13.3492

0.22

1.53

Max/Median Max /Median

5.5223

5.4271

0.63

0.62

OPTICAL ENGINEERING Vol. 28 No. No. 77 // OPTICAL ENGINEERING/ /July July 1989 1989 // Vol.

Downloaded From: http://opticalengineering.spiedigitallibrary.org/ on 08/02/2013 Terms of Use: http://spiedl.org/terms

STUDY OF OF NONLINEAR NONLINEAR FILTERS FILTERS IN PROCESSING APPLICATIONS COMPARISON STUDY IN IMAGE PROCESSING APPLICATIONS

45.00 -a

45.00 :

45.00 45.00 :

40.00 40.00 \

40.00 40.00 i

4 40.00 40.00 \

35.00 35.00

35.00 35.00

35.00 i 35.00

C O 30.00

ó 25.00

ó

C

C

0

1. Original image 1. Original DWMTM filter filter 2. DWMTM 3. aa-TM 3. -TM filter 4. MTM filter 4. MTM

O 0

1. Original image 1. Original 2. Ktf-NN -NN filter Mtf-NN 3. MK -NN filter

£30.00 30.00 "025.00 ó 25.00

£j 30.00 30.00

20.00

ó

20.00 20.00

20.00

(a)

15.00

10.00 0.00

4.00

8.00

12.00

(b)

15.00

10.00

16.00 16.00

4.00

0.00

n(pixel)

45.00

10.00 1

0.00

16.00 16.00

12.00

8.00

n(pixel)

35.00 35.00 : :

(C) (c)

15.00

4.00

8.00

12.00 12.00

16.00

n(pixel) 45.00 45.00

50.00

40.00 40.00

40.00 40.00

C O ó

1. Original image 1. Original 2. LDW filter 2. LDW 3. Wilcoxon filter 3. Wilcoxon

"5 T2 25.00 25.00 O



40.00

Original

1. SM filter 2. RFMH filter 3. MFMH filter 4. LFMH filter

|»» É 30.00 I "5 25.00 • ó 25.00

u

2

35.00 35.00

C ÿ£30.00 30.00

1. Original image 1. Original 2. Adaptive Mean filter 2. Adaptive 3. Adaptive Median filter 3. Adaptive

E E T3

u20.00

2

ó 30.00

1. Original 1. Original image 2. Separate Median Median filter 2. Separate Conventional Median Median filter 3. Conventional Max/Median 4. Max /Median filter

"5 25.00 • ó 25.00

8uO

20.00

20.00 10.00

(e) (e)

15.00

10.00 0.00

4.00 4.00

8.00 8.00

nn(pixel) (pixel)

12.00

0.00 0.00

16.00 18.00

4.00

12.00 8 .0012.00

8.00

n(pixel)

15.00

10.00

0.00

16.00

(f)

2

a

V.66 4.00

6.00

n(pixel)

ii.bb" 12.00

TToo 16.00

Local mean mean of of filtered filteredstep stepresponse: response: (a) (a) aa-TM, (e) M-type, Fig. 7. Local -TM, (b) (b) K-NN, K -NN,(c) (c) Wilcoxon, (d) FMH, (e) M -type, and and (f) (f) median. median.

filtered) as measure of its deviation from the the original or filtered) as aa measure original (noise free) (noise free) image. image. Thus, Thus, the MSE for for aa noisy noisy image image isis MSE = mn X X [Xo(i,j) - Xn(i,j)]2

,

(28)

i=1j=I

where X0 (i, j)j) isisthe Xo(i, the\th ithand and]th jth pixels pixels in in the the original original image and and Xn (i,j) isis the the ith \th and and jth ]thpixels pixels in in the the noisy noisy image. image. We We use use the Xf(i,j) same expression MSE of of the the filtered filtered image. image. same expression to calculate the MSE The only only difference (i,j) is changed to Xf(i,j) Xf(i,j) for for The differenceisisthat that Xn Xf(i,j) images. filtered images. Table I provides the results of calculating the MSE of the filtered filtered image image by by various various types types of of filters. filters. In In the the table, table, the subscripts I and II represent represent test test images images I and II, II, respectively. respectively. is the ratio of the MSE of of the the filtered filtered image image to that of of the the R is noisy noisy image. image. In In other other words, words, R R ==MSEf/ MSEn,, where MSEf/MSEn where the the MSE of the noisy image is equal to 8.7023 for both test image I and test image II. 3.3.2. 3.3.2. Subregion analysis To observe the edge-preserving edge -preserving ability ability of each filter, we calculate error between between the late the local local mean, mean, local local variance, variance, and rms error filtered image image and the original original noise noise-free filtered -free image in different subregions. By comparing By comparingthe the local local mean mean of of the the input input and output output distributions, we obtain information information about abouthow howwell well the filter distributions, we the discrepcan preserve details of the image. image. In other words, the ancy between ancy between these these two two local local means means isis an an indication indication of the degree of edge M^ isis degree edge blurring blurring of each each filter. filter. The local mean Mt as defined as Mt =

w X(i) i=1

ww ,

(29)

subregion size. size. where W is the subregion Comparing the local variance of the filtered filtered output distribution with the the local variance variance of ofthe the original originalnoise noise-free bution with -free image, image, the diffusion of each each filter at the the edge edge or or the thediscontinuity the diffusion discontinuity points can be shown. It is represented represented by by Vt V^ and is is defined as W

v«= Vt = 2

(X(i) - M1)2 .

(30)

i=1

The value of the local rms error in each subregion subregion is is repreerror in sented RMS^, which which is defined as sented by by RMSt,

RMS* == T RMSt F

w

[B {X(i)) - S(i)]2

,

(31)

i =1

where S(i) is the pixel where 0{-} Of I represents represents the the filter filter operation, operation, S(i) pixel noise-free normalizing factor. value in the noise -free image, image, and and F is a normalizing factor. This calculation gives information about aboutboth boththe theedge edge-pre-prethe noise noise-cleaning shows the the deviation deviation serving and the -cleaning ability. ItIt shows original image. image. of the filtered image from the original

3.3.2.1. Step Step response response 3.3.2.1. To analyze the filter's ability ability to preserve preserve edges edges under under noise, noise, we use 14 pixels use test image image II and select select a row of 14 pixels that that contains an ideal step function. Afterthe thewhole wholeimage imageisisfiltered, filtered,we we slide slide a function. After 1-D local 1 -Dwindow windowacross acrossthe the step step function, function, calculating the local mean, local variance, and rms error at each window location. location. window size size W W is is 3. 3. Here, the window Local mean mean Local Figures 7(a) local mean mean of of the the filter filter Figures 7(a) through 7(f) show the local output sample sample on both both sides sides of of the the edge edge for each filter. L-type L -typefilters: filters: All All of of the the a-TM a -TM class class filters filters [Fig. [Fig. 7(a)] do acceptably acceptably well well on on the the edge. edge. They They are are mostly mostly parallel parallel to to the the OPTICAL / July OPTICALENGINEERING ENGINEERING / July1989 1989/ /Vol. Vol.28 28No. No.77//

Downloaded From: http://opticalengineering.spiedigitallibrary.org/ on 08/02/2013 Terms of Use: http://spiedl.org/terms

755

FONG, FONG, POMALAZA-RAEZ, POMALAZA -RAEZ, WANG WANG

120.00

120.00

100.00

100.00

i

100.00

80.00

g 80.00 80.00 C

1. Original Original image image 1. 2. DWMTM DWMTM filter 2. 3. aa-TM 3. -TM filter 4. MTM filter 4. MTM

g O 60.00

g 80.00 I

O

S 40.00 -

(a)

20.00

60.00 :

4.00

12.00 12.00

8.00

ó ó > _ 40.00

20.00

(b)

0.00 o.< o 0.00

16.00 16.00

n(pixel) n(pixel

"Y.66 "" " 8.00 a 60 n(pixel)

12.00 12.0

'ie.'oo

0.00 0.oó

16.00

4.00. -jo n

100.00

1. Original image 1. Original 2. LDW filter 2. LDW 3. Wilcoxon filter 3. Wilcoxon

C 60.00

o u o

20.00

A.

0.00

u

40.00

o

0.00

01

1. Original image image 1. Original 2. AT-NN 2. K -NN filter 3. MX-NN 3. MK -NN filter

c o

(C) (c) 441

?.

4.60 4.00

r.A.-.n12.00 12.00

8 00 8.00

n(pixel)

16.00 Is.00

100.00

l\

1\

80.00

u C 60.00 ó

l\ »l

ó _ 40.00 o u o

1. Original Original image image 1. 2. MFMH filter 2. MFMH 3. LFMH filter 3. LFMH 4. RFMH filter 4. RFMH

o : u cC o : o p 200.00 200.00 :_

:

"

4.00 4.00

(d)

;

-

Conventional Median Median filter filter 3. Conventional Max/Median filter 4. Max /Median filter

40.00

2 7^ ' '

2. Separate Medianfilter filter r 2. Separate Median

60.00

I,

1

8uo

1. Original image 1. Original

1

>

100.00 - 100 00 4

' \ 1 , 3. / , 1.. Original image ^ i 2. Adaptive Mean filter > 't 3. Adaptive Median filter

:

~oo

20.00

o.00 0.00