For a pixel p, whose relative location from the nearest object pixel is (dpx,dpy), the only neighbors (nx,ny) that need to be considered are those "in the same direction" as (dpx,dpy ). More precisely, if we consider dpx and dpy positive without loss of generality, the neighbors (nx,ny) to consider are such that
. We wish to
determine which neighbors (nx,ny) should be considered when
propagating pixel p, whose location relative to the nearest
object pixel q is
(dpx,dpy). Let us first consider the upper
bound. If q is also the nearest object pixel for
p1=p+(0,1),
the upper bound for neighbors of p1 is higher than for those of
p, which guarantees no neighbor will be missed.
On the other hand, we consider that
is the nearest
object pixel of p1. The limit between the tiles VP(q) and
VP(q1) is on the mid-perpendicular of q1q. This
mid-perpendicular would be a good upper bound for neighbors of
p, since the information from q only needs to be propagated to
pixels belonging to VP(q). This mid-perpendicular itself is
bounded by the second inequality of (
). Indeed, it
intersects pp1 between p and p1, thus below p1. Also,
its angle must be lower than dpy/dpx. Otherwise, it would
cross q1q between q and q1, which is impossible for the
mid-perpendicular of q1q with q1 on an integer location. The
proof for the lower bound is similar.
Applying this property reduces the computational cost of applying
a
neighborhood from O(n2) to O(n). The "
Euclidean Distance Transformation by
Propagation using Multiple Oriented
Neighborhoods", or EDT-PMON uses the same initialization and
first propagation as algorithm
. The second
propagation works as follows:
One should notice that
dpy/(dpx+1) is added to end instead
of adding dpy/dpx as suggested by the upper bound of
(
). Indeed, in algorithm
, the
information from object pixel q may propagate one step out of
VP(q) before it stops propagating. Using
dpy/(dpx+1) relaxes
the upper bound on ny and addresses this problem.