Professional Documents
Culture Documents
An O1 Time Algorithm For The 3D Euclidean Distance Transform On The CRCW PRAM Model
An O1 Time Algorithm For The 3D Euclidean Distance Transform On The CRCW PRAM Model
An O1 Time Algorithm For The 3D Euclidean Distance Transform On The CRCW PRAM Model
Abstract—In this paper, we develop a parallel algorithm for the 2D Euclidean distance transform (2D_EDT, for short) of a binary image
of size N N in Oð1Þ time using N 2þþ CRCW processors and a parallel algorithm for the 3D Euclidean distance transform (3D_EDT,
for short) of a binary image of size N N N in Oð1Þ time using N 3þþ CRCW processors, where ¼ 1k , ¼ 2cþ111 , k, and c are
constants and positive integers. Our 2D_EDT (3D_EDT) parallel algorithm can be used to build up Voronoi diagram and Voronoi
polygons (polyhedra) in a 2D (3D) binary image also. All of these parallel algorithms can be performed in Oð1Þ time using N 2þþ
(N 3þþ ) CRCW processors. To the best of our knowledge, all results derived above are the best Oð1Þ time algorithms known.
Index Terms—Computer vision, Euclidean distance transform, image processing, parallel algorithm, Voronoi diagram, CRCW PRAM
model.
1 INTRODUCTION
received digital image. A number of different DTs have rithms running in Oðlog log NÞ time on an N 3 LARPBS or in
been developed. The Euclidean distance transform (EDT, Oðlog N log log NÞ time on an N 2 LARPBS. Datta et al. [13]
for short) is based on the Euclidean metrics, whose presented an algorithm running in Oðlog log NÞ time using
application is better than those of DTs based on other N 2þ processors on the LARPBS, where 0 < < 1. As for
metrics. The Euclidean distance transform is an operation Oð1Þ time algorithms for the 2D_EDT computation, Pan et al.
that converts an image consisting of black and white pixels [23] presented an algorithm running in Oð1Þ time on an
(voxels) to an image where each pixel (voxel) has a value N 2 N 2 reconfigurable mesh. Datta et al. [12] presented an
that represents the Euclidean distance to its nearest 1-pixel algorithm running in Oð1Þ time on an N N 2 reconfigur-
(1-voxel). Because the EDT is a global operation, it is able mesh. Wang and Horng [32] presented an Oð1Þ time
prohibitively time consuming when this operation on a
algorithm using N 2:25 processors on the AROB model for the
binary image is performed, especially on a 3D binary image.
2D_EDT computation but it is incorrect. Several sequential
In order to provide the efficient transform computations,
parallelism should be employed. 3D distance transform algorithms were introduced by [4],
Recently, many papers were introduced for constructing [6]. Up to now, some parallel algorithms were introduced
the Euclidean distance transform of a 2D binary image of for constructing the Euclidean distance transform of a
size N N. Hirata [17], and Breu et al. [8] presented OðN 2 Þ 3D binary image of size N N N. Lee et al. [21] presented
time sequential algorithms for computing the Euclidean an Oðlog2 NÞ time algorithm using N 3 processors on the
distance transform. On the EREW PRAM model, Lee et al. EREW PRAM model. Wang and Horng [32] presented an
[22] presented an Oðlog2 NÞ time algorithm using N 2 Oð1Þ time algorithm using N 3:25 processors on the AROB
processors; Pavel and Akl [26] presented an algorithm model for the 3D_EDT computation but it is incorrect.
running in Oðlog NÞ time using N 2 processors. Chen [9] In this paper, we present the first Oð1Þ time parallel
presented an OðN log NÞ time algorithm using logNN EREW algorithms for computing both the exact 2D_EDT and the
exact 3D_EDT on the CRCW PRAM computation model.
We first develop an Oð1Þ time parallel algorithm termed as
. Y.-R. Wang is with the Department of Computer Science and Information ALGORITHM General_Dimension_Expander using N 1þþ
Engineering, St John’s & St. Mary’s Institute of Technology, Taipei,
Taiwan. E-mail: yrwang@mail.sjsmit.edu.tw. CRCW processors, where ¼ 1k , ¼ 2cþ111 , k, and c are
. S.-J. Horng is with the Department of Electrical Engineering, National constants and positive integers. It supports a route to cross
Taiwan University of Science and Technology, Taipei, Taiwan. from a lower dimension to a higher dimension. Then, based
E-mail: horng@mouse.ee.ntust.edu.tw.
on the dimensionality reduction technique, for an N N
Manuscript received 24 June 2002; revised 14 Feb. 2003; accepted 6 May binary image, our parallel algorithm for the 2D_EDT
2003.
For information on obtaining reprints of this article, please send e-mail to: computation can be run in Oð1Þ time using N 2þþ CRCW
tpds@computer.org, and reference IEEECS Log Number 116840. processors. For an N N N binary image, our parallel
1045-9219/03/$17.00 ß 2003 IEEE Published by the IEEE Computer Society
Authorized licensed use limited to: The University of British Columbia Library. Downloaded on October 08,2021 at 15:52:13 UTC from IEEE Xplore. Restrictions apply.
974 IEEE TRANSACTIONS ON PARALLEL AND DISTRIBUTED SYSTEMS, VOL. 14, NO. 10, OCTOBER 2003
Authorized licensed use limited to: The University of British Columbia Library. Downloaded on October 08,2021 at 15:52:13 UTC from IEEE Xplore. Restrictions apply.
WANG AND HORNG: AN Oð1Þ TIME ALGORITHM FOR THE 3D EUCLIDEAN DISTANCE TRANSFORM ON THE CRCW PRAM MODEL 975
Definition 7. For every 1-pixel q of a 2D binary image P, the Lemma 3. Let Pi ¼ ðx; iÞ, Pk ¼ ðx; kÞ, and Pj ¼ ðx; jÞ;
union of all the pixels in the plane that are closer to 1-pixel q i < k < j, be three 0-pixels located in row x which is parallel
than to any other 1-pixels in P is defined to be the Voronoi to Y -axis. Let N Pi ¼ ðm; rÞ and N Pj ¼ ðn; sÞ be the nearest
polygon of q and is denoted by VorðqÞ. For every 1-voxel q of 1-pixels of Pi and Pj , respectively. Then, N Pk ¼ ðp; qÞ locates
a 3D binary image V, the union of all the voxels in the 3D space between columns r and s. That is, r q s. In other words,
that are closer to 1-voxel q than to any other 1-voxels in V is YN Pi YN Pk YN Pj .
defined to be the Voronoi polyhedron of q and is denoted by Proof. See Fig. 3 for the illustration of Lemma 3. The
VorðqÞ. The union of all the Voronoi polygons in a 2D plane or statement of the lemma means that ðm xÞ2 þ ðr iÞ2
all the Voronoi polyhedra in a 3D space is defined to be the ðpxÞ2 þðq iÞ2 and ðpxÞ2 þðqkÞ2 ðmxÞ2 þðr kÞ2 .
Voronoi diagram. Adding this two inequalities, we get rðk iÞ qðk iÞ.
Since i < k, so r q. Similarly, ðp xÞ2 þ ðq kÞ2
2.3 Properties of EDTs ðnxÞ2 þðskÞ2 and ðnxÞ2 þðsjÞ2 ðpxÞ2 þðq jÞ2 .
Lemma 1 introduces a property of 1D_EDT. Adding this two inequalities, we get kðj kÞ sðj kÞ.
Lemma 1. Let Pi ¼ ði; rÞ; Pk ¼ ðk; rÞ; Pj ¼ ðj; rÞ; i < k < j, be Since k < j, so q s. Therefore, r q s. u
t
three 0-pixels located in column r which is parallel to X-axis. The following lemmas introduce some properties of
Let N Pi ðCr Þ ¼ ðm; rÞ and N Pj ðCr Þ ¼ ðn; rÞ be the nearest 3D_EDT.
1-pixels of Pi and Pj in column r, respectively. Let N Pk ðCr Þ Lemma 4 [20], [31]. Let Qk ¼ ðXQk ; YQk ; kÞ be a sequence of
¼ ðq; rÞ, then m q n. In other words, XN Pi ðCr Þ voxels located at plane k , 0 k N 1, with each of them
XN Pk ðCr Þ XN Pj ðCr Þ . See Fig. 2a for the illustration of this in the same Z-column. Let N Qk be the nearest 1-voxel of voxel
lemma. Qk in the 3D space. Then, N Qk 2 fN Qr ðr Þ j 0 k;
r N 1g. It means that the nearest 1-voxel of Qk in
The following lemmas introduce some properties of the 3D space must be one of N Q0 ð0 Þ; N Q1 ð1 Þ; . . . ;
2D_EDT. N QN1 ðN1 Þ. This lemma can be proven in the same way
as shown in Lemma 2. See Fig. 4 for the illustration of this
Lemma 2. Let Pk ¼ ði; kÞ, 0 k N 1, be a sequence of
lemma.
pixels located in row i which is parallel to Y -axis. Let N Pk be
the nearest 1-pixel of pixel Pk in the 2D space. Then, Lemma 5. Let Qi ¼ ðx; y; iÞ, Qk ¼ ðx; y; kÞ, and Qj ¼ ðx; y; jÞ,
N Pk 2 fN Pr ðCr Þ j 0 r N 1g, 0 k N 1. It means where i < k < j, be three 0-voxels located in the same
that the nearest 1-pixel of Pk in the 2D space must be one of Zx;y -column. Let N Qi ¼ ðm; n; rÞ2 r and N Qj ¼ ðu; v; sÞ 2 s
N P0 ðC0 Þ; N P1 ðC1 Þ; . . . ; N PN1 ðCN1 Þ. be the nearest 1-voxels of Qi and Qj in the 3D space,
respectively. Then, NQk ¼ ðp; q; zÞ locates between Z-planes r
Proof. See Fig. 2b for the illustration of Lemma 2. Suppose and s . That is, r z s. In other words, ZN Qi ZN Qk ZN Qj .
there is a pixel Pk ¼ ði; kÞ, 0 k N 1, such that
N Pk ¼ ðs; rÞ is not included in fN Pr ðCr Þ j 0 r N 1g.
Assume Pr ¼ ði; rÞ and N Pr ðCr Þ ¼ ðt; rÞ, then jPr N Pr ðCr Þj
¼ ji tj < ji sj ¼ jPr N Pk j. Therefore,
Authorized licensed use limited to: The University of British Columbia Library. Downloaded on October 08,2021 at 15:52:13 UTC from IEEE Xplore. Restrictions apply.
976 IEEE TRANSACTIONS ON PARALLEL AND DISTRIBUTED SYSTEMS, VOL. 14, NO. 10, OCTOBER 2003
Pc 2i
Qc 2i
Proof. See Fig. 5 for the illustration of Lemma 5. The Proof. Since i¼0 2cþ1 1 ¼ 1, therefore, N ¼ i¼0 N 2cþ1 1 . That
statement of the lemma means that is,
20 21 22 2c
ðm xÞ2 þ ðn yÞ2 þ ðr iÞ2 N ¼ N 2cþ1 1 N 2cþ1 1 N 2cþ1 1 ; . . . ; N 2cþ1 1 :
ðp xÞ2 þ ðq yÞ2 þ ðz iÞ2 ; and
For example, N can be decomposed into N 1=3 N 2=3 if
ðp xÞ2 þ ðq yÞ2 þ ðz kÞ2
c ¼ 1 or N 1=7 N 2=7 N 4=7 if c ¼ 2. Our general max-
2 2 2
ðm xÞ þ ðn yÞ þ ðr kÞ :
imum (minimum) finding algorithm is proceeded in
Adding these two inequalities, we get rðk iÞ zðk iÞ. iterations by applying the basic maximum (minimum)
Since i < k, r z. Similarly,
finding method. After each iteration, a fraction of the
2 2 2
ðp xÞ þ ðq yÞ þ ðz kÞ number of previously survived elements are eliminated
2 2 2
ðu xÞ þ ðv yÞ þ ðs kÞ ; and from further consideration. We describe the details as
2cþ1
2 2 2
ðu xÞ þ ðv yÞ þ ðs jÞ follows: In the first step, the N 1þ (i.e., N 2cþ1 1 ) processors
2cþ1 21 20
ðp xÞ2 þ ðq yÞ2 þ ðz jÞ2 : are partitioned into N 2cþ1 1 subsets each of size N 2cþ1 1
20
N 2cþ1 1 as shown in Fig. 6a. Each subset is responsible for
Adding this two inequalities, we get zðj kÞ sðj kÞ. 20
Since k < j, so z s. Therefore, r z s. u
t finding the maximum (minimum) of N 2cþ1 1 numbers in
Oð1Þ time by invoking the basic maximum (minimum)
finding method. After the first step, only the maximum
3 THE GENERAL MAXIMUM (MINIMUM) (minimum) in each subset survives. Therefore, we are
FINDING ALGORITHM 2cþ1 21
left with N 2cþ1 1 data elements. In the second step, the
In [18], the well-known task of finding the maximum 2cþ1 22
N 1þ processors are further partitioned into N 2cþ1 1
(minimum) of an N-item sequence can be performed in Oð1Þ 21 21
time using N 2 CRCW processors. This method is termed as subsets each of size N 2cþ1 1 N 2cþ1 1 as shown in Fig. 6b.
the basic maximum (minimum) finding method. It first Like before, each subset is responsible for finding the
performs comparisons between all pairs of N-item. Then, 21
maximum (minimum) of N 2cþ1 1 numbers in Oð1Þ time.
based on the ability of the concurrent write of the same
value, the maximum (minimum) item can be identified as Similarly, after the second step, only the maximum
the only item that comes out a “winner” in all its (minimum) in each subset survives and we are left with
comparisons. Based on this well-known result, a general 2cþ1 22
N 2cþ1 1 data elements. The steps described above can be
maximum (minimum) finding algorithm is derived in the
same time complexity but reducing the number of performed iteratively. Finally, in the ðc þ 1Þ-th step,
processors from N 2 to N 1þ , where ¼ 2cþ111 , c is a constant where c is a constant, the N 1þ processors are partitioned
and positive integer. 2cþ1 2cþ1 2c 2c
into N 2cþ1 1 ¼ N 0 ¼ 1 subset of size N 2cþ1 1 N 2cþ1 1 as
Lemma 6. The task of finding the maximum (minimum) of an
shown in Fig. 6c. This subset is responsible for finding
N-item sequence can be performed in Oð1Þ time using N 1þ 2c
CRCW processors, where ¼ 2cþ111 , c is a constant and the maximum (minimum) of the remaining N 2cþ1 1
positive integer. numbers in Oð1Þ time. After this step, the maximum
Authorized licensed use limited to: The University of British Columbia Library. Downloaded on October 08,2021 at 15:52:13 UTC from IEEE Xplore. Restrictions apply.
WANG AND HORNG: AN Oð1Þ TIME ALGORITHM FOR THE 3D EUCLIDEAN DISTANCE TRANSFORM ON THE CRCW PRAM MODEL 977
Authorized licensed use limited to: The University of British Columbia Library. Downloaded on October 08,2021 at 15:52:13 UTC from IEEE Xplore. Restrictions apply.
978 IEEE TRANSACTIONS ON PARALLEL AND DISTRIBUTED SYSTEMS, VOL. 14, NO. 10, OCTOBER 2003
Fig. 7. The illustrations for ALGORITHM General_Dimension_Expander of Case 3D. For clarity and simplicity, instead of presenting each N bl in its
individual Z-plane as shown in Fig. 5, we only show the Z-coordinate of N bl (i.e., ZN bl ) on a Z-column. The value of ZN bl implies in which Z-plane N bl
is located. (a) Illustration for Step 1. (b) Illustration for the result of Step 1. (c) Illustration for Step 2.1. (d) Illustration for Step 2.3.
1
use its ceilings (i.e., dN=bN k ce) as the size of each subset. 1.1 Partition the input points bl of size N into N k subsets
1
Authorized licensed use limited to: The University of British Columbia Library. Downloaded on October 08,2021 at 15:52:13 UTC from IEEE Xplore. Restrictions apply.
WANG AND HORNG: AN Oð1Þ TIME ALGORITHM FOR THE 3D EUCLIDEAN DISTANCE TRANSFORM ON THE CRCW PRAM MODEL 979
1
1.4 end; Proof. In Step 1, the input is partitioned into N k subsets;
Step 2: //Assume ½p; q denote the range from point p the nearest 1-point of each leader of each subset and
1
(included) to point q (included). Let bN1 will be computed in parallel. It takes N k N 1þ ¼
1þk1þ
M1i0 ¼ ½ZN b ; ZN b : For the readability and N processors by Lemma 6. By Lemmas 1, 3, and 5,
11 11
i0 N k ði0 þ1ÞN k
P 1k 1 if any bk 2 S 1i0 , then ZN bk will be located within M1i0 .
analysis, assume N bN1 ¼ N bN . Also, N i0 ¼0 jM1i0 j N:
1
In Step 2, we further partition each S 1i0 into N k subsets
Refer to Fig. 7b for illustration. For each subset S 1i0 , again, and find the nearest 1-point of the leader of
1
partition it into N k subsets and find the nearest 1-point of each newly created subset within M1i0 . In Step 2.3, for
the leader of each newly created subset again within 1
each subset S 1i0 , it takes jM1i0 j1þ N k processors for
M1i0 . //
1 1
2.1 Partition each subset S 1i0 of size N 1k into N k subsets each point b 11 12
k þi1 N k
to find N b 11 12
within
1 2 i0 N i0 N k þi1 N k
1
S 2i0 ; i1 , 0 i0 ; i1 N k 1, each of size N k . Each Subset M1i0 by Lemma 6. Therefore, Step 2 takes
1
S 2i0 ;i1 ¼ fb 11k 12 j0 i0 ; i1 N k 1, 0 1 1
i0 N þi1 N kþi2
12k X
N k 1
0 i2 N 1g: Refer to Fig. 7c for illustration. 1
1 @ jM1i0 j1þ A N k
2.2 for each point b 11k 12 , i0 :¼ 0 to N 1, i1 :¼ 0
k
1 i0 N þi1 N k i0 ¼0
to N k 1 pardo.
2.3 Assign jM1i0 j1þ processors to each point b 1k1
1
i0 N þi1 N
12
k
processors for every S 1i0 , 0 i0 N k 1, to be pro-
(the leader of each subset S 2i0 ;i1 ) and find its cessed in parallel. Since
1
corresponding nearest 1-point, N b 11 12
, X
N k 1
k þi1 N k
i0 N
jM1i0 j N; then
respectively, within M1i0 . Refer to Fig. 7c for i0 ¼0
illustration. 1
2.4 end; X
N k 1
then ZN b will be located within M2i0 ;i1 and processors. Following Step 1 and Step 2, all computations
PN 1k 1 k
i1 ¼0 jM2i0 ;i1 j ¼ jM1i0 j: Based on Step 1 and Step 2, by done from Step 3 till Step k 1 can be done in O(1) time
1
using at most N 1þkþ processors. After k 1 steps, all
1
partitioning the S 2i0 ; i1 into N k subsets again each of size
1 1
1k3
N , the nearest 1-point of the leader of each subset can input are partitioned into N 1k subsets each of size N k . In
Step k:2, for each subset S k1i0 , it takes jMk1i0 j1þ N k
1 1
be found in Oð1Þ time using N 1þkþ processors. Following
Step 3 till Step k 1, all computations done in each step processors for all of the points b 1k 2 S k1i0 to find
1
i0 N þi1
take Oð1Þ time and use at most N 1þkþ processors also. their corresponding nearest 1-points, N b 1 , within
i0 N k þi1
Here, the details of these steps are skipped and only Mk1i0 by Lemma 6. Therefore, Step k takes
Step k is stated as follows. 0 11 1
Step k: // From Step 1 till Step k 1, the input points bl of NX k 1
1
1
size N have been partitioned into N 1k subsets S k1i0 @ jMk1i0 j1þ A N k
1
with each subset S k1i0 ¼ fb 1k j0 i1 N k 1g; i0 ¼0
i0 N þi1
11k 1
0 i0 N 1: For each point b
i0 N k
1 (the leader of each processors for every S k1i0 , 0 i0 N 1k 1, to be
subset S k1i0 ), its nearest 1-point N b has been processed in parallel. Since
1
i0 N k
computed also. Let Mk1i0 ¼ ½ZN b 1
; ZN b 1
: 11
NXk 1
i0 N k ði0 þ1ÞN k
jMk1i0 j N; then
According to Lemmas 1, 3, and 5, if any point bk 2 S k1i0 , i0 ¼0
then ZN bk will be located within Mk1i0 . Also, 11
PN 11k 1 NXk 1
Authorized licensed use limited to: The University of British Columbia Library. Downloaded on October 08,2021 at 15:52:13 UTC from IEEE Xplore. Restrictions apply.
980 IEEE TRANSACTIONS ON PARALLEL AND DISTRIBUTED SYSTEMS, VOL. 14, NO. 10, OCTOBER 2003
column l to compute its nearest 1-pixel in column l. That is, to compute 2D_EDT in parallel. From the previous
for a pixel br ¼ ðr; lÞ, we find its 1D_EDT from those pixels discussion, we have the following result.
with coordinates ð0; lÞ; ð1; lÞ; . . . ; and ðN 1; lÞ. After the Theorem 2. The 2D_EDT of a binary image of size N N can
1D_EDT computation, every pixel br ¼ ðr; lÞ of column l has be computed in Oð1Þ time using N 2þþ processors.
held the output messages of 1D_EDT. They are 1d edtbr ðCl Þ
which is the 1D_EDT of pixel br and the coordinates of By Definition 7, if we assign every pixel p ¼ ði; jÞ the
N br ðCl Þ ¼ ðXN br ðCl Þ ; lÞ. Clearly, coordinates of N p , instead of the Euclidean distance to its
nearest 1-pixel N p , then, for any 1-pixel q, VorðqÞ becomes
1d edtbr ðCl Þ ¼ jbr N br ðCl Þj ¼ jXN br ðCl Þ rj: the set of all pixels which are assigned the coordinates of
If no 1-pixel is in fð0; lÞ; ð1; lÞ; . . . ; ðN 1; lÞg, let XN br ¼ þ1. 1-pixel q. Then, the output of ALGORITHM 2D_EDT_
There are N columns in a 2D binary image of size N N. All CRCW turns out to be the set fVorðqÞ j q ¼ N p ; p ¼ ði; jÞ;
the N columns will execute 1D_EDT in parallel. This 0 i; j N 1g. This concludes the following corollary.
completes the 1D_EDT computation phase. Now, we begin Corollary 2. The Voronoi polygons and Voronoi diagram of a
the 2D_EDT computation phase. We compute the 2D nearest binary image of size N N can be constructed in Oð1Þ time
1-pixel (i.e., 2D_EDT) for every pixel bl ¼ ðr; lÞ of a fixed row r using N 2þþ CRCW processors.
by invoking ALGORITHM General_Dimension_Expander for
4.3 Parallel Algorithm for 3D_EDT
Case 2D. There are N rows in a 2D binary image of size
N N. All the N rows will execute ALGORITHM General_ 4.3.1 Description of Algorithm
Dimension_Expander for Case 2D in parallel. If there is no The parallel algorithm for computing 3D_EDT consists of
1-pixel in the plane, let N bl ¼ ðþ1; þ1Þ. The parallel two phases: the Z-plane phase and the 3D_EDT computa-
algorithm for computing 2D_EDT is stated as follows: tion phase. During the Z-plane phase, for each Z-plane l ,
0 l N 1, we find the 2D_EDT for each pixel in the
ALGORITHM 2D_EDT_CRCW same l plane. Clearly, there are total N independent planes
Input: A 2D N N binary image, each pixel being each of size N N. This is a 2D_EDT problem which can be
represented by p ¼ ðr; lÞ, 0 r; l N 1. implemented by ALGORITHM 2D_EDT_CRCW. At the end
Output: A 2D N N array, each pixel p ¼ ðr; lÞ being of the Z-plane phase, each pixel Q ¼ ðs; tÞ in a fixed l plane
assigned the coordinates of its 2D nearest 1-pixel has the coordinates of its nearest 1-pixel N Q ðl Þ and the
N p ¼ ðXN p ; YN p Þ and 2d edtp , which is the Euclidean 2d edtQ ðl Þ which represents the Euclidean distance from Q
distance from p to its 2D nearest 1-pixel N p . to its nearest 1-pixel N Q ðl Þ. If no 1-pixel is in the l plane,
Remarks: For clarity, p ¼ ðr; lÞ is denoted by br ¼ ðr; lÞ in the then N Q ðl Þ ¼ ðþ1; þ1; lÞ. This completes the Z-plane
1D_EDT computation phase and denoted by bl ¼ ðr; lÞ phase. Then, we begin the 3D_EDT computation phase. We
in the 2D_EDT computation phase. compute the 3D nearest 1-voxel (i.e., 3D_EDT) for every
Step 1: The 1D_EDT computation phase voxel bl ¼ ðs; t; lÞ of a fixed Zs;t -column by invoking
1.1 for column l :¼ 0 to N 1 pardo. ALGORITHM General_Dimension_Expander for Case 3D.
1.2 Apply Corollary 1 for every pixel br ¼ ðr; lÞ of a fixed There are N N Zs;t -columns in a 3D binary image of size
column l to compute its 1D_EDT in parallel. N N N. All of them will execute ALGORITHM
1.3 end; General_Dimension_Expander for Case 3D in parallel. The
Step 2: The 2D_EDT computation phase parallel algorithm for computing 3D_EDT is stated as
2.1 for row r :¼ 0 to N 1 pardo follows:
2.2 Based on the properties of Lemma 2 and Lemma 3, we ALGORITHM 3D_EDT_CRCW
can apply ALGORITHM Input: A 3D N N N binary image V, each voxel being
General_Dimension_Expander for Case 2D on every represented by Q ¼ ðs; t; lÞ, for 0 s; t; l N 1.
pixel bl ¼ ðr; lÞ of a fixed row r to compute its 2D_EDT Output: A 3D N N N array, each voxel Q being
in parallel. assigned the coordinates of N Q ¼ ðXN Q ; YN Q ; ZN Q Þ and
2.3 end; 3d edtQ which is the Euclidean distance from Q to its
nearest 1-voxel N Q .
4.2.2 Time Complexity Analysis Remarks: For clarity, Q ¼ ðs; t; lÞ is denoted by bs ¼ ðs; tÞ in
The complexity analysis of ALGORITHM 2D_EDT_CRCW the 1D_EDT computation phase and denoted by
is stated as follows: We apply Corollary 1 in Step 1.2 to bt ¼ ðs; tÞ in the 2D_EDT computation phase while the
solve the 1D nearest-one problem for one column of a 2D Z-plane phase is invoking ALGORITHM
N N binary image. This can be performed in Oð1Þ time 2D_EDT_CRCW on each Z-plane l . Also, Q ¼ ðs; t; lÞ is
using N 1þþ processors. So the 1D_EDT computation phase denoted by bl ¼ ðs; t; lÞ in the 3D_EDT computation
done in Step 1 will take Oð1Þ time using N 2þþ processors phase.
for all the columns l; 0 l N 1, to compute 1D_EDT in Step 1: The Z-plane phase
parallel. According to Theorem 1, Step 2.2 can be performed 1.1 for l :¼ 0 to N 1 pardo
in Oð1Þ time using N 1þþ processors for a single row. So the 1.2 Apply ALGORITHM 2D_EDT_CRCW on each
2D_EDT computation phase done in Step 2 will take Oð1Þ Z-plane l .
time using N 2þþ processors for all rows r; 0 r N 1, 1.3 end;
Authorized licensed use limited to: The University of British Columbia Library. Downloaded on October 08,2021 at 15:52:13 UTC from IEEE Xplore. Restrictions apply.
WANG AND HORNG: AN Oð1Þ TIME ALGORITHM FOR THE 3D EUCLIDEAN DISTANCE TRANSFORM ON THE CRCW PRAM MODEL 981
TABLE 1
Summary of Comparison Results for Parallel 2D_EDT Algorithms
TABLE 2
Summary of Comparison Results for Parallel 3D_EDT Algorithms
Authorized licensed use limited to: The University of British Columbia Library. Downloaded on October 08,2021 at 15:52:13 UTC from IEEE Xplore. Restrictions apply.
982 IEEE TRANSACTIONS ON PARALLEL AND DISTRIBUTED SYSTEMS, VOL. 14, NO. 10, OCTOBER 2003
[4] G. Borgefors, “Distance Transformations in Arbitrary Dimen- [30] Y. Shiloach and U. Vishkin, “Finding the Maximum, Merging and
sions,” Computer Vision, Graphics, and Image Processing, vol. 27, Sorting in a Parallel Computation Model,” J. Algorithms, vol. 2,
pp. 321-345, 1984. no. 1, pp. 88-102, 1981.
[5] G. Borgefors, “Applications of Distance Transforms,” Aspects of [31] Y.R. Wang, S.J. Horng, Y.H. Lee, and P.Z. Lee, “Parallel
Visual Form Processing, pp. 83-108, 1994. Algorithms for Higher-Dimensional Euclidean Distance Trans-
[6] G. Borgefors, “On Digital Distance Transforms in Three Dimen- forms with Applications,” Proc. Third Int’l Conf. Parallel and
sions,” Computer Vision, Graphics, and Image Processing, vol. 64, Distributed Computing, Applications and Technologies (PDCAT ’02),
pp. 368-376, 1996. pp. 159-166, 2002.
[7] L. Boxer and R. Miller, “Efficient Computing of the Euclidean [32] Y.R. Wang and S.J. Horng, “An Oð1Þ Time Parallel Algorithm for
Distance Transform,” Computer Vision and Image Understanding, the 3D Euclidean Distance Transform on the AROB,” Proc. Int’l
vol. 80, pp. 379-383, 2000. Conf. Parallel and Distributed Processing Techniques and Applications
[8] H. Breu, J. Gil, D. Kirkpatrick, and M. Werman, “Linear Time (PDPTA ’02), pp. 1120-1126, 2002.
Euclidean Distance Transform Algorithms,” IEEE Trans. Pattern [33] Q.Z. Ye, “The Signed Euclidean Distance Transform and Its
Analysis and Machine Intelligence, vol. 17, pp. 529-533, 1995. Applications,” Proc. Ninth Int’l Conf. Pattern Recognition, pp. 495-
[9] L. Chen, “Optimal Algorithm for Complete Euclidean Distance 499, 1988.
Transform,” Chinese J. Computers, vol. 18, no. 8, pp. 611-616, 1995.
[10] L. Chen and H.Y.H. Chuang, “A Fast Algorithm for Euclidean Yuh-Rau Wang received the BS degree in
Distance Transforms of a 2D Binary Image,” Information Processing electrical engineering from National Cheng Kung
Letters, vol. 51, pp. 25-29, 1994. University, Taiwan, in 1976, the MS degree in
[11] P.E. Danielsson, “Euclidean Distance Mapping,” Computer Vision, computer science from Polytechnic University,
Graphics, and Image Processing, vol. 14, pp. 227-248, 1980. Brooklyn Campus, New York, in 1987, and the
[12] A. Datta and S. Soundaralakshmi, “Constant-Time Algorithm for PhD degree in electrical engineering from
the Euclidean Distance Transform on Reconfigurable Meshes,” National Taiwan University of Science and
J. Parallel and Distributed Computing, vol. 61, pp. 1439-1455, 2001. Technology, Taipei, Taiwan, in 2003. During
[13] A. Datta and S. Soundaralakshmi, “Fast and Scalable Algorithms 1987 to 1992, he was the director of the Image
for the Euclidean Distance Transform on the LARPBS,” Proc. 15th Products Research and Development Depart-
Int’l Parallel and Distributed Processing Symp., pp. 1393-1400, 2001. ment, Peripheral Products Business Unit of Acer Group, Taipei, Taiwan.
[14] H.N. Djidjev and A. Lingas, “On Computing Voronoi Diagrams From 1993 to 2003, he was a faculty member of Lan Yang Institute of
for Sorted Point Sets,” Int’l J. Computational Geometry and Technology, I-Lan, Taiwan. During 1993 to 1996, he was the director of
Applications, 1995. the Computer Center and the chairman of the Department of Information
[15] A. Fujiwara, T. Masuzawa, and H. Fujiwara, “An Optimal Parallel Management of Lan Yang Institute of Technology, I-Lan, Taiwan.
Algorithm for the Euclidean Distance Maps of 2D Binary Images,” Currently, he is an associate professor in the Department of Computer
Information Processing Letters, vol. 54, pp. 295-300, 1995. Science and Information Engineering at St. John’s & St. Mary’s Institute
[16] T. Hayashi, K. Nakano, and S. Olariu, “Optimal Parallel of Technology, Taipei, Taiwan. His research interests include image
Algorithms for Finding Proximate Points, with Applications,” processing, computer vision, and parallel algorithms.
IEEE Trans. Parallel and Distributed Systems, vol. 9, no. 3, pp. 1153-
1166, Mar. 1998. Shi-Jinn Horng received the BS degree in
[17] T. Hirata, “A Unified Linear-Time Algorithm for Computing Distant electronics engineering from National Taiwan
Maps,” Information Processing Letters, vol. 58, pp. 129-133, 1996. Institute of Technology, the MS degree in
[18] J. JáJá, An Introduction to Parallel Algorithms. Addison-Wesley, information engineering from National Central
1992. University, and the PhD degree in computer
[19] M.N. Kolountzakis and K.N. Kutulakos, “Fast Computation of the science from National Tsing Hua University in
Euclidean Distance Maps for Binary Images,” Information Proces- 1980, 1984, and 1989, respectively. He has
sing Letters, vol. 43, pp. 181-184, 1992. published more than 100 research papers and
[20] Y.H. Lee, S.J. Horng, and J. Seitzer, “Fast Computation of the received many awards. Currently, he is a full
3D Euclidean Distance Transform on the EREW PRAM Model,” professor in the Department of Computer
Proc. 2001 Int’l Conf. Parallel Processing, pp. 471-478, 2001. Science and Information Engineering at National Taiwan University of
[21] Y.H. Lee, S.J. Horng, and J. Seitzer, “Parallel Computation of the Science and Technology. His research interests include VLSI design,
Euclidean Distance Transform on a Three Dimensional Image multiprocessing systems, and parallel algorithms. For more information,
Array,” IEEE Trans. Parallel and Distributed Systems, vol. 14, no. 3, visit Dr. Horng’s homepage: http://gold.ee.ntust.edu.tw.
pp. 203-212, Mar. 2003.
[22] Y.H. Lee, S.J. Horng, T.W. Kao, F.S. Jaung, Y.J. Chen, and H.R.
Tsai, “Parallel Computation of Exact Euclidean Distance Trans- . For more information on this or any computing topic, please visit
form,” Parallel Computing, vol. 22, pp. 311-325, 1996. our Digital Library at http://computer.org/publications/dlib.
[23] Y. Pan and K. Li, “Constant-Time Algorithm for Computing the
Euclidean Distance Maps of Binary Images on 2D Meshes with
Reconfigurable Buses,” Information Science, vol. 120, pp. 209-221,
1999.
[24] Y. Pan, Y. Li, J. Li, K. Li, and S.-Q. Zheng, “Computing Distance
Maps Efficiently Using an Optical Bus,” Proc. IPDPS 2000
Workshop Parallel and Distributed Computing in Image Processing,
Video Processing and Multimedia (PDIVM 2000), pp. 178-185, 2000.
[25] Y. Pan, Y. Li, J. Li, K. Li, and S.-Q. Zheng, “Efficient Parallel
Algorithms for Distance Maps of 2D Binary Images Using an
Optical Bus,” IEEE Trans. Systems, Man, and Cybernetics-Part A:
Systems and Humans, vol. 32, no. 2, pp. 228-236, 2002.
[26] S. Pavel and S.G. Akl, “Efficient Algorithms for Euclidean
Distance Transform,” Parallel Processing Letters, vol. 5, no. 2,
pp. 205-212, 1995.
[27] A. Rosenfeld and J.L. Pfalz, “Sequential Operations in Digital
Picture Processing,” J. ACM, vol. 13, pp. 471-494, 1966.
[28] A. Rosenfeld and J.L. Pfalz, “Distance Function on Digital
Pictures,” Pattern Recognition, vol. 1, pp. 33-61, 1968.
[29] T. Saito and J.I. Toriwaki, “New Algorithms for Euclidean
Distance Transformation of an n-Dimensional Digitized Picture
with Applications,” Pattern Recognition, vol. 27, no. 11, pp. 1551-
1565, 1994.
Authorized licensed use limited to: The University of British Columbia Library. Downloaded on October 08,2021 at 15:52:13 UTC from IEEE Xplore. Restrictions apply.