next up previous contents
Next: Computational Complexity Up: Propagation with multiple neighborhoods Previous: The PMN algorithm

Oriented neighborhoods

A final improvement to the algorithm is possible using the the following observation.

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

 \begin{displaymath}(n_x-1).\frac{dp_y}{dp_x} < n_y < 1+n_x.\frac{dp_y}{dp_x}
\end{displaymath} (3.9)

To prove this, let us consider figure [*]. 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.

  
Figure 3.6: pixel p only needs to be propagated to neighbors within the grey area
\begin{figure}\centerline{\epsfysize=5cm \epsfbox{figures/chapter2/pmon.eps}}
\end{figure}

On the other hand, we consider that $q_1 \neq q$ 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 $n \times n$ 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:

Algorithm 4   EDT by Propagation with Multiple Oriented Neighborhoods  

\begin{algorithmic}\FOR[Second loop]{$d = 0 \rightarrow d_{\max}$ }
\FORALL{$(p...
...ants are treated similarly}
\ENDIF
\ENDFOR
\ENDFOR
\STATE
\end{algorithmic}

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.


next up previous contents
Next: Computational Complexity Up: Propagation with multiple neighborhoods Previous: The PMN algorithm
Olivier Cuisenaire
1999-10-05