next up previous contents
Next: Voronoi transformation Up: Exact Euclidean distance transformations. Previous: Sequential processing by raster

   
Independent scanning

In his founding article [132], Rosenfeld proposes an alternative approach to the generation of the city-block (distCB) distance transformation. The N-dimensional problem is decomposed into N 1-dimensional sub-problems. In 2D, the distance from the nearest pixel is first computed in each row independently. Then, these values are used to compute the distances in each columns. With the distCB metric, as defined in eq. [*], both sub-problems have an identical solution: applying the $[ \; 1 \; 0 \; 1 \; ]$ mask back and forth. Paglieroni [118] and Saito and Toriwaki [140] show that a similar approach can be used with the Euclidean metric.

Paglieroni [118] develops a ``unified'' DT algorithm, valid for any metric M that satisfies

 
distM(p,q) = f( |px-qx| , |py-qy| ) (2.27)
|dp1x| < |dp2x| $\textstyle \Rightarrow$ $\displaystyle f( \vert dp_{1x}\vert , \vert dp_y\vert )
\leq f( \vert dp_{2x}\vert , \vert dp_y\vert )$  
|dp1y| < |dp2y| $\textstyle \Rightarrow$ $\displaystyle f( \vert dp_x\vert , \vert dp_{1y}\vert )
\leq f( \vert dp_{x}\vert , \vert dp_{2y}\vert )$  

which is true for all the metrics defined in section [*], including the Euclidean one. The ``row'' scan goes back-and-forth across each row and determines the ``nearest object pixel within the row'' (NOPwR). The key to the algorithm of course relies on the up-and-down column scan.

From equations [*], one can deduce that if the 2D nearest object pixel from pixel p(px,py) is pixel q(qx,qy), then q is the NOPwR of pixel (px,qy), in the same column as p and the same row as q. Therefore, checking all NOPwRs in column px guarantees to find the 2D nearest pixel for p. Paglieroni implements this check with an up-and-down scan over each column. He applies a few simple tests to restrict the number of NOPwRs to consider for each pixel.

  
Figure 2.11: Independent scanning. Left: After left-right scan Right: up-and-down scan, finding the value for D(p) by scanning column px.
\begin{figure}\centerline{\epsfysize=3,6cm
\epsfbox{figures/chapter1/figure12.eps}}
\end{figure}

Saito and Toriwaki [140] particularize Paglieroni's algorithm to the Euclidean metric, in order to restrict further the number of rows to consider for each pixel in the column scans, and therefore reduce the overall computational cost.

Let us consider the column px after the ``row'' scan. Pixel (px,y) in row y of that column contains the value R(y)=(px-qx(y))2 where q(y) is the NOPwR of (px,y). During the up-scan along the column, we want to know to which pixels (px,py) we should propagate the information from (px,y). Saito first notices that if $R(y) \geq R(y+1)$, then the information from row y should not be propagated upwards since distE(p,q(y)) = R(y) + (py-y)2 > distE(p,q(y+1) = R(y+1) + (py-y-1)2 for any p(px,py) with $p_y \geq y+1$. On the other hand, if R(y) < R(y+1), then the information from row y should propagate up to ymax = y+(R(y+1)-R(y)-1)/2, the value for which distE(p,q(y)) > distE(p,q(y+1)). Therefore, in the up-scan part of Saito's algorithm, pixel (px,y) is propagated to (px,y+i) until either $R(y) \geq
R(y+i)$ or ymax is reached. The down-scan proceeds similarly.


next up previous contents
Next: Voronoi transformation Up: Exact Euclidean distance transformations. Previous: Sequential processing by raster
Olivier Cuisenaire
1999-10-05