We describe an algorithm that computes a "translated" 2D Neighborhood-Sequence Distance Transform (DT) using a look up table approach. It requires a single raster scan of the input image and produces one line of output for every line of input. The neighborhood sequence is specified either by providing one period of some integer periodic sequence or by providing the rate of appearance of neighborhoods. The full algorithm optionally derives the regular (centered) DT from the "translated" DT, providing the result image on the fly, with a minimal delay, before the input image is fully processed. Its efficiency can benefit all applications that use neighborhood-sequence distances, particularly when pipelined processing architectures are involved, or when the size of objects in the source image is limited.
Source CodeA C++ implementation of this algorithm and the on-line demo are accessible at the IPOL web page of this article 1 .Keywords: discrete distance; neighborhood-sequence distance; distance transform; LambekMoser inverse
OverviewAmong discrete distances defined between points of Z 2 many of them are path-based distances: the distance between two points is the length of the shortest path that connects the points. A path P from p to q is a sequence of points p 0 = p, p 1 , . . . , p n = q where each displacement between 1 http://dx