Distance Transform Based on Weight Sequences

  • Benedek NagyEmail author
  • Robin Strand
  • Nicolas Normand
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 11414)


There is a continuous effort to develop the theory and methods for computing digital distance functions, and to lower the rotational dependency of distance functions. Working on the digital space, e.g., on the square grid, digital distance functions are defined by minimal cost-paths, which can be processed (back-tracked etc.) without any errors or approximations. Recently, digital distance functions defined by weight sequences, which is a concept allowing multiple types of weighted steps combined with neighborhood sequences, were developed. With appropriate weight sequences, the distance between points on the perimeter of a square and the center of the square (i.e., for squares of a given size the weight sequence can be easily computed) are exactly the Euclidean distance for these distances based on weight sequences. However, distances based on weight sequences may not fulfill the triangular inequality. In this paper, continuing the research, we provide a sufficient condition for weight sequences to provide metric distance. Further, we present an algorithm to compute the distance transform based on these distances. Optimization results are also shown for the approximation of the Euclidean distance inside the given square.


Digital distances Weight sequences Distance transforms Neighborhood sequences Chamfer distances Combined distances Approximation of the Euclidean distance 


  1. 1.
    Borgefors, G.: Distance transformations in digital images. Comput. Vis. Graph. Image Process. 34, 344–371 (1986). Scholar
  2. 2.
    Breu, H., Kirkpatrick, D., Werman, M.: Linear time Euclidean distance transform algorithms. IEEE Trans. Pattern Anal. Mach. Intell. 17(5), 529–533 (1995). Scholar
  3. 3.
    Coeurjolly, D., Vacavant, A.: Separable distance transformation and its applications. In: Brimkov, V., Barneva, R. (eds.) Digital Geometry Algorithms. Theoretical Foundations and Applications to Computational Imaging. LNCVB, vol. 2, pp. 189–214. Springer, Dordrecht (2012). Scholar
  4. 4.
    Danielsson, P.E.: Euclidean distance mapping. Comput. Graph. Image Process. 14(3), 227–248 (2008). Scholar
  5. 5.
    Das, P.P., Chakrabarti, P.P.: Distance functions in digital geometry. Inf. Sci. 42, 113–136 (1987). Scholar
  6. 6.
    Fabbri, R., Costa, L.D.F., Torelli, J.C., Bruno, O.M.: 2D Euclidean distance transform algorithms: a comparative survey. ACM Comput. Surv. 40(1), 1–44 (2008). Scholar
  7. 7.
    Goldberg, D.E.: Genetic Algorithms in Search, Optimization & Machine Learning. Addison-Wesley, Boston (1989)zbMATHGoogle Scholar
  8. 8.
    Nagy, B.: Distance functions based on neighbourhood sequences. Publ. Math. Debrecen 63(3), 483–493 (2003)MathSciNetzbMATHGoogle Scholar
  9. 9.
    Nagy, B.: Metric and non-metric distances on \(\mathbb{Z}^n\) by generalized neighbourhood sequences. In: IEEE Proceedings of \(4^{th}\) International Symposium on Image and Signal Processing and Analysis (ISPA 2005), Zagreb, Croatia, pp. 215–220 (2005).
  10. 10.
    Nagy, B.: Distance with generalized neighbourhood sequences in \(nD\) and \(\infty D\). Discrete Appl. Math. 156(12), 2344–2351 (2008). Scholar
  11. 11.
    Nagy, B., Strand, R., Normand, N.: A weight sequence distance function. In: Hendriks, C.L.L., Borgefors, G., Strand, R. (eds.) ISMM 2013. LNCS, vol. 7883, pp. 292–301. Springer, Heidelberg (2013). Scholar
  12. 12.
    Nagy, B., Strand, R., Normand, N.: Distance functions based on multiple types of weighted steps combined with neighborhood sequences. J. Math. Imaging Vis. 60(8), 1209–1219 (2018). Scholar
  13. 13.
    Ragnemalm, I.: The Euclidean distance transform in arbitrary dimensions. Pattern Recogn. Lett. 14(11), 883–888 (1993). Scholar
  14. 14.
    Sethian, J.A.: Level Set Methods and Fast Marching Methods: Evolving Interfaces in Computational Geometry, Fluid Mechanics, Computer Vision, and Materials Science. Cambridge University Press, Cambridge (1999)zbMATHGoogle Scholar
  15. 15.
    Strand, R.: Distance functions and image processing on point-lattices: with focus on the 3D face- and body-centered cubic grids. Ph.D. thesis, Uppsala University, Sweden (2008).
  16. 16.
    Strand, R.: Weighted distances based on neighbourhood sequences. Pattern Recogn. Lett. 28(15), 2029–2036 (2007). Scholar
  17. 17.
    Strand, R., Nagy, B.: A weighted neighborhood sequence distance function with three local steps. In: IEEE Proceedings of \(8^{th}\) International Symposium on Image and Signal Processing and Analysis (ISPA 2011), Dubrovnik, Croatia, pp. 564–568 (2011)Google Scholar
  18. 18.
    Strand, R., Normand, N.: Distance transform computation for digital distance functions. Theor. Comput. Sci. 448, 80–93 (2012). Scholar
  19. 19.
    Yamashita, M., Ibaraki, T.: Distances defined by neighborhood sequences. Pattern Recogn. 19(3), 237–246 (1986). Scholar

Copyright information

© Springer Nature Switzerland AG 2019

Authors and Affiliations

  1. 1.Eastern Mediterranean UniversityFamagustaTurkey
  2. 2.Centre for Image Analysis, Division of Visual Information and InteractionUppsala UniversityUppsalaSweden
  3. 3.Université de Nantes, LS2N UMR CNRS 6004NantesFrance

Personalised recommendations