Skip to main content

Optimal Algorithms for Running Max and Min Filters on Random Inputs

  • Conference paper
  • First Online:

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 9198))

Abstract

Given a d-dimensional array and an integer p, the max (or min) filter is the set of maximum (or minimum) elements within a d-dimensional sliding window of edge length p inside the array. The current best algorithm for computing the 1D max (or min) filter, due to Yuan and Atallah [14], uses \(1+o(1)\) comparisons per sample in the worst case. As a direct consequence, the d-dimensional max (or min) filter can be computed in \((1+o(1))d\) comparisons per sample, and the d-dimensional max and min filters can be computed simultaneously using \((2+o(1))d\) comparisons per sample. Both bounds are the best known results for the corresponding problems, on both worst-case inputs and independently and identically distributed (i.i.d.) inputs.

In this paper, we present an algorithm for computing d-dimensional max and min filters simultaneously on i.i.d. inputs that uses \(1.5+o(1)\) expected comparisons per sample. This is the first algorithm for d-dimensional max and min filters (on i.i.d. inputs) that gets rid of the dependence on d in (the dominating term of) the number of comparisons needed. It is also asymptotically optimal. In particular, for the 1D case, our algorithm improves the previous best upper bound of \(2+o(1)\) to \(1.5+o(1)\). As a by-product of our algorithm, we can also compute the d-dimensional max (or min) filter on i.i.d. inputs using \(1+o(1)\) expected comparisons per sample, which matches the bound for the 1D case.

This work was fully supported by a grant from the Research Grants Council of the Hong Kong Special Administrative Region, China [Project No. CityU 124411].

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Coltuc, D.: Mathematical complexity of running filters on semi-groups and related problems. IEEE Transactions on Signal Processing 56(7), 3191–3197 (2008)

    Article  MathSciNet  Google Scholar 

  2. Cormen, T.H., Leiserson, C.E., Rivest, R.L., Stein, C.: Introduction to algorithms, 3rd edn. MIT press (2009)

    Google Scholar 

  3. Gabow, H.N., Bentley, J.L., Tarjan, R.E.: Scaling and related techniques for geometry problems. In: Proceedings of the 16th Annual ACM Symposium on Theory of Computing (STOC), pp. 135–143 (1984)

    Google Scholar 

  4. Gevorkian, D.Z., Astola, J.T., Atourian, S.M.: Improving Gil-Werman algorithm for running min and max filters. IEEE Transactions on Pattern Analysis and Machine Intelligence 19(5), 526–529 (1997)

    Article  Google Scholar 

  5. Gil, J., Kimmel, R.: Efficient dilation, erosion, opening, and closing algorithms. IEEE Transactions on Pattern Analysis and Machine Intelligence 24(12), 1606–1617 (2002)

    Article  Google Scholar 

  6. Gil, J., Werman, M.: Computing 2-D min, median, and max filters. IEEE Transactions on Pattern Analysis and Machine Intelligence 15(5), 504–507 (1993)

    Article  Google Scholar 

  7. Haralick, R.M., Sternberg, S.R., Zhuang, X.: Image analysis using mathematical morphology. IEEE Transactions on Pattern Analysis and Machine Intelligence 9(4), 532–550 (1987)

    Article  Google Scholar 

  8. Harel, D., Tagjan, R.E.: Fast algorithms for finding nearest common ancestors. SIAM Journal on Computing 13(2), 338–355 (1984)

    Article  MATH  MathSciNet  Google Scholar 

  9. Pitas, I.: Fast algorithms for running ordering and max/min calculation. IEEE Transactions on Circuits and Systems 36(6), 795–804 (1989)

    Article  Google Scholar 

  10. Soille, P.: Morphological Image Analysis: Principles and Applications. Springer-Verlag New York, Inc. (2003)

    Google Scholar 

  11. van Herk, M.: A fast algorithm for local minimum and maximum filters on rectangular and octagonal kernels. Pattern Recognition Letters 13(7), 517–521 (1992)

    Article  Google Scholar 

  12. Vuillemin, J.: A unifying look at data structures. Communications of the ACM 23(4), 229–239 (1980)

    Article  MATH  MathSciNet  Google Scholar 

  13. Yuan, H., Atallah, M.J.: Data structures for range minimum queries in multidimensional arrays. In: Proceedings of the 21st Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), pp. 150–160 (2010)

    Google Scholar 

  14. Yuan, H., Atallah, M.J.: Running max/min filters using 1+o(1) comparisons per sample. IEEE Transactions on Pattern Analysis and Machine Intelligence 33(12), 2544–2548 (2011)

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Shengxin Liu .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2015 Springer International Publishing Switzerland

About this paper

Cite this paper

Liang, H., Liu, S., Yuan, H. (2015). Optimal Algorithms for Running Max and Min Filters on Random Inputs. In: Xu, D., Du, D., Du, D. (eds) Computing and Combinatorics. COCOON 2015. Lecture Notes in Computer Science(), vol 9198. Springer, Cham. https://doi.org/10.1007/978-3-319-21398-9_40

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-21398-9_40

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-21397-2

  • Online ISBN: 978-3-319-21398-9

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics