Efficient Dilation, Erosion, Opening and Closing Algorithms

We propose an efficient and deterministic algorithm for computing the one-dimensional dilation and erosion (max and min) sliding window filters. For a p-element sliding window, our algorithm computes the 1D filter using 1:5þ oð1Þ comparisons per sample point. Our algorithm constitutes a deterministic improvement over the best previously known such algorithm, independently developed by van Herk [25] and by Gil and Werman [12] (the HGW algorithm). Also, the results presented in this paper constitute an improvement over the Gevorkian et al. [9] (GAA) variant of the HGW algorithm. The improvement over the GAA variant is also in the computation model. The GAA algorithm makes the assumption that the input is independently and identically distributed (the i.i.d. assumption), whereas our main result is deterministic. We also deal with the problem of computing the dilation and erosion filters simultaneously, as required, e.g., for computing the unbiased morphological edge. In the case of i.i.d. inputs, we show that this simultaneous computation can be done more efficiently then separately computing each. We then turn to the opening filter, defined as the application of the min filter to the max filter and give an efficient algorithm for its computation. Specifically, this algorithm is only slightly slower than the computation of just the max filter. The improved algorithms are readily generalized to two dimensions (for a rectangular window), as well as to any higher finite dimension (for a hyperbox window), with the number of comparisons per window remaining constant. For the sake of concreteness, we also make a few comments on implementation considerations in a contemporary programming language.

[1]  Bidyut Baran Chaudhuri An efficient algorithm for running window pel gray level ranking in 2-D images , 1990, Pattern Recognit. Lett..

[2]  Leo Dorst,et al.  Morphological signal processing and the slope transform , 1994, Signal Process..

[3]  Kristel Michielsen,et al.  Morphological image analysis , 2000 .

[4]  Jean Serra,et al.  Image Analysis and Mathematical Morphology , 1983 .

[5]  Thomas S. Huang,et al.  A fast two-dimensional median filtering algorithm , 1979 .

[6]  Pierre Soille,et al.  Morphological gradients , 1993, J. Electronic Imaging.

[7]  Pierre Soille,et al.  Recursive Implementation of Erosions and Dilations Along Discrete Lines at Arbitrary Angles , 1996, IEEE Trans. Pattern Anal. Mach. Intell..

[8]  Bjarne Stroustrup,et al.  C++ Programming Language , 1986, IEEE Softw..

[9]  P. Danielsson Euclidean distance mapping , 1980 .

[10]  Bart M. ter Haar Romeny,et al.  Geometry-Driven Diffusion in Computer Vision , 1994, Computational Imaging and Vision.

[11]  Marcel van Herk A fast algorithm for local minimum and maximum filters on rectangular and octagonal kernels , 1992, Pattern Recognit. Lett..

[12]  Petros Maragos Slope transforms: theory and application to nonlinear signal processing , 1995, IEEE Trans. Signal Process..

[13]  Ioannis Pitas,et al.  Fast algorithms for running ordering and max/min calculation , 1989 .

[14]  Petros Maragos,et al.  Evolution equations for continuous-scale morphological filtering , 1994, IEEE Trans. Signal Process..

[15]  Robert M. Haralick,et al.  Morphologic edge detection , 1987, IEEE J. Robotics Autom..

[16]  Ron Kimmel,et al.  Efficient Dilation, Erosion, Opening, and Closing Algorithms , 2002, IEEE Trans. Pattern Anal. Mach. Intell..

[17]  Guillermo Sapiro,et al.  Implementing continuous-scale morphology via curve evolution , 1993, Pattern Recognit..

[18]  Michael Werman,et al.  Computing 2-D Min, Median, and Max Filters , 1993, IEEE Trans. Pattern Anal. Mach. Intell..

[19]  Joseph Gil,et al.  Compile Time Symbolic Derivation with C++ Templates , 1998, COOTS.

[20]  Jaakko T. Astola,et al.  Improving Gil-Werman Algorithm for Running Min and Max Filters , 1997, IEEE Trans. Pattern Anal. Mach. Intell..

[21]  Kenneth E. Iverson,et al.  A programming language , 1899, AIEE-IRE '62 (Spring).

[22]  Petros Maragos,et al.  Evolution equations for continuous-scale morphology , 1992, [Proceedings] ICASSP-92: 1992 IEEE International Conference on Acoustics, Speech, and Signal Processing.