next up previous contents
Next: Computational Complexity Up: Signed Euclidean DT with Previous: Error correction

CSED Algorithm

Using the above considerations, we can design the following algorithm. First, we apply any approximate signed Euclidean DT algorithm. For instance, let us consider a signed version of Danielsson's raster scanning algorithm [37].

Algorithm 6   4-neighbors Sequential Signed Euclidean Distance transformation (4SSED).


\begin{algorithmic}\AINPUT an $M \times N$\space image $I$\space containing an o...
...$SD(p) \rightarrow SD(p+n)-n$
\ENDIF
\ENDIF
\ENDPROCEDURE
\end{algorithmic}
As before, a special attention should be taken to the efficient computation of distE(dp), either using Leymarie's formulae ([*]) or lookup tables to compute the squares of integers.
In the second step, we apply the corner detection and error correction using the principles of the previous sections, with a slight modification. Indeed, for corner pixels with distE(SD(p)) < 116, we know from chapter 3 that a $3 \times 3$ neighborhood is always sufficient to ensure a correct distance transformation. It is then more computationally efficient to only test the diagonal pixels rather than to make the complex floating point operations of equations ([*]) to ([*]). The algorithm goes as follows.

Algorithm 7   Corner detection and error correction in a signed Euclidean DT.


\begin{algorithmic}\AINPUT An approximate signed Euclidean distance map $SD$ .
...
...$SD(p+n) \rightarrow SD(p)-n$
\ENDIF
\ENDIF
\ENDPROCEDURE
\end{algorithmic}
One can notice that, in contrast with the 4SSED algorithm, the correction step uses a ``write'' formalism in the test() procedure. With the ``read'' formalism, test(p,n) can modify the value of SD(p). With the ``write'' formalism, it can modify the value of SD(p+n).
next up previous contents
Next: Computational Complexity Up: Signed Euclidean DT with Previous: Error correction
Olivier Cuisenaire
1999-10-05