next up previous contents
Next: CSED Algorithm Up: Signed Euclidean DT with Previous: Signed EDT and Voronoi

Error correction

Once we know where the corners of the digital Voronoi diagram are, we can correct all errors done by the approximate signed Euclidean DT algorithm by checking if the real corner of the VP contains any pixel.

  
Figure 5.2: Neighbors to consider during error correction.
\begin{figure}\centerline{\epsfxsize=8cm
\epsfbox{figures/chapter3/correction.eps}}
\end{figure}

In figure [*], p1 is a corner pixel, neighbored by p2 = p1+(0,1) and p3 = p1+(1,0). The nearest object pixels of p1, p2 and p3 are q1, q2 and q3, respectively. The signed distances are SD(p1)=(dpx1,dpy1), SD(p2)=(dpx2,dpy2) and SD(p3)=(dpx3,dpy3). With that knowledge, we can actually compute the limits of the corner of the continuous Voronoi diagram analytically, since lines L12 and L13 are the mid-perpendicular of q1q2 and q1q3 respectively.
Using pixel p1 as the center of our coordinate system, we have
$\displaystyle L_{12} \; : \; \; n_y$ $\textstyle \leq$ $\displaystyle \alpha_{12}.n_x + \beta_{12}$ (5.7)
$\displaystyle L_{13} \; : \; \; n_y$ $\textstyle \geq$ $\displaystyle \alpha_{13}.n_x + \beta_{13}$ (5.8)

L12 is the mid-perpendicular of q1q2, so that
  
$\displaystyle \alpha_{12}$ = $\displaystyle \frac{dp_{x2}-dp_{x1}}{dp_{y1}-dp_{y2}+1}$ (5.9)
$\displaystyle \beta_{12}$ = $\displaystyle \frac{1}{2} . ( \alpha_{12} . (dp_{x1}+dp_{x2}) -
dp_{y1}-dp_{y2}+1 )$ (5.10)

and L13 is the mid-perpendicular of q1q3, so that
  
$\displaystyle \alpha_{13}$ = $\displaystyle \frac{dp_{x3}-dp_{x1}-1}{dp_{y1}-dp_{y3}}$ (5.11)
$\displaystyle \beta_{13}$ = $\displaystyle \frac{1}{2} . ( \alpha_{13} . (dp_{x1}+dp_{x3-1}) -
dp_{y1}-dp_{y3} )$ (5.12)

Finally, we are interested in the location of the true corner of the Voronoi diagram, i.e. the intersection of L12 and L13. The true corner, (cx,cy), gives us the maximum values of (nx,ny) to consider. In particular, for nx, there is no need to go further than

 \begin{displaymath}n_{x\max} = c_x = \frac{\beta_{12} - \beta_{13}}{\alpha_{13} -
\alpha_{12}}
\end{displaymath} (5.13)

Equations ([*]), ([*]) and ([*]) require some more attention. In ([*]), a singularity could occur if dpy1 = dpy2-1. Fortunately this never happens with $q_1 \neq q_2$. In ([*]), there is a singularity if dpy1 = dpy3. When this happens, it means that L13 is a vertical line, for which $\alpha_{13} = \infty$ is an appropriate slope. Finally, in ([*]), a singularity occurs when $\alpha_{13} = \alpha_{12}$. This means that L12 and L13 are parallels, which only occurs for $\alpha_{13} = \alpha_{12} = \pm 1$. In that case, the pixels in the diagonal direction should be tested until the first one that does not change value.
next up previous contents
Next: CSED Algorithm Up: Signed Euclidean DT with Previous: Signed EDT and Voronoi
Olivier Cuisenaire
1999-10-05