Stack filter 是一種很容易實作或是硬體化的非線性的濾波器,它包 含了許多其它種類的濾波器:如一些由型態運算子及順序運算子所構成的 濾波器,因此它的應用範圍很廣。 每一個stack filter 實際上可以由一個positive Boolean function 來代 表。根據這個特性,經由建構一個一對一函數,把每一個positive Boolean function 映對到一個stacking truth graph。每一個stack filter 便可以由一個 stacking truth graph 來代表。然後根據被處理影像與期望輸出影像兩者差 異的絕對值和的大小作為評判誤差的標準,我們對每一個在stacking truth graph 中的節點賦予一個評估函數,以便將來決定每一個節點所代表的那 一個pattern 當輸入時,stack filter 該輸出0 或是1。 利用stacking truth graph 我們提出了三種方法可以找到所有的stack filters,然後就可以算出一個最佳的stack filter;這就是我們主要的構想。 目前文獻指出在當視窗中的觀察個數為3 時有20 個,為4 時有168 個,為 5 時就有7581 個;在本篇論文中,我們找出當視窗中的觀察個數為6 時的 所有7828354 個。因此stack filters 的數目實在太多了,找出所有的stack filters 再一一比較而挑出最好的,實在沒什麼效率,並且當觀察視窗變大 時也沒辦法達到。所以,為了解決這個問題,我們提出一個演算法,包含 了三個stratigies。第一個是reducing-strategy,第二個是single-strategy,第 三個是combined-strategy。在實驗結果中顯示, 我們幾乎只運用了 reducing-strategy 和single-strategy 就可以很快地找到最佳的stack filter。 Stack filters had been defined in [1] and form a large classes of easily implemented nonlinear filters which include the rank-order operators as well as all compositions of morphological operators. They can be applied in many fields[2], such as image processing and pattern recognition [3], and [4]. A stack filter can be expressed as a positive Boolean function (PBF) [1]. In [5], each positive Boolean function can be represented by a graph, which will be called stacking truth graph in this thesis. Hence, we can find all stack filters as long as we can find all stacking truth graphs. The exact number of positive Boolean functions of arbitrary variables is still unknown nowadays. In this thesis, we develop three systematic approaches to find all positive Boolean functions via stacking truth graph. The upper bound of positive Boolean functions of variables 7 will also be given. Next, we choose one among all the positive Boolean functions such that the chosen positive Boolean function is optimal with respect to the minimization of errors between noisy image and desired output image under some error criteria. However, the number of positive Boolean functions is very large when the number of variables is larger than 6. It is impossible to evaluate the errors of each positive Boolean function. To remedy this problem, we develop three strategies to reduce the time complexity of searching algorithms. The first is reducing-strategy. The second is single-strategy. The third is combined-strategy. The time complexity is reduced obviously because most cases is solvable by applying reducing-strategy and single-strategy. Experimental results show that there are exactly 7828354 positive Boolean functions of variables 6 and an optimal stack filter can be found very quickly.