0% found this document useful (0 votes)
10 views12 pages

Carlinet 201X Itip

Uploaded by

cuitao42
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views12 pages

Carlinet 201X Itip

Uploaded by

cuitao42
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

A Comparative Review of Component Tree

Computation Algorithms
Edwin Carlinet, Thierry Géraud

To cite this version:


Edwin Carlinet, Thierry Géraud. A Comparative Review of Component Tree Computa-
tion Algorithms. IEEE Transactions on Image Processing, 2014, 23 (9), pp.3885 - 3895.
�10.1109/TIP.2014.2336551�. �hal-01474830�

HAL Id: hal-01474830


https://inria.hal.science/hal-01474830v1
Submitted on 23 Feb 2017

HAL is a multi-disciplinary open access L’archive ouverte pluridisciplinaire HAL, est


archive for the deposit and dissemination of sci- destinée au dépôt et à la diffusion de documents
entific research documents, whether they are pub- scientifiques de niveau recherche, publiés ou non,
lished or not. The documents may come from émanant des établissements d’enseignement et de
teaching and research institutions in France or recherche français ou étrangers, des laboratoires
abroad, or from public or private research centers. publics ou privés.
IEEE TRANSACTIONS ON IMAGE PROCESSING 1

A Comparative Review of Component Tree


Computation Algorithms
Edwin Carlinet*, Student Member, IEEE, Thierry Géraud, Member, IEEE

Abstract—Connected operators are morphological tools that in astronomical imagery [12], and even multivariate data with
have the property of filtering images without creating new special ordering relation [13]. With the improvement of optical
contours and without moving the contours that are preserved. sensors, images are getting bigger (so do image data sets)
Those operators are related to the max-tree and min-tree repre- which argues for the need for fast algorithms. Many algorithms
sentations of images, and many algorithms have been proposed have been proposed to compute the max-tree efficiently but
to compute those trees. However, no exhaustive comparison of
only partial comparisons have been proposed. Moreover, some
these algorithms has been proposed so far, and the choice of
an algorithm over another depends on many parameters. Since of them are dedicated to a particular task (e.g., filtering) and
the need for fast algorithms is obvious for production code, we are unusable for other purposes.
present an in-depth comparison of the existing algorithms in a In a short paper [14], we have presented a first comparison
unique framework, as well as variations of some of them that of many state-of-the-art max-tree algorithms in a unique frame-
improve their efficiency. This comparison involves both sequential work, i.e., same architecture, same language (C++) and same
and parallel algorithms, and execution times are given w.r.t. the outputs. Yet this comparison was performed on a single image,
number of threads, the input image size, and the pixel value the pseudo-code of all the algorithms were not listed, and
quantization. Eventually, a decision tree is given to help the user the description of those algorithms and their comparison were
choose the most appropriate algorithm with respect to the user short. This paper aims at correcting those three drawbacks,
requirements. To favor reproducible research, an online demo
allows the user to upload an image and bench the different
so it presents a full and exhaustive comparative review of the
algorithms, and the source code of every algorithms has been state-of-art component tree computation algorithms.
made available. The paper is organized as follows. Section II recalls basic
notions and manipulations of max-tree. Section III describes
Keywords—Component tree, max-tree, min-tree, connected oper- the algorithms and implementations used in this study; in
ators, filtering, mathematical morphology, algorithms.
particular, a new technique that improves the efficiency of
EDICS Categories: ARS-RBS, TEC-PRC, SMR-STM union-find-based algorithms is presented in Section III-A4.
Section IV is dedicated to the comparison of those algorithms
both in terms of complexity and running times through exper-
I. I NTRODUCTION imentations. Last we conclude in Section V.
N mathematical morphology, connected filters are those
I that modify an original image by only merging flat zones,
hence those that preserve some of the original image contours.
II. A TOUR OF MAX - TREE : DEFINITION , REPRESENTATION
AND ALGORITHMS
Originally, they were mostly used for image filtering [1, 2].
Major advances came from max- and min-tree as hierarchical A. Basic notions for max-tree
representations of connected components and from an efficient Let f : Ω → V be an image on a regular domain Ω,
algorithm able to compute them [3]. Since then, usage of these having values on a totally preordered set (V, ≤) and let N
trees has soared for more advanced forms of filtering: based on be a neighborhood on Ω. Let λ ∈ V , we note [f ≤ λ]
attributes [4, 5], using new filtering strategies [3, 6], allowing the set { p ∈ Ω, f (p) ≤ λ }. Let X ⊂ Ω, we note
new types of connectivity [7]. They are also a base for other CC (X) ⊂ P(Ω) the set of connected components of X w.r.t.
image representations. In [8] a tree of shapes is computed from the neighborhood N ; P(Ω) being the power set of all the
a merge of the min- and max- trees. In [9] a component tree possible subsets of Ω. { CC ([f = λ]), λ ∈ V } are level
is computed over the attributes values of the max-tree. Max- components and Ψ = { CC ([f ≥ λ]), λ ∈ V } (resp. ≤) is
trees have been involved in many applications: computer vision the set of upper components (resp. lower components). The
through motion extraction [3], features extraction with MSER latter endowed with the inclusion relation form a tree called
[10], segmentation, 3D visualization [11]. With the increase the max-tree (resp. min-tree). Since min- and max-trees are
of applications comes an increase of data type to process: 12- dual, this study obviously holds for min-tree as well. Finally,
bit images in medical imagery [11], 16-bit or float images the peak component of p at level λ noted Ppλ is the upper
component X ∈ CC ([f ≥ λ]) such that p ∈ X.
* [email protected]
The authors are both with EPITA Research and Development Laboratory
(LRDE), 14-16 rue Voltaire, FR-94276 Le Kremlin-Bicêtre, France, and B. Max-tree representation
with Université Paris-Est, Laboratoire d’Informatique Gaspard-Monge, A3SI,
ESIEE Paris, 2 bd Blaise Pascal, B.P. 99, FR-93162 Noisy-le-Grand Cedex, Berger et al. [12], and Najman and Couprie [15] rely on a
France. simple and effective encoding of component-trees using an
2 IEEE TRANSACTIONS ON IMAGE PROCESSING

A B C function COMPUTE - ATTRIBUTE(S, parent, f )


root B E B proot ← S[0]
A B C 10 F D E F
15 13 16 E F F for all p ∈ S do attr(p) ← â(p, f (p))
D E F 12 D,E,H G H I for all p ∈ S backward, p 6= proot do
12 12 10 B E E E q ← parent(p)
G H I 14 I
16 12 14 A parent attr(q) ← attr(q)+̂attr(p)
16 C G return attr
S F E BH I DCGA
(a) Original im- (b) Max-tree of f (c) Max-tree representa- function DIRECT- FILTER(S, parent, f , attr)
age f tion proot ← S[0]
if attr(proot ) < λ then out(proot ) ← 0
Fig. 1. Representation of a max-tree using the 4-connectivity with a parent else out(proot ) ← f (proot )
image and an array. Canonical elements are underlined.
for all p ∈ S forward do
q ← parent(p)
image that stores the parent relationship. The latter exists if f (q) = f (p) then out(p) ← out(q) . (1)
between two components A and B whenever A is directly else if attr(p) < λ then out(p) ← out(q) . (2)

included in B (parent is actually the covering relation of else out(p) ← f (p) . (3)

(Ψ, ⊆)). An upper component is represented by a single point return out


(1) p not canonical, (2) Criterion failed, (3) Criterion passed
called the canonical element [12, 15] or level root. Let two
points p, q ∈ Ω, and pr be the root of the tree. We say
Fig. 2. Computation of attributes and filtering.
that p is canonical if p = pr or f (parent(p)) < f (p). A
parent image shall satisfy the following three properties: 1)
parent(p) = p ⇒ p = pr - the root points to itself and it is the no attribute computation nor filtering are performed during tree
only point verifying this property - 2) f (parent(p)) ≤ f (p) construction for clarity reasons; yet they can be augmented to
and 3) parent(p) is canonical. compute attribute and filtering at the same time. Fig. 2 provides
Furthermore, having just the parent image is an incomplete an implementation of attribute computation and direct-filtering
representation since it is not sufficient to easily perform with the representation. â : Ω × V → A is an application that
classical tree traversals. For that, we need an extra array projects a pixel p and its value f (p) in the attribute space
of points, S : N → Ω, where points are stored so that A. +̂ : A × A → A is an associative operator used to merge
∀i, j ∈ N i < j ⇒ S[j] 6= parent(S[i]). Thus browsing S attributes of different nodes. COMPUTE - ATTRIBUTE starts with
elements allows to traverse the tree downwards i.e from the computing attributes of each singleton node and merges them
top (the root) to the bottom of the tree (the leaves). On the from leaves toward root. Note that this simple code relies on
contrary, a reverse browsing of S is an upward tree traversal. the fact that a node receives all information from its children
Note that having both S and parent thus makes it useless to before passing its attribute to the parent. Without any ordering
store the children of each node. Fig. 1 shows an example of on S, it would not have been possible. DIRECT- FILTER is an
such a representation of a max-tree. This representation only implementation of direct filtering as explained in [3] that keeps
requires 2nI bytes memory space where n is the number of all nodes passing a criterion λ and lowers nodes that fail to the
pixels and I the size in bytes of an integer, since points stored last ancestor “alive”. This implementation has to be compared
in S and parent are actually positive offsets in a pixel buffer. with the one in [17] that only uses parent. This one is shorter,
The algorithms we compare have all been modified to output faster and clearer above all.
the same tree encoding, that is, the couple (parent, S).

III. M AX - TREE ALGORITHMS


C. Attribute filtering and reconstruction
A classical approach for object detection and filtering is to Max-tree algorithms can be classified in three classes:
compute some features called attributes on max-tree nodes. A Immersion algorithms. It starts with building N disjoints
usual attribute is the number of pixels in components. Followed singleton for each pixel and sort them according to their gray
by a filtering, it leads to the well-known area opening. More value. Then, disjoint sets merge to form a tree using the union-
advanced attributes have been used like elongation, moment of find algorithm [18, 19].
inertia [16] or even mumford-shah like energy [9]. Some max- Flooding algorithms. A first scan allows to retrieve the root
tree algorithms [17, 10] construct the parent image only; they which is a pixel at lowest level in the image. Then, it performs
do not compute S. As a consequence, they do not provide a a propagation by flooding first the neighbor at highest level i.e.
“versatile” tree, i.e., a tree that can be easily traversed upwards a depth first propagation [3, 20].
and downwards, that allows attribute computation and non- Merge-based algorithms. They divide an image in blocks
trivial filtering. Here we require every algorithms to output a and compute the max-tree on each sub-image using another
“complete” tree representation (parent and S) so that it can be max-tree algorithm. Sub max-trees are then merged to form
multi-purposedly usable. The rationale behind this requirement the tree of the whole image. Those algorithms are well-suited
is that, for some applications, filtering parameters are not for parallelism using a map-reduce (or divide-and-conquer)
known yet at the time the tree is built (e.g., for interactive approach [21, 17]. When blocks are image lines, dedicated 1D
visualization [11]). In the algorithms we compare in this paper, max-tree algorithms can be used [22, 23, 24].
IEEE TRANSACTIONS ON IMAGE PROCESSING 3

function F IND - ROOT(par, p)


A. Immersion algorithms if par(p) 6= p then par(p) ← FIND - ROOT(par, par(p))
1) Basic principle: Berger et al. [12], Najman and Couprie return par(p)
[15] proposed two algorithms based on Tarjan’s union-find.
They consist in tracking disjoints connected components and function M AXTREE(f )
merge them in a bottom-up fashion. First, pixels are sorted for all p do parent(p) ← −1
in an array S where each pixel p represent the singleton S ← sort pixels increasing
set {p}. Then, we process pixels of S in backward order. for all p ∈ S backward do
parent(p) ← p; zpar(p) ← p . make-set
When a pixel p is processed, it looks for already processed for all n ∈ Np such that parent(n) 6= −1 do
neighbors (N (p)) and merges with neighboring connected r ← FIND - ROOT(zpar, n)
components to form a new connected set rooted in p. The if r 6= p then
merging process consists in updating the parent pointer of zpar(r) ← p . merge-set
parent(r) ← p
neighboring component roots toward p. Thus, the union-find
relies on three processes: make-set(parent, x) that C ANONICALIZE(parent, S)
return (parent, S)
builds the singleton set {x}, find-root(parent, x)
that finds the root of the component that contains x, and procedure C ANONICALIZE(f , parent, S)
merge-set(parent, x, y) that merges components for all p in S forward do
rooted in x and y and set x as the new root. Based on the q ← parent(p)
above functions, a simple max-tree algorithm is given below: if f (q) = f (parent(q)) then parent(p) ← parent(q)

procedure M AXTREE(f ) Fig. 3. Union-find without union-by-rank.


S ← sort pixels increasing
for all p ∈ S backward do
make-set(parent, p) i.e parent(p) = p with p 6= −1, thus testing parent(p) 6= −1
for all n ∈ Np processed do stands for is p already processed. Since S is processed in
r ← find-root(parent, n)
if r 6= p then merge-set(parent, p, r)
reverse order and merge-set sets the root of the tree to the
current pixel p (parent(r) ← p), it ensures that the parent p
find-root is a O(n) function that makes the above will be seen before its child r when traversing S in the direct
procedure a O(n2 ) algorithm. Tarjan [19] discussed two impor- order.
tant optimizations to avoid a quadratic complexity: root path
compression and union-by-rank. procedure M AXTREE(f )
for all p do parent(p) ← −1
When parent is traversed to get the root of the component,
points of the path used to find the root collapse to the root the S ← sort pixels increasing
for all p ∈ S backward do
component. However, path compression should not be applied parent(p) ← p; zpar(p) ← p . make-set
on parent image because it removes the hierarchical structure rank(p) ← 0; repr(p) ← p
of the tree. As consequence, we apply path compression on zp ← p
an intermediate image zpar that stores the root of disjoints for all n ∈ Np s.t. parent(n) 6= −1 do
zn ← FIND - ROOT(zpar, n)
components. Path compression bounds union-find complexity if zn 6= zp then
to O(n log n) and has been applied in [12] and [15]. parent(repr(zn )) ← p
When merging two components A and B, we have to select if rank(zp ) < rank(zn ) then swap(zp , zn )
one of the roots to represent the newly created component. If zpar(zn ) ← zp . merge-set
A has a rank greater than B then rootA is selected as the new repr(zp ) ← p
root, rootB otherwise. When rank matches the depth of trees, it if rank(zp ) = rank(zn ) then rank(zp ) ← rank(zp )+1
enables tree balancing and guaranties a O(n log n) complexity C ANONICALIZE(parent, S)
for union-find. When used with path compression, it allows to return (parent, S)
compute the max-tree in quasi-linear time (O(n.α(n)) where
α(n) is the inverse of Ackermann function which is very low- Fig. 4. Union-find with union-by-rank
growing). Union-by-rank has been applied in [15].
Note that parent and zpar encode two different things, 2) Union-by-rank: The algorithm given in Fig. 4 is similar
parent encodes the max tree while zpar tracks disjoints set to the one in Fig. 3 but augmented with union-by-rank. It first
of points and also uses a tree. Thus, union-by-rank and root introduces a new image rank. The make-set step creates a
path compression shall be applied on zpar but never on parent. tree with a single node, thus with a rank set to 0. The rank
The algorithm given in Fig. 3 is the union-find-based max- image is then used when merging two connected sets in zpar.
tree algorithm as proposed by [12]. It starts with sorting pixels Let zp be the root of the connected component of p, and zn be
that can be done with a counting sort algorithm for low- the root of connected component of n ∈ N (p). When merging
quantized data or with a radix sort-based algorithm for high two components, we have to decide which of zp or zn becomes
quantized data [25].Then it annotates all pixels as unprocessed the new root w.r.t their rank. If rank(zp ) < rank(zn ), zp
with −1 (in common implementations, pixels are positive becomes the root, zn otherwise. If both zp and zn have the
offsets in a pixel buffer). Later in the algorithm, when a same rank then we can choose either zp or zn as the new
pixel p is processed it becomes the root of the component root, but the rank should be incremented by one. On the other
4 IEEE TRANSACTIONS ON IMAGE PROCESSING

function M AXTREE(f )
hand, the relation parent is unaffected by the union-by-rank, p for all p do parent(p) ← −1
becomes the new root whatever the rank of zp and zn . Whereas S ← sort pixels increasing
without balancing the root of any point p in zpar matches the j =N −1
root of p in parent, this is not the case anymore. For every for all p ∈ S backward do
connected components we have to keep a connection between parent(p) ← p; zpar(p) ← p . make-set
the root of the component in zpar and the root of max-tree zp = p
for all n ∈ Np s.t. parent(n) 6= −1 do
in parent. Thus, we introduce an new image repr that keeps zn ← FIND - ROOT(zpar, n)
this connection updated. if zp 6= zn then
if f (zp ) = f (zn ) then SWAP(zp , zn )
zpar(zn ) ← zp . merge-set
zpar repr parent zpar repr parent
A B C A B C A B C A B C A B C A B C
parent(zn ) ← zp
B B B A E C B E B B B B A E C B E B S[j] ← zn ; j ← j − 1
D E F D E F D E F D E F D E F D E F
B E E B E E
G H I G H I G H I G H I G H I G H I
S[0] ← parent[S[0]]
H H H G H I H H H H B H G H I H E H C ANONICALIZE(parent, S)
zpar repr[z p ] repr[zn ] parent zp p return (parent, S)
zp zn p r B E
B n H E H zpar(zn ) ← z p parent(r) ← p
p C A E H zn B H r Fig. 6. Union-find with level compression.
C A E G I B G I
G I C A G I
C A zpar parent
find-root technique tends to create a degenerated tree in flat zones. Level
compression avoids this behavior by a special handling of flat
(a) (b) zones. In Fig. 6, p is the point in process at level λ = f (p), n
Fig. 5. Union-by-rank. (a) State of the algorithm before processing the a neighbor of p already processed, zp the root of Ppλ (at first
neighbor H from E. (b) State of the algorithm after processing. zp = p), zn the root of Pnλ . We suppose f (zp ) = f (zn ), thus
zp and zn belong to the same node and we can choose any of
The union-by-rank technique and structure update are il- them as a canonical element. Normally p should become the
lustrated in Fig. 5. The algorithm has been running until root with child zn but level compression inverts the relation,
processing E at level 12, the first neighbor B has already zn is kept as the root and zp becomes a child. Since parent
been treated and neighbors D and F are skipped because not may be inverted, S array is not valid anymore. Hence S is
yet processed. Thus, the algorithm is going to process the last reconstructed, as soon as a point p gets attached to a root node,
neighbor H. zp is the root of p in zpar and we retrieve the root p will not be processed anymore so it is inserted in back of S.
zn of n with find-root procedure. Using repr mapping, At the end S only misses the tree root which is parent[S[0]].
we look up the corresponding point r of zn in parent. The
tree rooted in r is then merged to the tree rooted in p (parent
merge). Back in zpar, the components rooted in zp and zn B. Flooding algorithms
merge. Since they have the same rank, we choose arbitrary zp A second class of algorithms, based on flooding, contrasts
to be the new root. with the immersion-based algorithms described in the previous
The algorithm in Fig. 4 is slightly different from the section III-A. Salembier et al. [3] proposed the first efficient
one of [15]. They use two union-find structures, one to algorithm to compute the max-tree. A propagation starts from
build the tree, the other to handle flat zones. In their paper, the root that is the pixel at lowest level lmin . Pixels in the
lowernode[zp ] is an array that maps the root of a com- propagation front are stored in a hierarchical queue composed
ponent zp in zpar to a point of current level component in by as many FIFO queues as the number of levels. It allows to
parent (just like repr(zp ) in our algorithm). Thus, they apply access directly any pixel in the FIFO queue at a given level.
a second union-find to retrieve the canonical element. This Fig. 7 shows a slightly modified version of Salembier’s original
extra union-find can be avoided because lowernode[x] is algorithm where the original STATUS image is replaced by
already a canonical element, thus f indoot on lowernode(zp ) the parent image having the same role. The flood(λ, r)
is useless and so does parent balancing on flat zones. procedure is in charge of flooding the peak component Prλ
3) Canonicalization: Both algorithms call the C ANONICAL - and building the corresponding sub max-tree rooted in r. It
IZE procedure to ensure that any node’s parent is a canonical proceeds as follows: first pixels at level λ are retrieved from
node. In Fig. 3, canonical property is propagated downward. S the queue, their parent pointer is set to the canonical element r
is traversed in direct order such that when processing a pixel and their neighbors n are analyzed. If n is not in the queue and
p, its parent q has the canonical property that is parent(q) is has not yet been processed, then n is pushed in the queue for
a canonical element. Hence, if q and parent(q) belongs to the further processing and n is marked as processed (parent(n)
same node i.e f (q) = f (parent(q)), the parent of p is set to is set to INQUEUE which is any value different from -1). If
the component’s canonical element: parent(q). the level l of n is higher than λ then n is in the childhood
4) Level compression: Union-by-rank provides time com- of the current node, thus flooding is halted at the current level
plexity guaranties at the price of an extra memory requirement. and a recursive call to flood initiates the process for the
When dealing with huge images, it results in a significant peak component Pnl rooted in n. During the recursive flooding,
drawback (e.g. RAM overflow. . . ). Since the last point pro- some points can be pushed in the queue between level λ and l.
cessed always becomes the root, union-find without rank Hence, when flood ends, it returns the level l0 of n’s parent.
IEEE TRANSACTIONS ON IMAGE PROCESSING 5

function FLOOD(λ, r) 1: procedure P ROCESS S TACK(r, q)


while hqueue[λ] not empty do 2: λ ← f (q)
p ← POP(hqueue[λ]) 3: POP (levroot)
parent(p) ← r 4: while levroot not empty and λ < f (TOP(levroot)) do
if p 6= r then INSERT FRONT(S, p) 5: INSERT FRONT (S, r)
for all n ∈ N (p) s.t. parent(p) = −1 do 6: r ← parent(r) ← POP(levroot))
l ← f (n) 7: if levroot empty or f (TOP(levroot)) 6= λ then PUSH(levroot, q)
if levroot[l] = −1 then levroot[l] ← n 8: parent(r) ← TOP(levroot)
PUSH (hqueue[l], n) 9: INSERT FRONT (S, r)
parent(n) ← INQUEUE
while l > λ do 10: function M AX - TREE(f )
l ← f lood(l, levroot[l]) 11: for all p do parent(p) ← −1
. Attach to parent 12: pstart ← any point in Ω
levroot[λ] ← −1 13: PUSH (pqueue, pstart ); PUSH (levroot, pstart )
lpar ← λ − 1 14: parent(pstart ) ← INQUEUE
while lpar ≥ 0 and levroot[lpar] = −1 do 15: loop
lpar ← lpar − 1 16: p ← TOP(pqueue); r ← TOP(levroot)
if lpar 6= −1 then 17: for all n ∈ N (p) such that parent(p) = −1 do
parent(r) ← levroot[lpar] 18: PUSH (pqueue, n)
INSERT FRONT(S, r) 19: parent(n) ← INQUEUE
return lpar 20: if f (p) < f (n) then
21: PUSH (levroot, n)
22: goto 16
function M AX - TREE(f)
for all h do levroot[h] ← −1 23: { p is done }
24: POP (pqueue)
for all p do parent(p) ← −1 25: parent(p) ← r
lmin ← minp f (p) 26: if p 6= r then INSERT FRONT(S, p)
pmin ← arg minp f (p) 27: while pqueue not empty do;
PUSH (hqueue[lmin ], pmin )
28: { all points at current level done ? }
levroot[lmin] ← pmin 29: q ← TOP(pqueue)
FLOOD (lmin , pmin )
30: if f (q) 6= f (r) then . Attach r to its parent
31: P ROCESS S TACK(r, q)
Fig. 7. Salembier et al. [3] max-tree algorithm. 32: repeat
33: root ← POP(levroot)
34: INSERT FRONT(S, root)

Fig. 8. Non-recursive max-tree algorithm [26, 20].

If l0 > λ, we need to flood levels l0 until l0 ≤ λ i.e. until heap based on hierarchical queues while in [20] they are
there are no more points in the queue above λ. Once all pixels implemented using a standard heap (based on comparisons).
at level λ have been processed, we need to retrieve the level The algorithm given in Fig. 8 is a code transcription of the
lpar of the parent component and attach r to its canonical method described in [26]. The array levroot in the recursive
element. A levroot array stores canonical element of each version is replaced by a stack with the same purpose: storing
level component and -1 if the component is empty. Thus we the canonical element of level components. The hierarchical
just have to traverse levroot looking for lpar = max{h < queue hqueue is replaced by a priority queue pqueue that
λ, levroot[h] 6= −1} and set the parent of r to levroot[lpar]. stores the propagation front. The algorithm starts with some
Since the construction of parent is bottom-up, we can safely initialization and choose a random point pstart as the flooding
insert p in front of the S array each time parent(p) is set. For point. pstart is enqueued and pushed on levroot as a canonical
a level component, the canonical element is the last element element. During the flooding, the algorithm picks the point p
inserted ensuring a correct ordering of S. Note that the pass at highest level (with the highest priority) in the queue, and
which gets the minimum level of the image is not necessary. the canonical element r of its component which is the top
Instead, we could have called flood in Max-tree procedure of levroot (p is not removed from the queue). Like in the
until the parent level returned by the function was -1, i.e the recursive version, we look for neighbors n of p and enqueue
last flood call was processing the root. Anyway, this pass has those that have not yet been seen. If f (n) > f (p), n is pushed
other advantages for optimization that will be discussed in the on the stack and we immediately flood n (a goto that mimics
implementation details section. the recursive call). On the other hand, if all neighbors are in
Salembier et al. [3]’s algorithm was rewritten in a non- the queue or already processed then p is done, it is removed
recursive implementation in [27] and later by [26] and [20]. from the queue, parent(p) is set its the canonical element r
These algorithms differ in only two points. First, [20] uses and if r 6= p, p is added to S (we have to ensure that the
a pass to retrieve the root before flooding to mimics the canonical element will be inserted last). Once p removed from
original recursive version while [26] does not. Second, priority the queue, we have to check if the level component has been
queues in [26] use an unacknowledged implementation of fully processed in order to attach the canonical element r to its
6 IEEE TRANSACTIONS ON IMAGE PROCESSING

parent. If the next pixel q has a different level than p, we call Thread 1 Thread 2
the procedure ProcessStack that pops the stack, sets parent T1 ← M (f|D1 ) T3 ← M (f|D3 )
Thread 1
relationship between canonical elements and inserts them in S D1 T2 ← M (f|D2 ) T4 ← M (f|D4 )
until the top component has a level no greater than f (q). If the D2 Thread 2
T12 ← T1 ⊕ T2
Wait thread 2
T34 ← T3 ⊕ T4
Wait thread 3
stack top’s level matches q’s level, q extends the component TΩ ← T12 ⊕ T345 T345 ← T34 ⊕ T5
D3 D1 D2 D3
so that no more processing is needed. On the other hand, if D4 Thread 3
Thread 3
the stack gets empty or the top level is lesser than f (q), then D5 D4 D5 T5 ← M (f|D5 )
q is pushed on the stack as the canonical element of a new (a) (b) (c)
component. The algorithm ends when all points in queue have
been processed, then S only misses the root of the tree which Fig. 9. Map-reduce idiom for max-tree computation. (a) Sub-domains of f .
is the single element that remains on the stack. (b) A possible distribution of jobs by threads. (c) Map-reduce operations. M
is the map operator, ⊕ the merge operator.

procedure CONNECT(p,q)
C. Merge-based algorithms and parallelism x ← FINDREPR(parent, p)
Whereas the algorithms of the two first classes (Sec- y ← FINDREPR(parent, q)
if f (x) < f (y) then SWAP(x, y)
tions III-A and III-B) are sequential, this section is dedicated
while x 6= y do . common ancestor found ?
to parallel algorithms. Merge-based algorithms consist in com- parent(x) ← FINDREPR(parent, parent(x));
puting max-trees on sub-parts of images and merging back z ← parent(x)
trees to get the max-tree of the whole image [21, 17, 22]. if x = z then parent(x) ← y ; y ← x
Those algorithms are typically well-suited for parallelism since else if f (z) ≥ f (y) then x ← z
they adopt a map-reduce idiom. Computation of sub max- else parent(x) ← y ; x ← y ; y ← z
trees (map step), done by any sequential method and merge
function FINDREPR(par, p)
(reduce-step) are executed in parallel by several threads. In if f (p) 6= f (par(p)) then return p
order to improve cache coherence, images should be split in
par(p) ← FINDREPR(par, par(p))
contiguous memory blocks that is, splitting along the first return par(p)
dimension if images are row-major. Fig. 9 shows an example
of parallel processing using a map-reduce idiom. The domain procedure MERGETREE(Di , Dj )
has been split into five sub-domains {D1 , D2 , . . . , D5 }, we for all (p, q) ∈ Di × Dj such that q ∈ N (p) do
thus have 5 map operations which run a sequential algorithm CONNECT (p,q)

and 4 joins that merge the sub-trees. Figs. 9b and 9c show


a possible distribution of the tasks on 3 threads. Note that Fig. 10. Tree merge algorithm.
map-steps and reduce-steps may occur in parallel, but a single
thread may also be in charge of several sub-tree construction. be attached to y that is the lowest node having a level greater
For instance, the first thread is in charge of computing the than f (y). Once found, x gets attached to y, and we now have
sub-trees T1 and T2 for D1 and D2 , merging them into a to connect y to x’s old parent. Function findrepr(p) is
tree T12 and then merging it with the tree computed by the used to get the canonical element of p’s component whenever
second thread. Choosing the right number of splits and jobs the algorithm needs it.
distribution between threads is a difficult topic that depends on Once sub-trees have been computed and merged into a
the architecture (number of threads available, power frequency single tree, it does not hold canonical property (because non-
of each core). If the domain is not split enough (a number of canonical elements are not updated during merge). Also, the
chunks no greater than the number of threads) the parallelism reduction step does not merge the S arrays corresponding to
is not maximal, some threads become idle once they have sub-trees (it would imply reordering S which is more costly
done their jobs, or wait for other thread to merge. On the than just recomputing it at the end). Fig. 11 shows an algorithm
other hand, if the number of split gets too large, merging and that canonicalizes and reconstructs S array from parent image.
thread synchronization cause significant overheads. Since work It uses an auxiliary image dejavu to track nodes that have
balancing and thread management are outside the current topic, already been inserted in S. As opposed to other max-tree
they are delegated to high level parallelism libraries such as algorithms, construction of S and processing of nodes are top-
Intel Threading Building Blocks (TBB). down. For any points p, we traverse in a recursive way its
The procedure in charge of merging sub-trees Ti and Tj path to the root to process its ancestors. When the recursive
of two adjacent domains Di and Dj is given in Fig. 10. For call returns, parent(p) is already inserted in S and holds the
two neighbors p and q in the junction of Di , Dj , it connects canonical property, thus we can safely insert back p in S and
components of p’s branch in Ti to components of q’s branch canonicalize p as in Fig. 3.
in Tj until a common ancestor is found. Let x and y be the
canonical elements of the components to merge with f (x) ≥ D. Implementation details
f (y) (x is in the childhood to y) and z be the canonical element Algorithms have been implemented in pure C++ using STL
of the parent component of x. If x is the root of the sub-tree implementation of some basic data structures (heaps, priority
then it gets attached to y and the procedure ends. Otherwise, queues), M ILENA image processing library to provide funda-
we traverse up the branch of x to find the component that will mental image types and I/O functionality, and Intel TBB [28]
IEEE TRANSACTIONS ON IMAGE PROCESSING 7

procedure C ANONICALIZE R EC(p)


dejavu(p) = true 2) Flooding algorithms: They require a priority queue to
q ← parent(p) retrieve the highest point in the propagation front. Each point
if not dejavu(q) then . Process parent before p is inserted and removed once, thus the complexity is Θ(np)
C ANONICALIZE R EC(q) where p is the cost of pushing or popping from the heap. If the
if f (q) = f (parent(q)) then . Canonicalize priority queue is encoded with a hierarchical queue as in [3,
parent(p) ← parent(q) 26], it uses n + 2k memory space, provides constant insertion
I NSERT BACK(S, p) and constant access to the maximum but popping is O(k). In
practice, in images with small integers, gray level difference
procedure P OST- PROCESS(parent, f)
for all p do dejavu(p) ← F alse
between neighboring pixels is far to be as large as k. With
high dynamic image, a heap can be implemented with a y-fast
for all p ∈ Ω such that not dejavu(p) do
C ANONICALIZE R EC(p) trie [29], which has insertion and deletion in O(log log k) and
return (parent, S) access to maximum element in O(1). For any other data type, a
“standard” heap based on comparisons requires n extra space,
Fig. 11. Canonicalization and S computation algorithm.
allows insertion and deletion in O(log n) and has a constant
access to its maximal element. Those algorithms need an array
or a stack of respective size k and n. Salembier’s algorithm
for parallelism. Specific implementation optimizations are
uses the system stack for a recursion of maximum depth k,
listed below:
hence O(k) extra-space.
Sort optimization. A counting sort is used when quantization 3) Merge-based algorithms: The complexity depends on
is lower than 18 bits. For large integer of q bits, it switches to A(k, n), the complexity of the underlying method used to
216 -based radix sort requiring q/16 counting sorts. compute the max-trees of sub-domains. Let s = 2h the number
Pre-allocation. Queues and stacks are pre-allocated to of sub-domains. The map-reduce algorithms require s mapping
avoid dynamic memory reallocation. Hierarchical queues are operations and s − 1 merges. A good map-reduce algorithm
also pre-allocated by computing image histogram as a pre- would split the domain to form a full and complete tree so
processing. we assume all leaves to be at level h. Merging sub-trees
Priority-queues. An heap is implemented with hierarchical of size n/2 has been analyzed in [17] and is O(k log n)
queues when quantization is less than 18 bits. For large integer (we merge nodes of every k levels using union-find without
it switches to the STL standard heap implementation. A “y-fast union-by-rank). Thus, the complexity of a single reduction
trie” data structure [29] can be used for large integer ensuring a √
is O(W k log n). Assuming s constant and H = W = n
better complexity (see Section IV-A) but no performance gain the complexity as a function of√n and k of the map-reduce
has been obtained. algorithm is O(A(k, n)) + O(k n log n). When there is as
Map-reduce. In the parallel version of the algorithms, all many splits as rows, s is now dependent on n. This leads
instructions that deal about S construction and canonicalization to Matas et al. [22] algorithm whose complexity is O(n) +
have been removed since S is reconstructed from scratch and √
O(k n(log n)2 ). Contrary to what they claim, when values are
parent canonicalized by the procedure in Fig. 11 small integers the complexity stays linear and is not dominated
by merging operations. Finally, canonicalization and S recon-
struction have a linear time complexity (CanonicalizeRec
IV. A LGORITHMS COMPARISON is called only once for each point) and only use an image of
A. Complexity analysis n elements to track points already processed. The complexity
analysis for each algorithm as well as the memory required by
Let n = H ∗ W with H the image height, W the image any auxiliary data structure (including preallocated stacks and
width and n the total number of pixels. Let k be the number queues) is summerized in Table I.
of values in V .
1) Immersion algorithms: They require sorting pixels, a
process of Θ(n + k) complexity (k  n) for small integers B. Experiments
(counting sort), O(n log log n) for large integers (hybrid radix Benchmarks were performed on an Intel Core i7 (4 physical
sort), and O(n log n) for generic data types with a more cores, 8 logical cores). The programs were compiled with gcc
complicated ordering relation (comparison sort). Union-find is 4.7, optimization flags on (-O3 -march=native). Tests
O(n log n) and O(nα(n)) when used with union-by-rank 1 . were conducted on a dataset of 8-bit images that were re-sized
Canonicalization is linear and does not use extra memory. by cropping or tiling the original image. Over-quantization
Memory-wise, sorting may require an auxiliary buffer depend- was performed by shifting the eight bits left and generating
ing on the algorithm and histograms for integer sorts thus missing lower bits at random. Fig. 12 depicts performance of
Θ(n + k) extra-space. Union without rank requires a zpar the sequential algorithms w.r.t to the size and the quantization.
image for path compression (Θ(n)) and the system stack for As a first remark, we notice that all algorithms are linear in
recursive calls in findroot which is O(n) (findroot practice. On natural images, the n log n upper bound complex-
could be non-recursive, but memory space is saved at cost ity of the [20] and [12] algorithms is not reached. Algorithms
of a higher computational time). Union-by-rank requires two from [12] and [15] have quite the same running time (±6%
extra images (rank and repr) of n pixels each. on average), however the performance of [15] algorithm drops
8 IEEE TRANSACTIONS ON IMAGE PROCESSING

TABLE I. C OMPLEXITY AND SPACE REQUIREMENTS OF MANY MAX - TREE ALGORITHMS . n IS THE NUMBER OF PIXELS AND k THE NUMBER OF GRAY
LEVELS .

Time complexity Auxiliary space requirement


Algorithm Small int Large int Generic V Small int Large int Generic V
Berger [12] O(n log n) O(n log n) O(n log n) n + k + O(n) 2n + O(n) n + O(n)
Berger + rank O(n α(n)) O(n log log n) O(n log n) 3n + k + O(n) 4n + O(n) 3n + O(n)
Najman and Couprie [15] O(n α(n)) O(n log log n) O(n log n) 5n + k + O(n) 6n + O(n) 5n + O(n)
2
Salembier et al. [3] O(nk) O(nk) ' O(n ) N/A 3k + n + O(n) 2k + n + O(n) N/A
2
Nistér and Stewénius [26] O(nk) O(nk) ' O(n ) N/A 2k + 2n 2k + 2n N/A
Wilkinson [20] O(n log n) O(n log n) O(n log n) 3n 3n 3n
Salembier non-recursive O(nk) O(n log log n) O(n
√ log n) 2k + 2n 3n 3n
Map-reduce O(A(k, n)) O(A(k, n)) + O(k n log n) ... + n ... + n ... + n

Matas et al. [22] O(n) O(n) + O(k n(log n)2 ) k+n 2n 2n

Wilkinson [20] Matas et al. [22]


409600 700
Salembier et al. [3] Berger + rank
204800 Berger + level compression Berger + level compression
Berger et al. [12] Salembier-based [17]
102400 600
Najman and Couprie [15] Salembier unrecursive
51200 Berger + rank
25600 Nistér and Stewénius [26]
500
12800
Time (ms)

Time (ms)
6400
3200 400

1600
800 300
400
200
200
100
50
1 2 4 8 16 32 64 128 256 100
2 4 6 8 10 12 14 16
Number of pixels ( ×106 ) Number of threads

(a) (a)
3500 4.0

3000 3.5

2500 3.0

2000 2.5
Time (ms)

Speed Up

1500 2.0

Wilkinson [20]
Salembier et al. [3]
1000 1.5
Berger + level compression Matas et al. [22]
Berger et al. [12] Berger + rank
500 Najman and Couprie [15] 1.0 Berger + level compression
Berger + rank Salembier-based [17]
Nistér and Stewénius [26] Salembier unrecursive
0 0.5
8 10 12 14 16 18 20 22 24 26 28 30 32 2 4 6 8 10 12 14 16
Number of bits Number of threads

(b) (b)
Fig. 12. (a) Comparison of the algorithms on 8-bit images as a function
of the size; (b) Comparison of the algorithms on 8 Mega-pixels images as a 2500
Matas et al. [22]

function of the quantization. Berger + rank


Berger + level compression
2000 Salembier-based [17]
Salembier unrecursive

significantly at 256 Mega-pixels. Indeed, at that size each aux- 1500


Time (ms)

iliary array/image requires 1 GB memory space, thus [15] who 1000


use a lot of memory exceed the 6 GB RAM limit and need to
swap. Our implementation of union-by-rank uses less memory 500

and is on average 42% faster than [15]. Level compression is an


efficient optimization that provides 35% speedup on average 0
8 10 12 14 16 18

on [12]. However, this optimization is only reliable on low Number of bits

(c)
quantized data. Fig. 12b shows that it is relevant up to 18 bits. Fig. 13. (a,b) Comparison of the parallel algorithms on a 6.8 Mega-pixels 8-
It operates on flat-zones but when quantization gets higher, flat- bits image as a function of number of threads. (a) Wall clock time; (b) speedup
zones are less probable and the tests add worthless overheads w.r.t the sequential version; (c) Comparison of the parallel algorithms using
(see Fig. 14). Union-find is not affected by the quantization 8 threads on a 6.8 Mega-pixels image as a function of the quantization.
but sorting does, counting sort and radix sort complexities are
respectively linear and logarithmic with the number of bits. of hierarchical queues w.r.t the number of bits is evident on
The break in union-find curves between 18 and 20 bits stands Fig. 12b. By using a standard heap instead of hierarchical
for the switch from counting to radix sort. Flooding-based queues, [20] does scale well with the number of bits and
algorithms using hierarchical queues outperform our union- outperforms every algorithms except our implementation of
find by rank on low quantized image by 41% on average. As union-by-rank. In [20], the algorithm is supposed to match
expected, [3] and [26] (which is the exact non-recursive version [3]’s method for low quantized images, but in our experiments
of the former) closely match. However, the exponential cost it remains 4 times slower. Since [15]’s algorithm is always
IEEE TRANSACTIONS ON IMAGE PROCESSING 9

Embedded system ? that outranks all the others in every case and we pro-
(memory limitation) yes Salembier et al. [3] or vided a decision tree to choose the appropriate algorithm
Nistér and Stewénius [26] w.r.t. to data and hardware. We proposed a max-tree al-
no Low (± parallelism)
quantization ? gorithm using union-by-rank that outperforms the existing
Berger + rank one from [15]. Furthermore, we proposed a second one that
no
uses a new technique, level compression, for systems with
yes Berger + level compression strict memory constraints. Extra-materials including the im-
yes (± parallelism) age dataset used for this comparison, and a “reproducible
Low
research” code, intensively tested, is available on the Internet
quantization ? Berger et al. [12] or at http://www.lrde.epita.fr/Olena/MaxtreeReview.
no Wilkison [20] Actually the union-find algorithm is a versatile tool used
in many algorithms. A recent publication [30] shows that the
Fig. 16. Decision tree to choose the appropriate max-tree algorithm. morphological tree of shapes, which is a self-dual represen-
tation of the image contents, can also be computed using
outperformed by our implementation of union-find by rank, union-find. In [31], a specific binary tree, corresponding to an
it will not be tested any further. Furthermore, because of the ordered version of the edges of the minimum spanning tree, is
strong similarities of [26] and [20], they are merged in our computed thanks to a Kruskal-like algorithm and involves the
single implementation (called Non-recursive Salembier below) union-find algorithm. Thus, the results presented in this paper
that will use hierarchical queues when quantization is below 18 also apply to obtain those trees in the most efficient way.
bits and switches to a standard heap implementation otherwise.
Finally, the algorithm Berger + level compression will enable
level compression only when the number of bits is below 18. R EFERENCES
Fig. 13 shows the results of the map-reduce idiom applied [1] L. Vincent, “Grayscale area openings and closings, their
on many algorithms and their parallel versions. As a first result, efficient implementation and applications,” in Proc. of
we can see that better performance is generally achieved with EURASIP Workshop on Mathematical Morphology and
8 threads that is when the number of threads matches the its Applications to Signal Processing, 1993, pp. 22–27.
number of (logical) cores. However, since there are actually [2] P. Salembier and J. Serra, “Flat zones filtering, connected
only 4 physical cores, we can expect a ×4 maximum speedup. operators, and filters by reconstruction,” IEEE Trans. on
Some algorithms benefit more from map-reduce than others. Image Processing, vol. 4, no. 8, pp. 1153–1160, 1995.
Union-find-based algorithms are particularly well-suited for [3] P. Salembier, A. Oliveras, and L. Garrido, “Antiextensive
parallelism. Union-find with level compression achieves the connected operators for image and sequence processing,”
best speedup, 3.6 times faster that the sequential version while IEEE Transactions on Image Processing, vol. 7, no. 4,
the union-find by rank, second, performs a ×3.1 speedup. pp. 555–570, 1998.
More surprising, the map-reduce pattern achieves significant [4] R. Jones, “Connected filtering and segmentation using
speedup even when a single thread is used (×1.7 and ×1.4 component trees,” Computer Vision and Image Under-
for union-find with level compression and union-find by rank standing, vol. 75, no. 3, pp. 215–228, 1999.
respectively). This result is explained by a better cache coher- [5] J. Hernández and B. Marcotegui, “Shape ultimate at-
ence when working on sub-domains that balances tree merges tribute opening,” Image and Vision Computing, vol. 29,
overheads. On the other hand, flooding algorithms do not scale no. 8, pp. 533–545, 2011.
that well because they are limited by post-processes. Indeed, [6] E.R. Urbach and M.H.F. Wilkinson, “Shape-only granu-
Fig. 15 shows that 76% of the time of parallelized Salembier’s lometries and grey-scale shape filters,” in Mathematical
algorithm is spent in post-preprocessing (that is going to Morphology and Its Applications to Signal and Image
happen as well for union-find algorithms on architectures with Processing (Proceedings of ISMM), 2002, pp. 305–314.
more cores). In [17] and [22], they obtain a speedup almost [7] G.K. Ouzounis and M.H.F. Wilkinson, “Mask-based
linear with the number of threads because only a parent second-generation connectivity and attribute filters,”
image is built. If we remove the canonicalization and the IEEE Transactions on Pattern Analysis and Machine
S construction steps, we also get those speedups. Fig. 13c Intelligence, vol. 29, no. 6, pp. 990–1004, 2007.
shows the exponential complexity of merging trees as number [8] P. Monasse and F. Guichard, “Fast computation of a
of bits increases that makes parallel algorithms unsuitable for contrast-invariant image representation,” IEEE Trans. on
high quantized data. In light of the previous analysis, Fig. 16 Image Processing, vol. 9, no. 5, pp. 860–872, 2000.
provides some guidelines on how to choose the appropriate [9] Y. Xu, T. Géraud, and L. Najman, “Morphological filter-
max-tree algorithm w.r.t. to image types and architectures. ing in shape spaces: Applications using tree-based image
representations,” in Proc. of International Conference on
Pattern Recognition, 2012, pp. 485–488.
V. C ONCLUSION
[10] J. Matas, O. Chum, M. Urban, and T. Pajdla, “Robust
In this paper, we tried to lead a fair comparison of max- wide-baseline stereo from maximally stable extremal
tree algorithms in a unique framework. We highlighted the regions,” Image and Vision Computing, vol. 22, no. 10,
fact that there is no such thing as the “best” algorithm pp. 761–767, 2004.
10 IEEE TRANSACTIONS ON IMAGE PROCESSING

24 bits 35% 11% 10% Sort


Berger +
16 bits 7% 13% 16%
Union by rank Zfindroot
12 bits 6% 17% 15%
8 bits 5%21% 12% Canonicalization

24 bits 23% 32% 5%


Berger + level
16 bits 6% 30% 8%
compression
12 bits 5% 26% 9%
8 bits 4% 27% 9%

24 bits 24% 31% 6%


Najman-
16 bits 5% 43% 6%
Couprie [15]
12 bits 4% 44% 6%
8 bits 3% 46% 5%

24 bits 25% 41% 7%


Berger 16 bits 5% 54% 10%
et al.[12] 12 bits 3% 59% 9%
8 bits 3% 59% 8%
0 500 1000 1500 2000
Wall clock time (ms)

Fig. 14. Time distribution of the sequential union-find-based algorithms.

Number of
threads
serial 82% 12%
1 62% 10% 19%
Berger +
union by rank 2 31% 6% 55%
4 16% 3% 73%
8 17% 3% 73%

serial
1 8% 68% 21%
Matas 2 5% 34% 58%
et al. [22] 4 2% 18% 76%
8 2%19% 76%

serial 88% 9%
1 72% 4% 20%
Berger + level
compression 2 36% 2% 57%
4 18% 1% 75%
8 19% 2% 75%

serial 95%
Union-find (Map-step)
1 64% 5% 26% Flooding (Map-step)
Salembier
non-recursive 2 33% 2% 60% Merging (Reduce-Step)
4 16% 1% 76%
Canonicalization
8 18%2% 76%
0 100 200 300 400 500 600 700 800
Wall clock time (ms)

Fig. 15. Time distribution of the parallel versions of the algorithms.

[11] M.A. Westenberg, J.B.T.M. Roerdink, and M.H.F. actions on Pattern Analysis and Machine Intelligence,
Wilkinson, “Volumetric attribute filtering and interactive vol. 30, no. 10, pp. 1800–1813, 2008.
visualization using the max-tree representation,” IEEE [18] A.V. Aho, J.D. Ullman, and J.E. Hopcroft, Data Struc-
Transactions on Image Processing, vol. 16, no. 12, pp. tures and Algorithms. Addison Wesley, 1983.
2943–2952, 2007. [19] R.E. Tarjan, “Efficiency of a good but not linear set union
[12] C. Berger, T. Géraud, R. Levillain, N. Widynski, A. Bail- algorithm,” Journal of the ACM, vol. 22, no. 2, pp. 215–
lard, and E. Bertin, “Effective component tree computa- 225, 1975.
tion with application to pattern recognition in astronomi- [20] M.H.F. Wilkinson, “A fast component-tree algorithm for
cal imaging,” in Proc. of IEEE International Conference high dynamic-range images and second generation con-
on Image Processing, vol. 4, 2007, pp. IV–41. nectivity,” in Proc. of IEEE International Conference of
[13] B. Perret, S. Lefèvre, C. Collet, and É. Slezak, “Con- Image Processing, 2011, pp. 1021–1024.
nected component trees for multivariate image processing [21] G.K. Ouzounis and M.H.F. Wilkinson, “A parallel im-
and applications in astronomy,” in Proc. of Intl. Confer- plementation of the dual-input max-tree algorithm for
ence on Pattern Recognition, 2010, pp. 4089–4092. attribute filtering,” in Mathematical Morphology and Its
[14] E. Carlinet and T. Géraud, “A comparison of many max- Applications to Signal and Image Processing (Proceed-
tree computation algorithms,” in Mathematical Morphol- ings of ISMM), vol. 1. ”Instituto Nacional de Pesquisas
ogy and Its Applications to Signal and Image Processing Espaciais (INPE)”, 2007, pp. 449–460.
(Proceedings of ISMM), ser. Lecture Notes on Computer [22] P. Matas, E. Dokladalova, M. Akil, T. Grandpierre, L. Na-
Science, vol. 7883. Springer, 2013, pp. 73–85. jman, M. Poupa, and V. Georgiev, “Parallel algorithm for
[15] L. Najman and M. Couprie, “Building the component concurrent computation of connected component tree,” in
tree in quasi-linear time,” IEEE Transactions on Image Advanced Concepts for Intelligent Vision Systems, 2008,
Processing, vol. 15, no. 11, pp. 3531–3539, 2006. pp. 230–241.
[16] M.H.F. Wilkinson and M.A. Westenberg, “Shape preserv- [23] D. Menotti, L. Najman, and A. de Albuquerque Araújo,
ing filament enhancement filtering,” in Proc. of Medical “1D component tree in linear time and space and its
Image Computing and Computer-Assisted Intervention, application to gray-level image multithresholding,” in
2001, pp. 770–777. Mathematical Morphology and Its Apps. to Signal and
[17] M.H.F. Wilkinson, H. Gao, W.H. Hesselink, J.E. Jonker, Image Processing (Proc. of ISMM), 2007, pp. 437–448.
and A. Meijster, “Concurrent computation of attribute [24] V. Morard, P. Dokládal, and E. Decenciere, “One-
filters on shared memory parallel machines,” IEEE Trans- dimensional openings, granulometries and component
IEEE TRANSACTIONS ON IMAGE PROCESSING 11

trees in O(1) per pixel,” IEEE Journal of Selected Topics


in Signal Processing, vol. 6, pp. 840–848, 2012.
[25] A. Andersson, T. Hagerup, S. Nilsson, and R. Raman,
“Sorting in linear time?” in Proc. of the Annual ACM
symposium on Theory of computing, 1995, pp. 427–436.
[26] D. Nistér and H. Stewénius, “Linear time maximally sta-
ble extremal regions,” in Proc. of European Conference
on Computer Vision, 2008, pp. 183–196.
[27] W.H. Hesselink, “Salembier’s min-tree algorithm turned
into breadth first search,” Information Processing Letters,
vol. 88, no. 5, pp. 225–229, 2003.
[28] J. Reinders, Intel Threading Building Blocks: outfitting
C++ for multi-core processor parallelism. O’Reilly
Media, 2007.
[29] D. E. Willard, “Log-logarithmic worst-case range queries
are possible in space θ(N ),” Information Processing
Letters, vol. 17, no. 2, pp. 81–84, 1983.
[30] T. Géraud, E. Carlinet, S. Crozet, L. Najman et al., “A
quasi-linear algorithm to compute the tree of shapes of
nD images,” in Mathematical Morphology and Its Ap-
plications to Signal and Image Processing (Proceedings
of ISMM), ser. Lecture Notes on Computer Science, vol.
7883. Springer, 2013, pp. 98–110.
[31] L. Najman, J. Cousty, and B. Perret, “Playing with
Kruskal: Algorithms for morphological trees in edge-
weighted graphs,” in Mathematical Morphology and Its
Applications to Signal and Image Processing (Proceed-
ings of ISMM), ser. Lecture Notes on Computer Science,
vol. 7883. Springer, 2013, pp. 135–146.
Edwin Carlinet received the Ing. degree from
EPITA, Paris, France, in 2011, and a M.Sc. in applied
mathematics for computer vision and machine learn-
ing from the École Normale Supérieure Cachan, in
2012. He is currently a Ph.D. candidate with EPITA
and Université Paris-Est. His research interests in-
clude bio-informatics mathematical morphology, and
statistical learning

Thierry Géraud received a Ph.D. degree in signal


and image processing from Télécom ParisTech in
1997, and the Habilitation à Diriger les Recherches
from Université Paris-Est in 2012. He is one of
the main authors of the Olena platform, dedicated
to image processing and available as free software
under the GPL licence. His research interests include
image processing, pattern recognition, software en-
gineering, and object-oriented scientific computing.
He is currently working at EPITA Research and
Development Laboratory (LRDE), Paris, France.

You might also like