Among the methods described in chapter 2, those of Eggers and Saito appear to be the fastest exact Euclidean DTs. They are used here as the benchmark against which our algorithms are compared. Three versions of our algorithms are considered in this comparison: the approximate PSN and the exact PMN and PMON algorithms. In the PMN algorithm, only the fourth of the neighborhoods N in the same direction as (dpx,dpy) is used.
The choice of images on which the tests are performed is
subjective and may dramatically affect the results. We perform 3
tests, illustrated at Figure
. Test 1,
suggested by Saito, is an image filled with an empty disk, whose
size varies from
to
.
Test 2,
suggested by Eggers, is made of random squares covering
of
the image in total, with an orientation varying between 0o and
90o. Test 3, our suggestion, is the worst case scenario
foreseen by Eggers and Ragnelmam for propagation DTs: a straight
line across the image with an orientation varying between 0o
and 90o. Images for tests 2 and 3 are
pixels
large.
![]() |
The algorithms were implemented in C on a Pentium II computer
running at 233 MHz. We compare the CPU time required by each
algorithm. Results are shown at Figures figure
to
figure
for tests 1 to 3, respectively.
Test 1 (figure
) illustrates the CPU time per pixel
for images of increasing size. An optimal O(n2) algorithm
should therefore give a constant result. It is of course the case
of the approximate PSN algorithm. PMN and PMON display a very
slight increase with the image size, but the relative cost
compared to PSN remains less then a factor 2, even for
images. PMON is faster than PMN as soon as the image
is larger than
.
Saito's and Eggers' algorithms
both have a computational cost per pixel increasing with the image
size. Actually, their complexity is O(n3) for
images. Nevertheless, Saito's algorithm is as fast as PMN or PMON
for small images (
).
Test 2 gives more complex results. All algorithms work faster on images where the squares are either oriented at 0o, 45o or 90o, and slower for orientation near to 22,5o and 67.5o. This effect is more accentuated for Eggers' and Saito's. In average, PSN is the fastest, requiring 1.33 sec. PMN follows (1.54), then PMON (1.60), Eggers (1.82) and Saito (2.14), but these are not significant differences.
Test 3 shows the worst-case scenario for the propagation methods of Ragnelmam and Eggers, for which they are known to have a O(n3) complexity. As in test 1, the disparity between CPU costs is such that the results are here displayed using a logarithmic scale. Eggers' DT performs very poorly for any orientation but the horizontal, vertical and 45° diagonal. Saito's DT performs reasonably well for orientations between 0 and 45°, but very poorly for orientations around 60°. In average, Eggers and Saito are respectively 14 and 7.5 times slower than PSN. In the worst orientation, Eggers and Saito are respectively 25 and 28 times slower than PSN. On the other hand, PMN and PMON only show a limited influence from the orientation. In average, they are 1.45 and 1.3 times slower than PSN. Even in the worst case, they are still less than twice slower than PSN. In contrast with the results of test 2, PMON out-performs PMN for all orientations.
In Figure
, let us also note that Saito's algorithm
is the only one that has a non-symetric behaviour around 45o.
This can easily be understood if one considers that all other
algorithms treat all axis in the same way, while Saito's chooses
to process the image first along one axis, then along the other.
This choice can have a major influence on the computational cost.
Unfortunately this is data dependent, which precludes the choice
of an ordering of the axis that would be optimal in all cases.
This issue is further studied for 3D data in chapter 6.
In conclusion, both PMN and PMON seem to have a O(n2) complexity. Even in the worst case, the cost required to produce the exact EDT is less than double the cost of the approximate PSN. PMON out-performs PMN when the DT includes very large distance values, but its complexity is not justified for smaller images3.1. Both algorithms are major improvements over the methods of Eggers and Saito.