1003 IEEE TRANSACTIONS ON CIRCUITS AND SYSTEMS, VOL. 38, NO. 9, SEPTEMBER 1991 A Unified Design Method for Rank Order, Stack, and Generalized Stack Filters Based on Classical Bayes Decision Bins Zeng, Moncef Gabbouj, Member, IEEE, and Yrjo Neuvo, Fellow, IEEE Abstract -This paper presents a unified method for designing optimal rank order filters (ROFs), stack filters, and generalized stack filters (GSF’s) under the mean absolute error (MAE) criterion. The method is based on classical Bayes minimum-cost decision. Both the a priori and the a posteriori approaches are considered. It is shown that designing the minimum MAE stack filters and GSFs is equivalent to the a priori Bayes decision. To solve the problem, linear programming (LP), whose complexity increases faster than exponentially as a function of the filter window width, is required. This renders the use of this approach extremely impractical. In this paper, we shall develop subopti- mal routines to avoid the huge complexity of the LP for design- ing stack filters and GSF’s. It is shown that the only required computations then reduce to data comparisons exclusively, and the number of comparisons needed increases only exponentially (for GSFs) or even slower than exponentially (for stack filters) as a function of the filter’s window width. The most important feature of the design routines is perhaps the fact that, for most practical cases, they yield optimal solutions under the MAE criterion. When the a posteriori approach is employed, it is shown that the optimal solutions become ROF’s with appropriately chosen orders that do not depend on the prior probability model of the input process. Moreover, it is shown that the a posteriori Bayes minimum-cost decision reduces to the median filter in frequent practical applications. The filters produced by the a priori and the a posteriori approaches are subjected to a sensitivity analysis to quantify their dependency upon the cost coefficients. Several design ex- amples of ROF’s, stack filters, and GSF’s will be provided, and an application of stack filters and GSFs to image recovery from impulsive noise will be considered. I. INTRODUCTION TACK filters are nonlinear digital filters that were S developed as an alternative to linear filters when the latter failed to accomplish certain tasks in many applica- tions in signal and image processing [1]-[6]. These filters are based on two defining properties: the threshold de- composition and the stacking property [7], [81. The former is a weak superposition property and the latter is an ordering property. Since these are the defining properties Manuscript received July 31, 1990. This paper was recommended by Associate Editor E. J. Coyle. The authors are with the Signal Processing Laboratory, Tampere University of Technology, SF-33101 Tampere, Finland. IEEE Log Number 9101485. of stack filters, they will be discussed in more detail in the next section. This large class of digital filters includes all rank order filters (ROF’s); all compositions of ROF’s; all composi- tions of morphological filters composed of opening and closing operations [91, [lo]; E filters [ll]; and, allowing randomization of outputs and repetition of samples in the window, FIR filters with non-negative weights and order statistic filters in which the linear section has non-nega- tive weights [12]. Generalized stack filters (GSF’s) are an extension of stack filters and include all finite window width digital operations [13]. Some techniques were needed to select one filter among this large class of filters that is best suited for the applica- tion at hand. The theory of minimum mean absolute error (MAE) estimation over the class of stack filters and GSF’s [21-[5], [13] was developed for this purpose. Adaptive stack filtering under the MAE criterion was later devel- oped [6]. Another error criterion, the minimax, was used for selecting the best filter [14]; however, the current paper deals exclusively with the MAE criterion. In [2], it was shown that it is possible to determine the stack filter that minimizes the MAE between its output and a desired signal, given noisy observations of this desired signal. Specifically, it was shown that an optimal window width b stack filter can be determined using a linear program (LP) with O(b2’) variables and con- straints. This algorithm was claimed to be efficient since the number of different inputs to a window width b stack filter is Mh if the filter’s input signal is M-valued and since the number of stack filters grows faster than 2*”* [2]. In 1131, it was shown that the optimal GSF under the MAE criterion can be found via an LP with O((2 I + 3lb> variables and constraints for the homogeneous case and O(M(21+3)’) for the inhomogeneous case (M is as before and 2 1 + 1 threshold levels are fed into the Boolean function at each level). Now, for a “small” window of width seven, I = 1, and eight-bit samples, the LP that tinds the best GSF in minimum MAE sense has 20 million variables! Therefore, finding an optimal GSF with a 3 x 3 window size (considered to be a small mask size for image processing) using this approach is quite impos- sible at the present time. Now, the only alternative left is 0098-4094/91/0900-1003$01.00 01991 IEEE Authorized licensed use limited to: Tampereen Teknillinen Korkeakoulu. Downloaded on February 14, 2009 at 04:41 from IEEE Xplore. Restrictions apply.