Vous êtes sur la page 1sur 6
Signal Processing 81 (2001) 1565 } 1570 Fast communication Simpli " ed implementation of the

Signal Processing 81 (2001) 1565 } 1570

Signal Processing 81 (2001) 1565 } 1570 Fast communication Simpli " ed implementation of the recursive

Fast communication

Simpli" ed implementation of the recursive median sieve

O. Yli-Harja *, P. Koivisto , J.A. Bangham , G. Cawley , R. Harvey , I. Shmulevich

Signal Processing Laboratory, Tampere University of Technology, P.O. Box 553, 33101, Tampere, Finland School of Information Systems, University of East Anglia, Norwich NR4 7TJ, UK

Received 25 February1999; received in revised form 24 November 2000

Abstract

In this paper we introduce a simpli"ed implementation of the 1D recursive median sieve. The sieve is a multiscale data analysis method based on iterative application of recursive median " lters of increasing window length. We show that this system can be implemented by applying only 3-point median operations, due to the introduction of do not care vertices to the positive Boolean function corresponding to the recursive median " lter. This realisation leads to simpli" ed implementation of the sieve structure. 2001 Elsevier Science B.V. All rights reservced.

Keywords: Recursive median " lter; Datasieve

1. Introduction

Median-type " lters are well suited to image processing, where their nonlinear e!ects are useful. The standard median " lter, for example, removes impulsive noise while preserving sharp edges [3]. Many

median-type " lters, e.g., weighted median and order statistic " lters, can be thought of as special cases of stack

" lters [7] and thus expressed as combinations of minimum and maximum operations. The systems that we

concentrate on in this paper belong to recursive and nonrecursive stack " lters. Stack " lters always reproduce one of the input samples at the output, a property not shared by linear systems. This is sometimes considered useful, e.g., rounding errors are avoided, and nonpre-existing sample values are not introduced. However, problems like streaking can also appear. The merit of the recursive median "lter over the standard one was discussed in [5], and the bene" t of using the recursive median sieve was discussed in [2]. In [8] it was shown that the recursive median " lter is not in itself a reliable estimator of location and should not be used in data smoothing. As the cascading element in the structure of the sieve, however, the recursive median " lter is veryuseful. Also, analytical results supporting this observation have recentlybeen published; see [1] for a treatment of the recursive median

* Corresponding author. Tel: #358-50-5388-007; fax: #358-3-365-2919. E-mail address: yliharja@cs.tut. " (O. Yli-Harja).

0165-1684/01/$ - see front matter 2001 Elsevier Science B.V. All rights reservced. PII: S 0 1 6 5 - 1 6 8 4 ( 0 1 ) 0 0 0 5 4 - 8

1566

O. Yli-Harja et al. / Signal Processing 81 (2001) 1565 } 1570

sieve in the framework of regularisation theory. The de" ciencyproblem of the recursive median "lter is that of massive streaking, which can be identi" ed as an e ! ect that produces runs of equal values in the output, when these runs have no correlate in the input. It turns out that the use of the recursive median sieve reduces this problem to a level comparable to that of the standard median " lter. In this paper, we discuss the simpli" ed implementation of recursive median " lters and the recursive median sieve. We consider the case when recursive median " lters are applied in a cascade of increasing " lter window lengths, that is, the recursive median sieve. We show that the recursive median sieve can be implemented in constant time per scale byapplying only3-point median operations. Finally, we wish to emphasise that actually the datasieve is a much more general concept [2], and here we onlyconsider the ID self-dual version.

2. Basic de5 nitions

First, some basic de" nitions. Throughout this paper, we denote real valued signals bycapitals, whereas

corresponding lower case notation refers to binaryvariables. The output of the recursive median " lter with

" lter window length 2m#1 is de"ned by

> (n)"median > (n!m), 2 , > (n!1), X(n), 2 , X(n#m) ,

(1)

where X and > denote the input and output signals, respectively. As was noted earlier, it is sometimes useful to applyrecursive median " lters in a cascade of increasing " lter window lengths; we then have the recursive median sieve. Usually, the successive window sizes are 3,5,7, 2 ,2s#1, where s is the number of the stages in the sieve (i.e., the number of successive operations). This is also the case in the sieve used in this paper. The output of the 1D recursive median sieve with s stages can now be de" ned as

X (n)"median X (n!s), 2 ,X (n!1), X (n), 2 ,X (n#s) ,

(2)

where X refers to the sieve output after s stages of " ltering, X being the input signal.

3. Simpli5 ed implementation of the recursive median sieve

It has been shown in [4] that if we suppose zero padding, Eq. (1) can be recast into the form

> (n)"max min

max X(n), X(n#1), 2 ,X(n#m) , .

>

(n!1),

min X(n), X(n#1), 2 ,X(n#m)

(3)

Naturally, throughout this paper, instead of zero padding some other constant may be used. The following proposition is an immediate consequence of Eq. (3).

O. Yli-Harja et al. / Signal Processing 81 (2001) 1565 } 1570

1567

Proposition 1. Supposing zero padding, the output of the 1D recursive median sieve is

X (n)"max min X (n!1),

max X (n), X (n#1), 2 ,X (n#s) , ,

min X (n), X (n#1), 2 ,X (n#s)

(4)

where X refers to the sieve output after s stages of x ltering, X being the input signal.

Utilizing the fact that the recursive median sieve is a stack " lter, we can still seek further simpli" cation of the expression giving the recursive median sieve. Namely, because of the threshold decomposition and the stacking property[7], it is su$ cient to consider onlybinaryinputs in deciding the equivalence of stack " lter systems. Thus, we are led to the examination of positive Boolean function (PBF). By noticing that at each scale the input signal to (4) must consist of constant neighbourhoods of length longer or equal to s, we can deduce that the corresponding PBF must have manydo not care vertices, thus allowing simpli" cation. To prove this we relyon the following lemma [5].

Lemma 2. The output signal of a recursive median x lter with window length 2m#1 consists of locally monotonic (non-decreasing or non-increasing) sequences of length at least m#1.

In the binarydomain, Lemma 2 means that any(m#1)-length sequence extracted from the output signal can change its value at most once.

Theorem 3. Supposing zero padding, the output of the 1D recursive median sieve can be expressed as

X (n)"median X (n!1), X (n), X (n#s) ,

(5)

where X refers to the sieve output after s stages of x ltering, X being the input signal.

Proof. Since the " lters considered here are stack " lters, it is su$ cient to consider binarycase only[7]. By Proposition 1 and bybasic properties of binaryoperations, the output of the 1D recursive median sieve in the binarycase is

x (n)"x (n!1)

x (n#k)#

x (n#k),

(6)

where x refers to the sieve output after s stages of " ltering. (Again, x is the input signal.) Moreover, Lemma 2 implies that x consists of constant neighbourhoods of length s or longer. Therefore,

and

x (n#k)"x (n)#x (n#s)

x (n#k)"x (n)x (n#s).

(7)

(8)

1568

O. Yli-Harja et al. / Signal Processing 81 (2001) 1565 } 1570

Hence, using, in addition, basic properties of binaryoperations, we obtain

x (n)"x (n!1)[x (n)#x (n#s)]#x (n)x (n#s)

"median x (n!1), x (n), x (n#s) ,

(9)

from which the result claimed in Theorem 3 immediatelyfollows.

4. Complexity of di4 erent realisations of the recursive median sieve

Let us consider the sth stage of the recursive median sieve; that is, the input signal is "ltered s times in cascade, each time increasing the "lter window size. If the standard implementation of the recursive median

" lter [5] is used, we then have successive window sizes 3,5,7, 2 ,2s#1. Applying the well-known quicksort-

based linear time selection algorithm [6], we can then characterise the complexityof the standard implemen- tation as

(10)

On the other hand, taking advantage of the present three-point implementation of the recursive median sieve, the time complexityreduces to

O(2i#1)"O(s ).

(11)

Fig. 1 illustrates the standard implementation of the recursive median sieve (2) for the " rst three stages. This realisation is di$cult to implement in hardware because it requires the median to be taken over varying sizes of argument sets. This requires that silicon chip area must be alloctaed according to the worst case

O(1)"O(s).

alloctaed according to the worst case O (1) " O ( s ). Fig. 1. The

Fig. 1. The standard implementation of the recursive median sieve (2) for the three " rst stages.

O. Yli-Harja et al. / Signal Processing 81 (2001) 1565 } 1570

1569

et al. / Signal Processing 81 (2001) 1565 } 1570 1569 Fig. 2. The simpli "

Fig. 2. The simpli " ed implementation of the recursive median sieve (5) for s stages.

of the recursive median sieve (5) for s stages. Fig. 3. In the simpli " ed

Fig. 3. In the simpli " ed implementation (5) most of the chip area would be consumed bythe delaylines (for large s). This requires a triangular-shaped portion of the chip. Byfolding, we can convert it into a rectangular module with a verycompact # oorplan.

requirements, that is, according to the last stage of the sieve, which involves the largest median operation. Although the median operation does not require a full sorting network, it is still relativelycostlyto implement. On the other hand, in Fig. 2 we have the simpli" ed implementation of the recursive median sieve (5) for s stages. The regular structure of this realisation, together with the fact that onlythree-point median operations are required, implies that the corresponding hardware implementation will be straightforward and compact (see Fig. 3). Also, the varying delay line that must be implemented for both realizations is simpler in the case of the three-point implementation, having onlyone "nal output instead of multiple intermediate ones.

5. Conclusion

We have shown that the 1D recursive median sieve, based on iterative application of recursive median

" lters of increasing window length, can be implemented byapplying onlya single three-point median operation at each scale. This leads to a simpli"ed hardware implementation of the sieve structure.

References

[1] S. Alliney, Recursive median " lters of increasing order: a variational approach, IEEE Trans. Signal Process. 44 (6) (June 1996)

1346 } 1354.

[2] J.A. Bangham, P. Ling, R. Young, Multiscale recursive medians, scale-space and transforms with applications to image processing, IEEE Trans. Image Process. 5 (6) (1996) 1043 } 1048. [3] B.I. Justusson, Median " ltering: statistical properties, in: T.S. Huang (Ed.), Topics in Applied Physics, Two-Dimensional Digital Signal Processing II, Springer, Berlin, 1981, pp. 161} 196. [4] S.-J. Ko, Y.H. Lee, A.T. Fam, E $cient implementation of one-dimensional recursive median " lters, IEEE Trans. Circuits Systems 37 (11) (1990) 1447 } 1450.

1570

O. Yli-Harja et al. / Signal Processing 81 (2001) 1565 } 1570

[5] T.A. Nodes, N.C. Gallagher Jr., Median " lters: some modi " cations and their properties, IEEE Trans. Acoust. Speech Signal Process. 30 (5) (October 1982) 739 } 746. [6] R. Sedgewick, Algorithms, Addison-Wesley, Reading, MA, 1989. [7] P.D. Wendt, E.J. Coyle, N.C. Gallagher Jr., Stack " lters, IEEE Trans. Acoust. Speech Signal Process. 34 (4) (August 1986) 898} 911. [8] O. Yli-Harja, J.A. Bangham, R. Harvey, R. Aldridge, Correlation properties of cascaded recursive median " lters, IEEE Workshop on Nonlinear Signal and Image Processing, Antalya, Turkey, June 1999, pp. 491} 495.