CPL - Chalmers Publication Library

# On computing the exact Euclidean distance transform on rectangular and hexagonal grids

Andrew Mehnert (Institutionen för signaler och system) ; P. T. Jackway
Journal of Mathematical Imaging and Vision (0924-9907). Vol. 11 (1999), 3, p. 223-230.

In this paper we prove an equivalence relation between the distance transform of a binary image, where the underlying distance is based on a positive definite quadratic form, and the erosion of its characteristic function by an elliptic poweroid structuring element. The algorithms devised by Shih and Mitchell [18] and Huang and Mitchell [7], for calculating the exact Euclidean distance transform (EDT) of a binary digital image manifested on a square grid, are particular cases of this result. The former algorithm uses erosion by a circular cone to calculate the EDT whilst the latter uses erosion by an elliptic paraboloid (which allows for pixel aspect ratio correction) to calculate the square of the EDT. Huang and Mitchell's algorithm [7] is arguably the better of the two because: (i) the structuring element can be decomposed into a sequence of dilations by 3 x 3 structuring elements (a similar decomposition is not possible for the circular cone) thus reducing the complexity of the erosion, and (ii) the algorithm only requires integer arithmetic (it produces squared distance). The algorithm is amenable to both hardware implementation using a pipeline architecture and efficient implementation on serial machines. Unfortunately the algorithm does not directly transpose to, nor has a corresponding analogue on, the hexagonal grid (the same is also true for Shih and Mitchell's algorithm [7]). In this paper, however, we show that if the hexagonal grid image is embedded in a rectangular grid then Huang and Mitchell's algorithm [7] can be applied, with aspect ratio correction, to obtain the exact EDT on the hexagonal grid.

Nyckelord: digital grid, distance function, distance transform, elliptic poweroid, euclidean distance, hexagonal grid, rectangular grid, square grid, maps, decomposition, algorithm, images

### Den här publikationen ingår i följande styrkeområden:

Läs mer om Chalmers styrkeområden