Skip to main content

Distance Transform in Images and Connected Plane Graphs

  • Conference paper
  • First Online:
Pattern Recognition Applications and Methods (ICPRAM 2023)

Abstract

The distance transform (DT) serves as a crucial operation in numerous image processing and pattern recognition methods, finding broad applications in areas such as skeletonization, map-matching robot self-localization, biomedical imaging, and analysis of binary images. The concept of DT computation can also be extended to non-grid structures and graphs for the calculation of the shortest paths within a graph. This paper introduces two distinct algorithms: the first calculates the DT within a connected plane graph, while the second is designed to compute the DT in a binary image. Both algorithms demonstrate parallel logarithmic complexity of \(\mathcal{O}(log(n))\), with n representing the maximum diameter of the largest region in either the connected plane graph or the binary image. To attain this level of complexity, we make the assumption that a sufficient number of independent processing elements are available to facilitate massively parallel processing. Both methods utilize the hierarchical irregular pyramid structure, thereby retaining topological information across regions. These algorithms operate entirely on a local level, making them conducive to parallel implementations. The GPU implementation of these algorithms showcases high performance, with memory bandwidth posing the only significant constraint. The logarithmic complexity of the algorithms boosts execution speed, making them particularly suited to handling large images.

Supported by the Vienna Science and Technology Fund (WWTF), project LS19-013.

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

Access this chapter

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 EPUB and 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

Institutional subscriptions

Notes

  1. 1.

    https://waters-gateway.boku.ac.at/.

References

  1. de Assis Zampirolli, F., Filipe, L.: A fast CUDA-based implementation for the Euclidean distance transform. In: 2017 International Conference on High Performance Computing Simulation (HPCS), pp. 815–818 (2017). https://doi.org/10.1109/HPCS.2017.123

  2. Banaeyan, M., Batavia, D., Kropatsch, W.G.: Removing redundancies in binary images. In: Bennour, A., Ensari, T., Kessentini, Y., Eom, S. (eds.) ISPR 2022. Communications in Computer and Information Science, vol. 1589, pp. 221–233. Springer, Cham (2022). https://doi.org/10.1007/978-3-031-08277-1_19

    Chapter  Google Scholar 

  3. Banaeyan, M., Carratù, C., Kropatsch, W.G., Hladůvka, J.: Fast distance transforms in graphs and in gmaps. In: Krzyzak, A., Suen, C.Y., Torsello, A., Nobile, N. (eds.) Structural and Syntactic Pattern Recognition. S+SSPR 2022. LNCS, vol. 13813. pp. 193–202. Springer, Cham (2022). https://doi.org/10.1007/978-3-031-23028-8_20

  4. Banaeyan, M., Kropatsch, W.G.: Pyramidal connected component labeling by irregular graph pyramid. In: 5th International Conference on Pattern Recognition and Image Analysis (IPRIA), pp. 1–5 (2021). https://doi.org/10.1109/IPRIA53572.2021.9483533

  5. Banaeyan, M., Kropatsch, W.G.: Fast labeled spanning tree in binary irregular graph pyramids. J. Eng. Res. Sci. 1(10), 69–78 (2022)

    Article  Google Scholar 

  6. Banaeyan, M., Kropatsch, W.G.: Parallel \(\cal{O} (log(n))\) computation of the adjacency of connected components. In: El Yacoubi, M., Granger, E., Yuen, P.C., Pal, U., Vincent, N. (eds.) ICPRAI 2022. LNCS, vol. 13364, pp. 102–113. Springer, Cham (2022). https://doi.org/10.1007/978-3-031-09282-4_9

    Chapter  Google Scholar 

  7. Banaeyan, M., Kropatsch, W.G.: Distance transform in parallel logarithmic complexity. In: Proceedings of the 12th International Conference on Pattern Recognition Applications and Methods - ICPRAM, pp. 115–123. INSTICC, SciTePress (2023). https://doi.org/10.5220/0011681500003411

  8. Brun, L., Kropatsch, W.G.: Hierarchical graph encodings. In: Lézoray, O., Grady, L. (eds.) Image Processing and Analysis with Graphs: Theory and Practice, pp. 305–349. CRC Press (2012)

    Google Scholar 

  9. Brunet, D., Sills, D.: A generalized distance transform: theory and applications to weather analysis and forecasting. IEEE Trans. Geosci. Remote Sens. 55(3), 1752–1764 (2017). https://doi.org/10.1109/TGRS.2016.2632042

    Article  Google Scholar 

  10. Burt, P.J., Hong, T.H., Rosenfeld, A.: Segmentation and estimation of image region properties through cooperative hierarchial computation. IEEE Trans. Syst. Man Cybern. 11(12), 802–809 (1981)

    Article  Google Scholar 

  11. Demaine, E.D., Hajiaghayi, M., Klein, P.N.: Node-weighted Steiner tree and group Steiner tree in planar graphs. In: Albers, S., Marchetti-Spaccamela, A., Matias, Y., Nikoletseas, S., Thomas, W. (eds.) ICALP 2009. LNCS, vol. 5555, pp. 328–340. Springer, Heidelberg (2009). https://doi.org/10.1007/978-3-642-02927-1_28

    Chapter  Google Scholar 

  12. Ellinas, G., Stern, T.E.: Automatic protection switching for link failures in optical networks with bi-directional links. In: Proceedings of GLOBECOM’96. 1996 IEEE Global Telecommunications Conference, vol. 1, pp. 152–156. IEEE (1996)

    Google Scholar 

  13. Fabbri, R., Costa, L.D.F., Torelli, J.C., Bruno, O.M.: 2D Euclidean distance transform algorithms: a comparative survey. ACM Comput. Surv. (CSUR) 40(1), 1–44 (2008)

    Article  Google Scholar 

  14. Frederickson, G.N.: Fast algorithms for shortest paths in planar graphs, with applications. SIAM J. Comput. 16, 1004–1022 (1987)

    Article  MathSciNet  Google Scholar 

  15. Frey, H.: Scalable geographic routing algorithms for wireless ad hoc networks. IEEE Netw. 18(4), 18–22 (2004)

    Article  Google Scholar 

  16. Haxhimusa, Y.: The Structurally Optimal Dual Graph Pyramid and Its Application in Image Partitioning, vol. 308. IOS Press, Amsterdam (2007)

    Google Scholar 

  17. Haxhimusa, Y., Glantz, R., Kropatsch, W.G.: Constructing stochastic pyramids by MIDES - maximal independent directed edge set. In: Hancock, E., Vento, M. (eds.) 4th IAPR-TC15 Workshop on Graph-based Representation in Pattern Recognition, vol. 2726, pp. 24–34. Springer, Heidelberg (2003). https://doi.org/10.1007/3-540-45028-9_3. http://www.prip.tuwien.ac.at/people/krw/more/papers/2003/GbR/haxhimusa.pdf

  18. Henzinger, M.R., Klein, P., Rao, S., Subramanian, S.: Faster shortest-path algorithms for planar graphs. J. Comput. Syst. Sci. 55(1), 3–23 (1997). https://doi.org/10.1006/jcss.1997.1493. https://www.sciencedirect.com/science/article/pii/S0022000097914938

  19. Hill, B., Baldock, R.A.: Constrained distance transforms for spatial atlas registration. BMC Bioinform. 16(1), 1–10 (2015)

    Article  Google Scholar 

  20. Hong, S.H., Tokuyama, T.: Beyond Planar Graphs. In: Communications of NII Shonan Meetings, vol. 1, pp. 11–29. Springer, Singapore (2020). https://doi.org/10.1007/978-981-15-6533-5

  21. Kassis, M., El-Sana, J.: Learning free line detection in manuscripts using distance transform graph. In: 2019 International Conference on Document Analysis and Recognition (ICDAR), pp. 222–227 (2019)

    Google Scholar 

  22. Klein, P.N., Mozes, S., Sommer, C.: Structured recursive separator decompositions for planar graphs in linear time. In: Symposium on the Theory of Computing (2012)

    Google Scholar 

  23. Klette, R.: Concise Computer Vision, vol. 233. Springer, London (2014). https://doi.org/10.1007/978-1-4471-6320-6

  24. Kropatsch, W.G.: Building irregular pyramids by dual graph contraction. IEE-Proc. Vis. Image Sig. Process. 142(6), 366–374 (1995)

    Google Scholar 

  25. Kropatsch, W.G., Haxhimusa, Y., Pizlo, Z., Langs, G.: Vision pyramids that do not grow too high. Pattern Recogn. Lett. 26(3), 319–337 (2005)

    Article  Google Scholar 

  26. Lindblad, J., Sladoje, N.: Linear time distances between fuzzy sets with applications to pattern matching and classification. IEEE Trans. Image Process. 23(1), 126–136 (2014). https://doi.org/10.1109/TIP.2013.2286904

    Article  MathSciNet  Google Scholar 

  27. Lotufo, R., Falcao, A., Zampirolli, F.: Fast euclidean distance transform using a graph-search algorithm. In: Proceedings 13th Brazilian Symposium on Computer Graphics and Image Processing (Cat. No.PR00878), pp. 269–275 (2000). https://doi.org/10.1109/SIBGRA.2000.883922

  28. Masucci, A.P., Smith, D., Crooks, A., Batty, M.: Random planar graphs and the London street network. Eur. Phys. J. B 71, 259–271 (2009)

    Article  MathSciNet  Google Scholar 

  29. Meer, P.: Stochastic image pyramids. Comput. Vis. Graph. Image Process. 45(3), 269–294 (1989)

    Article  Google Scholar 

  30. Montanvert, A., Meer, P., Rosenfeld, A.: Hierarchical image analysis using irregular tessellations. In: Faugeras, O. (ed.) ECCV 1990. LNCS, vol. 427, pp. 28–32. Springer, Heidelberg (1990). https://doi.org/10.1007/BFb0014847

    Chapter  Google Scholar 

  31. Niblack, C., Gibbons, P.B., Capson, D.W.: Generating skeletons and centerlines from the distance transform. CVGIP: Graph. Models Image Process. 54(5), 420–437 (1992)

    Google Scholar 

  32. Nilsson, O., Söderström, A.: Euclidian distance transform algorithms: a comparative study (2007)

    Google Scholar 

  33. Prakash, S., Jayaraman, U., Gupta, P.: Ear localization from side face images using distance transform and template matching. In: 2008 First Workshops on Image Processing Theory, Tools and Applications, pp. 1–8. IEEE (2008)

    Google Scholar 

  34. Rosenfeld, A., Pfaltz, J.L.: Sequential operations in digital picture processing. Assoc. Comput. Mach. 13(4), 471–494 (1966)

    Article  Google Scholar 

  35. Sharaiha, Y.M., Christofides, N.: A graph-theoretic approach to distance transformations. Pattern Recogn. Lett. 15(10), 1035–1041 (1994). https://doi.org/10.1016/0167-8655(94)90036-1. https://www.sciencedirect.com/science/article/pii/0167865594900361

  36. Sobreira, H., et al.: Map-matching algorithms for robot self-localization: a comparison between perfect match, iterative closest point and normal distributions transform. J. Intell. Robot. Syst. 93(3), 533–546 (2019)

    Article  Google Scholar 

  37. Trudeau, R.: Introduction to Graph Theory. Dover Books on Mathematics, Dover Pub (1993)

    Google Scholar 

Download references

Acknowledgements

We acknowledge the Paul Scherrer Institut, Villigen, Switzerland for the provision of beamtime at the TOMCAT beamline of the Swiss Light Source and would like to thank Dr. Goran Lovric for his assistance. This work was supported by the Vienna Science and Technology Fund (WWTF), project LS19-013, and by the Austrian Science Fund (FWF), projects M2245 and P30275.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Majid Banaeyan .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2024 The Author(s), under exclusive license to Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Banaeyan, M., Kropatsch, W.G. (2024). Distance Transform in Images and Connected Plane Graphs. In: De Marsico, M., Di Baja, G.S., Fred, A. (eds) Pattern Recognition Applications and Methods. ICPRAM 2023. Lecture Notes in Computer Science, vol 14547. Springer, Cham. https://doi.org/10.1007/978-3-031-54726-3_2

Download citation

  • DOI: https://doi.org/10.1007/978-3-031-54726-3_2

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-031-54725-6

  • Online ISBN: 978-3-031-54726-3

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics