pute the DT is presented. Section 3 introduces the
DT over the combinatorial map and proposes a novel
algorithm to compute the DT. Finally, Section 4 com-
pares the execution of the proposed algorithm with the
state-of-the-art.
1.1 Definitions
A digital image can be represented using a 4-adjacent
neighborhood graph. Let G = (V, E) be the neigh-
borhood graph of image P where V corresponds to
P and E relates neighboring pixels. Let the gray-
value g(v) of a vertex v be g(p). The contrast(e)
is an attribute of an edge e(u, v) where u, v ∈ V and
contrast(e) = |g(u) − g(v)|. In the binary images, the
pixels (and corresponding vertices) have either of the
two values 0 and 1. Similarly, the edge contrast has
only two possible values 0 and 1.
In the neighborhood graph of the binary image,
the edges with zero and one contrast are defined as
zero-edge, e
0
, and one-edge, e
1
, respectively. There-
fore, the edges of the graph are partitioned into E =
E
0
∪ E
1
where e
0
∈ E
0
and e
1
∈ E
1
.
1.1.1 Irregular Pyramids
Irregular pyramids (Kropatsch, 1995) are a stack
of successively reduced smaller graphs where each
graph is built from the graph below by selecting a
specific subset of vertices and edges. Two basic op-
erations are used to construct the pyramid: edge con-
traction and edge removal. In the edge contraction, an
edge e = (v, w) is contracted while its two endpoints,
v and w, are identified and the edge is removed. The
edges that were incident to the joined vertices will be
incident to the resulting vertex after the operation. In
edge removal, an edge is removed without changing
the number of vertices or affecting the incidence rela-
tionships of other edges. In each level of the pyramid,
the vertices and edges disappearing in the level above
are called non-surviving and those appearing in the
upper-level surviving ones.
Definition 1 (Contraction Kernel (CK)). A CK is a
tree consisting of a surviving vertex as its root and
some non-surviving neighbors with the constraint that
every non-survivor can be part of only one CK (Ba-
naeyan and Kropatsch, 2022a).
An edge of a CK is denoted by the directed edge
and points towards the survivor.
1.1.2 Combinatorial Pyramids
A combinatorial pyramid is a hierarchy of suc-
cessively reduced combinatorial maps (Brun and
Kropatsch, 2003; Brun and Kropatsch, 2012). In the
CM each edge is encoded by two half-edges where
each half-edge is called a dart, d ∈ D where D is a
finite set of darts. The CM encodes the edges around
each vertex by using the α and the σ as an involution
and a permutation on the set of D, respectively. The
σ encodes consecutive edges around the same vertex
while turning counterclockwise. The clockwise ori-
entation is denoted by σ
−1
. The α provides a one-to-
one mapping between consecutive darts forming the
same edge such that α(α(d)) = d.
2 LOGARITHMIC DT USING
THE IRREGULAR PYRAMID
In the linear algorithms (Nilsson and S
¨
oderstr
¨
om,
2007) the DT is propagated between one vertex
(pixel) and its adjacent vertex (pixel) in each step of
the propagation. Consider a 1D grid of N pixels align-
ing in a horizontal line. In order to propagate the DT
from the most-left pixel to the most-right pixel, N −1
steps are needed. However, thanks to the hierarchical
structure of the pyramid with logarithmic height, such
propagation can be performed only in log(N) steps as
we will see in Section 2.3. In the pyramid, two ver-
tices of a connected component that are not adjacent
(and may be far from each other) at the base level,
may become adjacent at the upper levels of the pyra-
mid.
2.1 Initialization
To compute the DT, the first step is an initializa-
tion procedure where the endpoints of the E
1
re-
ceive DT = 1 and the remaining vertices receive the
DT = ∞. Note that, the proposed algorithm computes
the DT for both background and foreground regions
simultaneously. This is the reason why in the initial-
ization step we assign the DT = 1. The common algo-
rithms for computation of the DT consider the back-
ground as a region with DT = 0. However, to convert
the DT of the proposed algorithm to the common al-
gorithms, it needs only to substitute the DT = 0 of the
background pixels.
2.2 Selecting the CKs
Selecting the CKs is the main procedure in construct-
ing the pyramid. To this aim, we use the proposed
method in (Banaeyan et al., 2022). First, an index
is assigned to each vertex. Using the total order set
defined over the indices, each vertex has a unique in-
teger index, Idx(.). Each non-surviving vertex selects
ICPRAM 2023 - 12th International Conference on Pattern Recognition Applications and Methods
116