steerable weighted median filters

13
882 IEEE TRANSACTIONS ON IMAGE PROCESSING, VOL. 19, NO. 4, APRIL 2010 Steerable Weighted Median Filters Dimitrios Charalampidis, Member, IEEE Abstract—A filter is steerable if transformed (i.e., rotated, scaled, etc.) versions of its impulse response can be expressed as linear combinations of a fixed set of basis functions. Steerability is im- portant for numerous image processing applications. However, it is a property presently shared only by a specific class of linear fil- ters. On the other hand, several classes of nonlinear filters, such as weighted median filters (WMFs), may offer certain advantages over linear filters such as robustness and edge preserving capabili- ties. In this paper, the concept of steerability is extended to encom- pass WMFs. It will be shown that, in general, a steerable WMF design technique needs to be capable of handling negative weights. Although methods that allow the design of WMFs admitting neg- ative weights have already been proposed, such methods do not necessarily produce filters that are steerable, as opposed to the ap- proach presented in this work. Experimental results illustrate the applicability of steerable WMFs in two applications, namely edge detection and orientation analysis. I. INTRODUCTION O RDER statistics filters, including their special case, the median filter, and its modifications [1]–[4], have attracted a great interest in the past few years, due to their usefulness in several applications of signal processing. In particular, median filters possess two important properties, namely edge preserva- tion and noise attenuation. The latter mostly refers to the spe- cial case of impulsive noise [5]. Other order statistics filters, in- cluding the minimum and maximum filters, have been success- fully used in morphological image processing as the erosion and dilation operators, respectively. The disadvantage of traditional order statistics filters, com- pared to linear filters, used to be their inflexibility. For instance, linear smoothers can be implemented as weighted moving aver- ages. Therefore, smoothing filters with different spatial and fre- quency characteristics can be obtained by choosing appropriate weights. In order to provide more flexibility in the design of me- dian filters, the weighted median filter (WMF) was introduced [6]–[8]. The WMF was proposed as an extension of the tradi- tional median filter, and was designed by assigning a non-neg- ative weight to each position in the filter window. Based on the same concept, weighted order statistics filters (WOSFs) were designed [9]. Later, methods for designing WMFs admitting negative and even complex weights were introduced [19]–[24]. Another advantage of 2-D linear filters was identified with the introduction of the steerability concept [10]. Considering an input image , steerability implies that the output Manuscript received February 04, 2009; revised November 12, 2009. First published December 22, 2009; current version published March 17, 2010. The associate editor coordinating the review of this manuscript and approving it for publication was Dr. Michael Elad. The author is with the Electrical Engineering Department, University of New Orleans, New Orleans, LA 70148 USA (e-mail: [email protected]). Digital Object Identifier 10.1109/TIP.2009.2038823 of a filtering operation using a filter oriented at angle can be computed as the linear combination of a finite set of outputs obtained by applying the same filter oriented in directions, respectively. Steerability has found applica- tions in orientation analysis [11], image denoising [12], and texture analysis [13]. The concept of steerability was extended to include not only orientation, but also translations and scales [14], arbitrary compact transformations [15], and transforma- tions within the context of Lie transformations groups [16]. In general, a linear filter parametrized by a vector is steer- able if its impulse response can be obtained, for an arbitrary choice of , by a linear combination of impulse responses, parametrized by vectors . Although directional median filters have been used in the literature for image processing applications, including denoising [17], the authors are not aware of a framework that associates directional median filters and steerability. In this paper, the concept of steerability is extended to include WMFs. Steerable median filters (SMFs) are a special case of WMFs and inherent the noise-robustness and edge-preserving capability of WMFs. The advantages of SMFs over their linear counterparts as well as other WMFs are illustrated in the exper- imental results section. It should be mentioned at this point that the concept of steerability, as defined above, is not identical to the concept of steerability associated to multichannel processing [18]. In the latter case, processing is not performed across dif- ferent orientations or translations, but across different channels, such as in the case of multispectral color or image processing. This paper is organized as follows. Section II introduces the SMF design method. In Section III, two applications of SMFs, namely edge detection and orientation analysis, are examined in more detail. Section IV presents experimental results that illus- trate the effectiveness of SMF in edge detection, and orientation analysis. Section V concludes with some discussion. II. STEERABLE WEIGHTED MEDIAN FILTERS In what follows, we concentrate on the design of SMFs. The design of steerable WOSFs is a straightforward extension of SMFs. Subsection II-A presents some background and insights regarding WMFs admitting positive weights. Subsection II-B investigates the steerability property, and its applicability to ex- isting WMF design methods admitting negative weights. Sub- section II-C introduces the proposed SMF design approach. A. Weighted Median Filters Admitting Positive Weights This paper deals with 2-D filtering. However, the input samples and weights are represented as 1-D sequences in order to provide simplicity in notation. More specifically, the coefficients or weights of a 2-D discrete, finite length function representing a 2-D image block or a 2-D filter can be rearranged 1057-7149/$26.00 © 2010 IEEE

Upload: d

Post on 25-Feb-2017

215 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Steerable Weighted Median Filters

882 IEEE TRANSACTIONS ON IMAGE PROCESSING, VOL. 19, NO. 4, APRIL 2010

Steerable Weighted Median FiltersDimitrios Charalampidis, Member, IEEE

Abstract—A filter is steerable if transformed (i.e., rotated, scaled,etc.) versions of its impulse response can be expressed as linearcombinations of a fixed set of basis functions. Steerability is im-portant for numerous image processing applications. However, itis a property presently shared only by a specific class of linear fil-ters. On the other hand, several classes of nonlinear filters, suchas weighted median filters (WMFs), may offer certain advantagesover linear filters such as robustness and edge preserving capabili-ties. In this paper, the concept of steerability is extended to encom-pass WMFs. It will be shown that, in general, a steerable WMFdesign technique needs to be capable of handling negative weights.Although methods that allow the design of WMFs admitting neg-ative weights have already been proposed, such methods do notnecessarily produce filters that are steerable, as opposed to the ap-proach presented in this work. Experimental results illustrate theapplicability of steerable WMFs in two applications, namely edgedetection and orientation analysis.

I. INTRODUCTION

O RDER statistics filters, including their special case, themedian filter, and its modifications [1]–[4], have attracted

a great interest in the past few years, due to their usefulness inseveral applications of signal processing. In particular, medianfilters possess two important properties, namely edge preserva-tion and noise attenuation. The latter mostly refers to the spe-cial case of impulsive noise [5]. Other order statistics filters, in-cluding the minimum and maximum filters, have been success-fully used in morphological image processing as the erosion anddilation operators, respectively.

The disadvantage of traditional order statistics filters, com-pared to linear filters, used to be their inflexibility. For instance,linear smoothers can be implemented as weighted moving aver-ages. Therefore, smoothing filters with different spatial and fre-quency characteristics can be obtained by choosing appropriateweights. In order to provide more flexibility in the design of me-dian filters, the weighted median filter (WMF) was introduced[6]–[8]. The WMF was proposed as an extension of the tradi-tional median filter, and was designed by assigning a non-neg-ative weight to each position in the filter window. Based on thesame concept, weighted order statistics filters (WOSFs) weredesigned [9]. Later, methods for designing WMFs admittingnegative and even complex weights were introduced [19]–[24].

Another advantage of 2-D linear filters was identified withthe introduction of the steerability concept [10]. Consideringan input image , steerability implies that the output

Manuscript received February 04, 2009; revised November 12, 2009. Firstpublished December 22, 2009; current version published March 17, 2010. Theassociate editor coordinating the review of this manuscript and approving it forpublication was Dr. Michael Elad.

The author is with the Electrical Engineering Department, University of NewOrleans, New Orleans, LA 70148 USA (e-mail: [email protected]).

Digital Object Identifier 10.1109/TIP.2009.2038823

of a filtering operation using a filter oriented atangle can be computed as the linear combination of a finiteset of outputsobtained by applying the same filter oriented in directions,

respectively. Steerability has found applica-tions in orientation analysis [11], image denoising [12], andtexture analysis [13]. The concept of steerability was extendedto include not only orientation, but also translations and scales[14], arbitrary compact transformations [15], and transforma-tions within the context of Lie transformations groups [16].In general, a linear filter parametrized by a vector is steer-able if its impulse response can be obtained, for an arbitrarychoice of , by a linear combination of impulse responses,parametrized by vectors . Althoughdirectional median filters have been used in the literature forimage processing applications, including denoising [17], theauthors are not aware of a framework that associates directionalmedian filters and steerability.

In this paper, the concept of steerability is extended to includeWMFs. Steerable median filters (SMFs) are a special case ofWMFs and inherent the noise-robustness and edge-preservingcapability of WMFs. The advantages of SMFs over their linearcounterparts as well as other WMFs are illustrated in the exper-imental results section. It should be mentioned at this point thatthe concept of steerability, as defined above, is not identical tothe concept of steerability associated to multichannel processing[18]. In the latter case, processing is not performed across dif-ferent orientations or translations, but across different channels,such as in the case of multispectral color or image processing.

This paper is organized as follows. Section II introduces theSMF design method. In Section III, two applications of SMFs,namely edge detection and orientation analysis, are examined inmore detail. Section IV presents experimental results that illus-trate the effectiveness of SMF in edge detection, and orientationanalysis. Section V concludes with some discussion.

II. STEERABLE WEIGHTED MEDIAN FILTERS

In what follows, we concentrate on the design of SMFs. Thedesign of steerable WOSFs is a straightforward extension ofSMFs. Subsection II-A presents some background and insightsregarding WMFs admitting positive weights. Subsection II-Binvestigates the steerability property, and its applicability to ex-isting WMF design methods admitting negative weights. Sub-section II-C introduces the proposed SMF design approach.

A. Weighted Median Filters Admitting Positive Weights

This paper deals with 2-D filtering. However, the inputsamples and weights are represented as 1-D sequences inorder to provide simplicity in notation. More specifically, thecoefficients or weights of a 2-D discrete, finite length functionrepresenting a 2-D image block or a 2-D filter can be rearranged

1057-7149/$26.00 © 2010 IEEE

Page 2: Steerable Weighted Median Filters

CHARALAMPIDIS: STEERABLE WEIGHTED MEDIAN FILTERS 883

into an 1-D sequence by alligning all matrix columns into asingle column. Spatial domain filtering, including medianfiltering, is performed by sliding a processing window horizon-tally and vertically, over the whole image, one pixel at a time. Inwhat follows, the WMF design process will be explained usinga single instance of the filtering operation where the processingwindow is centered at a particular image pixel.

Given the input samples , the output of aweighted median filter characterized by the set of positiveweights is given by

(1)

where is the replication operator defined as

(2)

Alternatively, assuming that the input samples have beensorted in an ascending order, , the output of theweighted median filter is given by

(3)

where are the ordered weights corresponding tothe sorted set of input samples. The total sum of weights is de-fined as

(4)

The cummulative sum is defined as

(5)

Essentially, is the frequency with which the th sortedsample, , occurs within the set of input samples. Therefore,

is equivalent to the value of the th bin of the em-pirical probability mass function (PMF), and , as defined in(5), is the corresponding cummulative mass function (CMF). Itshould be mentioned at this point that the PMF and CMF maybe constructed following two different approaches. Based on thefirst approach, each individual input sample may occupy its ownbin in the PMF. Based on the second approach, input sampleshaving the same value, say , may occupy a single bin. In thelatter case, the value of the PMF at the particular bin is calcu-lated from the sum of the weights associated to all input sampleshaving a value equal to . Both approaches lead to equivalentSMF designs. Thus, in what follows, it can be assumed that anyof the two approaches has been used, unless it is stated other-wise.

The weighted median value equals the value of the inputsample that corresponds to the bin at which the CMF is equal to0.5. In practice, the CMF may not be exactly equal to 0.5 at anybin. The weighted median output is given by

(6)

Equation (6) implies that the median is the input sample valueassociated to the bin, , at which the CMF is greater than 0.5,while the CMF value at the immediately previous bin, , issmaller than 0.5. Based on the above discussion, we can draw afew important conclusions. First, it can be observed that if (5)and (6) are used for the calculation of the weighted median, thenthe weights do not have to be integer-valued. As a result, WMFscan be allowed to have the same flexibility as their linear filtercounterparts. Second, if the input values are integer valued, as inthe case of images, then sorting of the input values is equivalentto building the empirical PMF, which can be performed in .

B. Steerability and WMFs Admitting Negative Weights

The SMFs proposed in this work are WMFs whose associ-ated weight masks can be expressed as a linear combination ofweight masks associated to a fixed set of WMFs. First, con-sider a set of parameters represented by vector , and a setof weights corresponding to the sorted inputs

. Assume that the set of weights parametrized byan arbitrary vector can be expressed as a linear combina-tion of a set of weights, parametrized by vectors

. In other words

(7)

Equation (7) describes a relation between weights, which isequivalent to the one satisfied by steerable linear filters. TheCMF corresponding to vector is given by

(8)

Moreover, the total sum of the weights parametrized by vectoris defined as

(9)

As indicated in (5), (8) is derived from (7) by cumulatively sum-ming both sides of (7). For that purpose, the weights on bothsides of (7) have to be ordered according to the input samples.It should be emphasized at this point that it is imperative thatthe sorting of input samples is independent of the parametriza-tion, . Otherwise, although the bin associated with the weightedmean for weights may be determined from ,the actual input sample to which this bin corresponds can onlybe determined after the input samples have been re-sorted ac-cording to the particular parametrization . The need for suchre-sorting may nullify the computational advantage of steerableimplementations. Yet, the dependence of input sample sortingon the parametrization is linked to another significant problemthat becomes apparent in the following discussion.

In general, in order to be able to implement WMFs thatresemble arbitrary linear filters, the set of weights has to in-clude negative valued weights. The design of WMFs admittingnegative weights has already been investigated. In [19], [20],

Page 3: Steerable Weighted Median Filters

884 IEEE TRANSACTIONS ON IMAGE PROCESSING, VOL. 19, NO. 4, APRIL 2010

TABLE IEXAMPLE ILLUSTRATING HOW STEERABILITY IS AFFECTED WHEN THE SORTING OF INPUT SAMPLES DEPENDS ON THE PARAMETRIZATION

and [23], the output of a weighted median filter with negativeweights is defined to be

(10)

Essentially, the weight signs are transferred to their cor-responding input samples. However, the WMF definitionof (10) is not appropriate in this work because the sortingof input samples depends on the weight values. A simpleexample confirms this statement. Consider two sequences

and , andtwo sets of weights and

. Although vectors andare used to distinguish between two different parametrizations,their actual relationship to the weight values is not relevanthere. The sorted input samples under parametrization withand , respectively, are presented in Table I(a). Negative inputsamples indicate that their associated weights are negative. Itcan be observed that the sorting of the input samples dependson the parametrization. The weights ordered according to theirassociated sorted input samples are presented in Table I(b).The correspondence between weights under the two differentparametrizations is presented in Table I(c) for both sequences.It can be observed that the weight correspondence differsfor each sequence. If the two sets of weightsand had to be linearly combined in order toproduce a set of weights under a different parametrization, , asdescribed in (7), then two different sets of values would

have to be determined, once for sequence and oncefor sequence . Therefore, the values would haveto be redetermined for every image window processed.

Another approach for designing WMFs as a linear combi-nations of other WMFs was introduced in [22]. The techniquein [22] is capable of handling negative weights. For instance,in the case where a WMF weight mask contains both negativeand positive weights, the WMF could be expressed as a com-bination of two or more WMFs. In the case where the WMFis expressed as a linear combination of two WMFs, the firstWMF weight mask would contain the positive weights, whilethe negative weights would be substituted by zeros. Similarly,the second WMF weight mask would contain the absolute valueof the negative weights, while the positive weights would besubstituted by zeros. In other words, the WMF operation wouldbe expressed as , where and are pos-itive constants and where

(11)

In (11), is the unit step function. The technique is not appli-cable in this work since is a nonlinear function. Therefore,the linear relationship between weights in (9) does not hold.

C. Proposed WMFs

In this subsection, a new method for handling negativeweights is proposed. First, let us consider a linear filter de-scribed by a set of noninteger coefficient weights .

Page 4: Steerable Weighted Median Filters

CHARALAMPIDIS: STEERABLE WEIGHTED MEDIAN FILTERS 885

Although it is not common, the output of the filtering output fora given set of input samples can be expressed as follows:

(12)

where are integer-valued weights, and a large posi-tive constant so that . The weights andthe constant are used in order to be able to express the fil-tering operation in (12) using the replication operators (since theactual weights are noninteger-valued). This representationdoes not result in a loss of generality since the weights andthe constant can be made arbitrarily large. The filter outputcan also be expressed as

(13)

where is a positive integer sequence used to guarantee thatall offset weights, , are positive. In other words,

. The noninteger versionof is defined as . Moreover, is definedas

(14)

The Sum operators can be converted into Mean operators. Forexample,

. A median-based filter associated with thefilter of (13) can be obtained by replacing the Mean by theMedian operator. Then, the WMF output admitting negativeweights is defined as

(15)

In order to obtain the expression of (15), it was assumed thatthe Mean and Median operators admitting positive weights areequivalent when the sum of weights is equal to 1. This assump-tion was based on the fact that, in this particular case, the medianand mean of a constant input sequence provide the same output,namely the value of an input sequence sample.

Since the integer weights are simply propor-tional to the original weights , a WMF using ei-ther set of weights produces identical results. Thus, the orig-

inal weights are used in the subsequent discussion. The corre-sponding CMF of the first median in (15) is

(16)

As a reminder, the tilde implies that the weights and thesequence are ordered according to the sorted input samples

.Coming back to the concept of steerability, using (7), the

CMF for a set of weights parametrized by an arbitrary vector, ,can be expressed as

(17)

where it is implied that the offset sequence should be inde-pendent of the parametrization. Thus, the second weighted me-dian in (15) is independent of the parametrization. Some manip-ulations lead to the following equation:

(18)

which can also be expressed as

(19)

where

(20)

The term in (19) can be itself considered to rep-

resent a CMF, namely, ,where the superscript has, in this case, been used for con-sistency in the notation. More specifically, using (16), (19) canbe expressed as

(21)

It can be observed that . Equation (21) impliesthat, if (7) holds, the CMF corresponding to a set of weights pa-rametrized by an arbitrary vector can be expressed as a linearcombination of CMFs. Therefore, the CMFs are steerablefunctions. The median can be determined by (6). Not all valuesneed to be examined in order to determine the median. Using abinary search, the median can be determined in .

Page 5: Steerable Weighted Median Filters

886 IEEE TRANSACTIONS ON IMAGE PROCESSING, VOL. 19, NO. 4, APRIL 2010

III. APPLICATIONS

In this section, two applications of SMFs are presented,specifically, edge detection (Section III-A) and orientationanalysis (Section III-B).

A. Edge Detection

Consider a WMF oriented at direction described by the 2-Dweight mask of size . The total number of weightsis, therefore, equal to . The parametrized set of weights

is equal to the 1-D column-wise reshaped versionof . The superscript, , is equivalent to the parametervector that appears in the equations of Section II. However, forthe application presented here, a single parameter is sufficientfor steering the WMF. For the purpose of edge detection, thefunction can be defined as follows:

(22)

where

(23)

is an isotropic Gaussian envelope with standard deviation .The function as defined in (22) is commonly used as alinear filter in edge detection applications. Function issteerable, since it can be expressed as

(24)

Therefore, the ordered weights associated to the sorted inputsamples can be expressed as

(25)

The positive 1-D sequence, , introduced in (13) can beobtained by rearranging the elements of the following 2-Disotropic function of size

(26)

It can be easily shown that . Therefore,. In this case, (21) can be expressed as

(27)

where . By observing (20), and by usingthe fact that the total sum of weights is zero regardless ofthe angle

(28)

Considering that the function of (22) is a gradient detector, theoutput of the SMF provides the gradient at a particular orien-

tation. The orientation that best identifies an edge is the oneat which the gradient is maximum. In other words, it is of in-terest to determine : the maximum possible weighted me-dian with respect to direction . An efficient approach for de-termining is described next. First, the following discretefunction is defined:

(29)

For each bin, , function is equal to the minimum value ofwith respect to all orientations . Function has the followingproperties.

1) Property 1: Function is a nondecreasing function of .Moreover, and .

Property 2: If , then the value of the input samplethat corresponds to bin cannot be the weighted median ofthe input sequence, for any value of .

Property 3: If , then corresponds to a bin, for which .The proof of the three properties is presented in the Appendix.

Property 1 implies that has the same properties as a PMFand, therefore, can be viewed as such as function. The threeproperties can be used to prove the following property:

Property 4: is equal to the input sample value corre-sponding to the th bin, for which the following two conditionsare satisfied and . There is only one binsatisfying both conditions.

The proof of property 4 is also presented in the Appendix. Es-sentially, property 4 implies that the maximum weighted medianconsidering all possible orientations, , is the median value of aset of samples whose associated PMF is equal to . It shouldalso be mentioned that although the four properties are pre-sented for the case where the median filter weights are param-etrized by the orientation variable , they are valid for any ar-bitrary parametrization, such as the one presented in Section II.In order to determine the maximum weighted median, a binarysearch over bins, , can be performed on to check the validityof conditions and .

In the particular case where is defined as in (27) and (28),the discrete function is defined as

(30)

A modification can be incorporated in (15), specifically forthe case of edge detection. The modification is explained withthe help of Fig. 1. In this example, an edge separates two regionslabeled “1” and “2”, respectively. There are two sets of weightsassociated to the proposed filter output in (15), namelyand . Each set of weights corresponds to a sliding window.It is assumed at this point that the two windows are movingupwards. The -window outputs a median value equal to thepixel values of region 1, up until the point shown in Fig. 1. Anyadditional shift outputs a median value equal to the pixel valuesof region 2. The -window outputs a median valueequal to the pixel values of region 2, earlier than the -window.

Page 6: Steerable Weighted Median Filters

CHARALAMPIDIS: STEERABLE WEIGHTED MEDIAN FILTERS 887

Fig. 1. Example illustrating how the parameter � is determined.

Equation (15) defines the overall output as the difference ofthe two weighted medians. However, it can be observed that inorder to obtain a single-pixel wide edge, the -windowoutput needs to be equal to the value of region 2 earlier thanthe -window for just a single shift, up to no more than twoshifts. This can be achieved by replacing the first median in(15) with the th ordered value, where

. The regions and include the-window values above the long and short dashed lines,

respectively, as shown in Fig. 1.

B. Orientation Analysis

Steerable filters, including wedge filters [11], have been usedin orientation analysis. The filter used in this section is describedby the following function:

(31)

where the filters in (31) are angular harmonic filters

(32)

and where

(33)

The weights corresponding to the 2-Dfunction are obtained by rearranging the elements of

into an 1-D array. Each -dependent weight sequencecan be made non-negative by adding a positive constant se-quence, . The weight sequence ordered according tothe sorted input sequence, associated to direction , is given by

(34)

where the constant sequencehas been included to ensure that the weights have no excesspositive value (in other words, ). Observing (20)and using the fact that in this particular case

Fig. 2. Edge detection example: (a) original image, (b) using simple differ-ence masks ���� ��� ���� �� , (c) using the function in (22) as a linear filter,(d) using WMF followed by difference masks ������,������ , (e) using themedian filter in [21], (f) using the proposed filter.

, the CMF , can be expressed as in (21) for, and for

(35)

and

(36)

IV. EXPERIMENTAL RESULTS

In this section, experimental results showcase the advantageof steerable WMFs over their linear counterparts for two appli-cations: edge detection and orientation analysis.

A. Edge Detection

In the experiments performed in this section, the grayscalevalue of edge pixels indicates their strength. It is assumed thatimage intensities range between 0 and 1. The size of the WMFweight mask is set equal to , where is thestandard deviation of the Gaussian envelope presentedin (22). As a reminder, function is used to describe theweight mask of a WMF filter oriented at direction . Moreover,as discussed in Section III-A, only the WMFs oriented at

Page 7: Steerable Weighted Median Filters

888 IEEE TRANSACTIONS ON IMAGE PROCESSING, VOL. 19, NO. 4, APRIL 2010

Fig. 3. Edge detection example: (a) image corrupted by impulsive noise,(b) using difference masks ���� ��� ������ , (c) using the function in (22) aslinear filter, (d) using WMF followed by masks ���� ��,������ , (e) using themedian filter in [21], (f) using the proposed filter.

are needed for the extraction of edges. In order to performcomparisons between SMFs and their linear counterparts, theexact same function, , oriented at 0 and is used as alinear filter. More specifically, if and arethe images produced by filtering the original image withlinear filters and , respectively, the imagecontaining the edge magnitudes is commonly defined as

(37)

The subscript, , is simply used to indicate that the images area result of processing using linear filters.

Figs. 2 and 3 present edge detection results for a simpleexample to compare the performance of different approaches.Fig. 2(a) depicts the original image. Fig. 2(b) shows the edgesdetected using two simple masks, a horizontal and avertical . Fig. 2(c) presents the edges obtained usinglinear filters and . It can be observed thatclosely located edges are not resolved for the particular stan-dard deviation, . Fig. 2(d) presents the edges obtainedusing a WMF having a Gaussian weight mask asdefined in (23), followed by application of masks and

. Fig. 2(e) illustrates the results obtained by the me-dian-based technique presented in [21]. This technique is basedon the WMF approach admitting negative weights defined

Fig. 4. Comparison between proposed filter and WMF followed by masks������� ������ . The images to the left are the original corrupted by noise.

Fig. 5. Vertical edge profiles corresponding to the examples of Fig. 4.

in (10). As indicated in [21], since gradient masks consist ofthe same number of negative and positive weights, the filteroutput within a particular image window is simply equal to

, where is the smallest pixelvalue associated to a positive weight and is the smallestvalue associated to a negative weight. Through a modificationdiscussed in [21], the filter output can be defined as the min-imum between and , where

Page 8: Steerable Weighted Median Filters

CHARALAMPIDIS: STEERABLE WEIGHTED MEDIAN FILTERS 889

Fig. 6. Edge detection example (Lena): (a) original image, (b) using simpledifference masks ���� ��� ������ , (c) using the function in (22) as a linearfilter, (d) using WMF followed by difference masks ������,������ , (e) usingthe median filter in [21], (f) using the proposed filter.

is the largest value associated to a positive weight, andis the largest value associated to a negative weight. The

3 3 operator and its transposewere used as masks. Nevertheless, only the signs and not theactual mask values are of relevance in this case, which is a dis-advantage of the technique. Finally, Fig. 2(f) presents the edgesdetected using the proposed implementation. All techniques,except the linear filter approach using and ,are capable of resolving closely-located edges. For the linearfilter case, the edges shown are obtained via local maximumpoint detection in the direction of the gradient. No similaroperation is required for the other methods since the gradientimages do not contain wide edges.

Fig. 3 presents a similar example in which the image has beencorrupted by impulsive noise of probability 0.2 and uniformlydistributed magnitude in the range 0–1. In other words, approx-imately 20% of the pixels in the original image have been re-placed by a random value in the range 0–1. As expected, thehigh level of noise present renders the simple masksand ineffective, as illustrated in Fig. 3(b). Linear fil-ters perform moderately well in rejecting noise, as shown inFig. 3(c). However, they are still unable to detect closely locatededges. This example demonstrates that, in order to effectivelydetect edges under noise conditions, filters require a relatively

Fig. 7. Edge detection example (Couple): (a) image corrupted by uniform ad-ditive noise, (b) using WMF followed by masks ������,������ , (c) using themedian filter in [21], (d) using the proposed filter.

Fig. 8. Edge detection example (Baboon): (a) original image, (b) using WMFfollowed by difference masks ������,������ , (c) using the median filter in[21], (d) using the proposed filter.

large spatial support depending on the level of noise present inthe image. Nevertheless, linear edge detectors with large spa-tial support tend to blur image characteristics, including edges.The median-based filter in [21] also appears to be sensitive tonoise, as indicated in Fig. 3(e). This is partially due to the smallmask size; however, a larger mask may cause other problems asillustrated in a later example. On the other hand, the proposed

Page 9: Steerable Weighted Median Filters

890 IEEE TRANSACTIONS ON IMAGE PROCESSING, VOL. 19, NO. 4, APRIL 2010

Fig. 9. Edge detection example illustrating the advantage of steerability:(a) original image, (b) using masks ���� ��� ���� �� , (c) using function in(22) as linear filter, (d) using WMF followed by masks ������� ���� �� , (e)using the median filter in [21], (f) using the proposed filter.

filter and the WMF followed by masks and arecapable of identifying edges, while effectively rejecting impul-sive noise. Some local edge shifting occurs due to noise for allfilters.

Since the previous examples identified that the proposed filterand the WMF followed by masks and exhibitthe best performance among the methods compared, their per-formance is further evaluated in Figs. 4 and 5. Fig. 4 presentsedge detection results for four different vertical bar examples,namely for two different bar widths and two different types ofnoise (uniform additive of standard deviation 0.116, and impul-sive of probability 30%). Fig. 5 shows the four correspondingvertical edge profiles obtained by summing the edge image pixelvalues columnwise. The profiles are zoomed around the edgelocations. In Fig. 5, however, the vertical edge profiles are pre-sented for three different levels of noise. In the case of uniformadditive noise, the standard deviations are 0 (thin black line),0.058 (gray line), and and 0.116 (thick black line). In the caseof impulsive noise, the probabilities are 0 (thin black line), 15%(gray line), and 30% (thick black line). The purpose of theseexamples is to illustrate that the proposed filter is more effec-tive in removing noise (as shown in Fig. 4), while it results in

Fig. 10. Orientation analysis example: (a) Original image, (b) filter used in ori-entation analysis. Orientation analysis using: (c) linear steerable filter, (d) SMF.Orientation transition analysis using: (e) linear steerable filter, (f) SMF.

edges of at least the same magnitude and possesses the samecapability in resolving closely located edges as the WMF fol-lowed by masks and . The noise present in theedge images produced by the competing WMF method may notappear to be significant compared to the edge strengths, for thecase of uniform noise. However, in this example, the intensitytransitions defining the edges are the greatest possible. Noise re-sults in more significant problems in cases where weaker edgesare present in the image, as shown in Fig. 7 discussed next.

Next, some edge detection examples are presented for realimages. Fig. 6 illustrates that all edge detection methods may besuccessful under noise-free conditions. However, it is well-es-tablished that linear filtering is not effective in removing im-pulsive noise. Fig. 7 compares the three median-based methodsfor the case where the image is corrupted by uniform noise. A7 7 extended Sobel operator is used for the method in [21],in order to be able to better handle the presence of noise. Nev-ertheless, the intensity at the edges as well as the backgroundhas a “blocky” appearance. This is due to the fact that, as wasdescribed earlier, only the weight signs and not the particularfilter weights are of importance for this method. The proposedfilter appears to be the most successful in rejecting noise. Fig. 8

Page 10: Steerable Weighted Median Filters

CHARALAMPIDIS: STEERABLE WEIGHTED MEDIAN FILTERS 891

Fig. 11. Orientation analysis example: (a) Original image, (b) filter used in ori-entation analysis. Orientation analysis using: (c) linear steerable filter, (d) SMF.Orientation transition analysis using: (e) linear steerable filter, (f) SMF.

compares the three median-based methods for an image wherethere is naturally noise-like texture present. It can be observedthat the proposed filter is the only one capable of ignoring thetexture associated to fur such as in locations around the eyes,while finding all significant edges.

Fig. 9 illustrates an advantage of steerable versus orientationvariant approaches. The particular image is selected since it con-tains edges at different orientations. Only the steerable linearfilter using the function of (22) and the proposed method are ableto correctly determine that all edges are of the same strength, re-gardless of their orientation.

B. Orientation Analysis

In this section, experimental results showcase the perfor-mance of the proposed SMFs in orientation analysis. In allexperiments, the function of (31) is used as both theimpulse response of linear filters and the weight mask of SMFs.Specifically, the filters used in this subsection are defined as

for , where , andzero otherwise. Orientation analysis is performed by applying afilter (linear or SMF) in orientations to obtain an angular pro-file, . In the definition ofit is assumed that if , then .Function is appropriate for capturing the intensity

Fig. 12. Angular transition profiles: (a) steerable linear filter, (b) SMF.

Fig. 13. Angular transition profiles: (a) steerable linear filter, (b) SMF.

characteristics around a specific image location. In orderto obtain angular transition profiles, the difference profile,

isused. In what follows, it is assumed that image intensities varyin the range [0,1], and . Moreover, in some cases,images are depicted using a contrast different than the actualone, so that the superimposed angular transition profiles can beclearly visualized.

Fig. 10 shows an orientation analysis example. Fig. 10(a) de-picts the original image, and Fig. 10(b) shows the filter usedin the experiments for a specific orientation, i.e., .Figs. 10(c) and (d) present the angular profiles, , forthe steerable linear filter and the proposed SMF, respectively.Similarly, Figs. 10(e) and (f) present the angular transition pro-files, , for the linear filter and the SMF, respectively.In this example, a total of filters are used. It canbe observed that the SMF produces an angular profile whosevalues are closer to the actual image intensities over the an-gular range, compared to the linear counterpart. In particular,the original image shown in Fig. 10 has intensities approxi-mately equal to 0.81, 1, 0.81, 0.62, and 1, for the angular ranges

and , re-spectively. Furthermore, the angular profile, , for SMFis capable of identifying sharp angular transitions. Accordingly,these observations are reflected in the angular transition profile,

, which is more accurate for the case of SMF. Thesteerable linear filter is unable to separate the two angular tran-sitions at and . Fig. 10 confirms that median filtersare superior to linear filters in retaining edges and fast transi-tions in images. In this work, this advantage is injected to theconcept of steerability.

The angular resolution of linear filters improves as in-creases. Fig. 11 presents the example of Fig. 10, but for

. For this value of , the steerable linear filter can sepa-rate the two angular transitions at and . Yet, the an-gular profile produced by the SMF is more accurate even for

Page 11: Steerable Weighted Median Filters

892 IEEE TRANSACTIONS ON IMAGE PROCESSING, VOL. 19, NO. 4, APRIL 2010

Fig. 14. Orientation transition analysis: Images corrupted by impulsive noise.

Fig. 15. Orientation transition analysis: Images corrupted by uniform noise.

. Fig. 12 presents the angular transition profiles for, and demonstrates that the distance of the

curve from the center indicates the strength of the angular tran-sition. Although the linear filter is able to detect the significanttransitions, the transition strengths do not reflect the true tran-sition values, which are equal to 0.19, 0.19, 0.19, 0.19, 0.38, atangles , respectively. As shown in Fig. 13,even when , the angular profile for the linear steer-able filters, although improved, is not as accurate as that of theSMF. It should be mentioned at this point that when orienta-tion transition profiles are superimposed on images, such as inFigs. 10(e), (f), 11(e), (f), and 14–17, the profiles are scaled ap-propriately for visualization purposes.

In order to examine the performance of SMFs under noisyconditions, several angular transition profiles are presented forthe image of Fig. 10(a) when it is corrupted by impulsive noiseof 30% probability (in Fig. 14), and uniform noise of standarddeviation 0.058 (in Fig. 15). The SMFs are resistant to impul-

sive noise, while the linear filters appear to be more suitablefor images corrupted by additive noise. Nevertheless, even inthe case of additive noise, the SMFs are still capable of iden-tifying the significant transitions in the orientation transitionprofiles, without producing false transition peaks. The latteris not true for linear filters when images are corrupted by im-pulsive noise.

Fig. 16 presents orientation transition profiles at several, ran-domly selected points around the edges of the Butterfly image.The image has been corrupted by impulsive noise of probability40%. Finally, Fig. 17 presents orientation transition profiles atseveral, randomly selected points around the edges of the Pep-pers image. The particular image indicates that the majority ofthe SMF and linear filter profiles are relatively similar. How-ever, the profiles produced by the linear filters had to be scaledtwice as much compared to the profiles produced by the SMFssince, as mentioned earlier, linear filters do not produce as ac-curate angular profiles as SMFs.

Page 12: Steerable Weighted Median Filters

CHARALAMPIDIS: STEERABLE WEIGHTED MEDIAN FILTERS 893

Fig. 16. Orientation transition analysis at several points in Butterfly image. The image has been corrupted by impulsive noise.

Fig. 17. Orientation transition analysis at several points in Peppers image.

V. DISCUSSION AND CONCLUSION

In this paper, a steerable weighted median filter (SMF) imple-mentation is proposed as an extension to weighted median fil-ters (WMFs). The proposed work aims to join the advantages ofmedian filters and steerable filters. It is well known that medianfilters are good at handling noise, and especially noise of the im-pulsive type, and at preserving distinctive image characteristics,such as edges. On the other hand, steerable filters provide com-putational efficiency. In order to achieve the integration of themedian and steerable concepts, a new WMF approach for han-dling negative weights is introduced. The goal of the proposedwork is not to introduce a particular filter mask with character-istics which are optimal in some sense. Therefore, other filtersinstead of the ones used in the Sections III and IV could be usedto exemplify the performance of SMFs. Nevertheless, the op-timization of SMF weights for more general applications is animportant aspect of filter design, and will be addressed in fu-ture work. Approaches such as the one presented in [23] will beinvestigated.

It may be advantageous at this point to discuss the compu-tational advantage of SMFs over nonsteerable WMFs. In somecases, such an advantage is apparent. For instance, in the case ofedge detection application presented in Section III-A, only twoWMFs are required for determining the median-based gradientmagnitude. A nonsteerable implementation would require sev-eral gradient-based WMF operations applied at several orienta-tions, in order to determine the maximum gradient. In the case

of orientation analysis presented in Section III-B, the computa-tional efficiency advantage of SMFs over nonsteerable WMFsmay not be so obvious. In order to shed some light into thisissue, assume that it is of interest to obtain the weighted medianfor numerous directions. The computational cost necessary forordering the input samples may be disregarded as it is only per-formed once. Consider a single direction out of all directionsof interest for which the weighted median will be computed. Ifthe number of filter weights is equal to , a nonsteerable im-plementation requires, in average, a total of addition oper-ations in order to obtain the CMF from the PMF until the bincorresponding to the median is reached. Here, it was assumedthat each input sample occupies its own bin in the PMF. If allequally-valued input samples occupy the same bin, assuming256 intensity levels in the input image, there are 128 additionsneeded in average to obtain the CMF from the PMF. How-ever, an additional addition operations are needed to popu-late the PMF. If each sample occupies its own bin, sorting of theinput samples is more computationally expensive. Yet, as men-tioned earlier, the time required for sorting may be ignored if thenumber of directions is large. The proposed SMF implementa-tion requires multiplications and additions to linearlycombine the CMFs for each bin. Since the median is determineddirectly from the CMFs, only bins need to be searched.Therefore, a total of operations is needed forthe proposed SMF. In order to evaluate the difference, assumethat for a filter of size .Then, a total of 512 operations is needed, in average, to com-

Page 13: Steerable Weighted Median Filters

894 IEEE TRANSACTIONS ON IMAGE PROCESSING, VOL. 19, NO. 4, APRIL 2010

pute the output of a nonsteerable WMF, while a total of only210 operations is required by the proposed technique. The sav-ings increase as the filter size increases, which is when com-putational efficiency is mostly necessary, and as the number offilters decreases.

APPENDIX

Next, the proofs of the four properties of function pre-sented in Section III-A are demonstrated.

Proof of Property 1: Property 1 states that is nonde-creasing with . The proof of this property is straightforward.Assume that , which would invalidate the prop-erty. Considering that the orientation at which the minimum

occurs is , the assumption would imply that. Since is a PMF the original assumption

is invalid, thus .Proof of Property 2: If , from property 1 it can be

concluded that . Therefore, it is not possible thator can be less than 0.5. In order for an input sample valuecorresponding to the th bin to be the weighted median fora particular orientation , the following two conditions shouldbe both valid: and . Thus, if ,then the value of the input sequence corresponding to bincannot be the the weighted median of the input sequence, forany value of .

Proof of Property 3: If , thenfor at least orientation for which is minimum. Since

is nondecreasing with , a bin exists for whichand . In other words, there exists a

bin, , corresponding to the weighted median, for atleast one orientation. Thus, if , then the maximumweighted median considering all possible orientations, , mustcorrespond to a bin, , for which .

Proof of Property 4: Property 2 states that if , thenthe value of the input sequence corresponding to bin cannotbe the weighted median of the input sequence, for any value of

. From properties 1 and 2, one can conclude that if ,no bin greater than can correspond to the weighted medianvalue for any orientation, . From property 3, if ,then the maximum value of the weighted median with respectto all orientations corresponds to a bin greater or equal to .Therefore, if and the maximum value ofthe weighted median with respect to all orientations, , is equalto the input sample value corresponding to the th bin. Since,

is nondecreasing with , there is only one bin satisfying bothconditions.

REFERENCES

[1] S.-J. Ko and T. M. Forest, “Image sequence enhancement based onadaptive symmetric order statistics,” IEEE Trans. Circuits Syst. II,Analog Digit. Signal Process., vol. 40, no. 8, pp. 504–509, Aug. 1993.

[2] A. Burian and P. Kuosmanen, “Tuning the smoothness of the recur-sive median filter,” IEEE Trans. Image Process., vol. 5, no. 7, pp.1631–1639, Jul. 2002.

[3] A. Kundu and J. Zhou, “Combination median filter,” IEEE Trans.Image Process., vol. 1, no. 3, pp. 422–429, Jul. 1992.

[4] D. G. Karakos and P. E. Trahanias, “Generalized multichannel image-filtering structures,” IEEE Trans. Image Process., vol. 6, no. 7, pp.1038–1045, Jul. 1997.

[5] T. Chen and H. R. Wu, “Adaptive impulse detection usingcenter-weighted median filters,” IEEE Signal Process. Lett., vol.8, no. 1, pp. 1–3, Jan. 2001.

[6] L. Yin, R. Yang, and Y. Neuvo, “Weighted median filters: A tutorial,”IEEE Trans. Circuits Syst. II, Analog Digit. Signal Process., vol. 43,no. 3, pp. 157–192, Mar. 1996.

[7] D. R. K. Brownrigg, “The weighted median filter,” Commun. ACM, vol.27, no. 8, pp. 807–818, Aug. 1984.

[8] R. Yang, L. Yin, M. Gabbouj, J. Astola, and Y. Neuvo, “Optimalweighted median filtering under structural constraints,” IEEE Trans.Signal Process., vol. 43, no. 3, pp. 591–604, Mar. 1995.

[9] P.-T. Yu and W.-H. Lao, “Weighted order statistics filter—Their clas-sification, some properties, and conversion algorithm,” IEEE Trans.Signal Process., vol. 42, no. 10, pp. 2483–2497, Oct. 1994.

[10] W. T. Freeman and E. H. Andelson, “The design and use of steer-able filters,” IEEE Trans. Pattern Anal. Mach. Intell., vol. 13, no. 9,pp. 891–906, Sep. 1991.

[11] E. Simoncelli and H. Farid, “Steerable wedge filters for local ori-entation analysis,” IEEE Trans. Image Process., vol. 5, no. 9, pp.1377–1382, Sep. 1996.

[12] A. A. Bharath and J. Ng, “A steerable complex wavelet constructionand its application to image denoising,” IEEE Trans. Image Process.,vol. 14, no. 7, pp. 948–959, Jul. 2005.

[13] D. Charalampidis and T. Kasparis, “Wavelet—based rotational in-variant segmentation and classification of textural images usingdirectional roughness features,” IEEE Trans. Image Process., vol. 11,no. 8, pp. 825–836, Aug. 2002.

[14] E. Simoncelli, W. Freeman, E. Adelson, and D. Heeger, “Shiftablemultiscale transforms,” IEEE Trans. Inf. Theory, vol. 38, no. 2, pp.587–607, Mar. 1992.

[15] P. Perona, “Deformable kernels for early vision,” IEEE Trans. PatternAnal. Mach. Intell., vol. 17, no. 5, pp. 488–499, May 1995.

[16] P. C. Teo and Y. Hel-Or, “Design of multiparameter steerable func-tions using cascade basis reduction,” IEEE Trans. Pattern Anal. Mach.Intell., vol. 21, no. 6, pp. 552–556, Jun. 1999.

[17] Y. Dong and S. Xu, “A new directional weighted median filter for re-moval of random-valued impulse noise,” IEEE Signal Process. Lett.,vol. 14, no. 3, pp. 193–196, Mar. 2007.

[18] Y. Li, G. R. Arce, and J. Bacca, “Weighted median filters for mul-tichannel signals,” IEEE Trans. Signal Process., vol. 54, no. 11, pp.4271–4281, Nov. 2006.

[19] G. R. Arce, “A general weighted median filter structure admittingnegative weights,” IEEE Trans. Signal Process., vol. 46, no. 12, pp.3195–3205, Dec. 1998.

[20] G. R. Arce and J. L. Paredes, “Recursive weighted median filters ad-mitting negative weights and their optimization,” IEEE Trans. SignalProcess., vol. 48, no. 3, pp. 768–779, Mar. 2000.

[21] G. R. Arce, Nonlinear Signal Processing: A Statistical Approach.New York: Wiley, Nov. 2004.

[22] K.-S. Choi, A. W. Morales, and S.-J. Ko, “Design of linear combinationof weighted medians,” IEEE Trans. Signal Process., vol. 49, no. 9, pp.1940–1952, Sep. 2001.

[23] I. Shmulevich and G. R. Arce, “Spectral design of weighted medianfilters admitting negative weights,” IEEE Signal Process. Lett., vol. 8,no. 12, pp. 313–316, Dec. 2001.

[24] S. Hoyos, Y. Li, J. Bacca, and G. R. Arce, “Weighted median filters ad-mitting complex-valued weights and their optimization,” IEEE Trans.Signal Process., vol. 52, no. 10, pp. 2776–2787, Oct. 2004, Part 1.

Dimitrios Charalampidis (S’99–M’01) receivedthe Diploma degree in electrical engineering andcomputer technology from the University of Patras,Greece, in 1996, and the M.S. and Ph.D. degrees inelectrical engineering from the University of CentralFlorida, Orlando, in 1998 and 2001, respectively.

In August 2001, he joined the Electrical Engi-neering Department, University of New Orleans,New Orleans, LA, where he is currently an As-sociate Professor. His research interests includeimage processing, pattern recognition, digital signal

processing, neural networks, and applications of signal processing to remotesensing.