, both sub-problems have an identical
solution: applying the
Paglieroni [118] develops a ``unified'' DT algorithm, valid for any metric M that satisfies
, 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.
![]() |
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
,
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
.
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
or ymax is reached. The down-scan proceeds similarly.