<s>
Connected-component	B-General_Concept
labeling	I-General_Concept
(	O
CCL	O
)	O
,	O
connected-component	B-General_Concept
analysis	I-General_Concept
(	O
CCA	O
)	O
,	O
blob	B-General_Concept
extraction	I-General_Concept
,	O
region	B-General_Concept
labeling	I-General_Concept
,	O
blob	B-General_Concept
discovery	I-General_Concept
,	O
or	O
region	O
extraction	O
is	O
an	O
algorithmic	O
application	O
of	O
graph	O
theory	O
,	O
where	O
subsets	O
of	O
connected	O
components	O
are	O
uniquely	O
labeled	O
based	O
on	O
a	O
given	O
heuristic	B-Algorithm
.	O
</s>
<s>
Connected-component	B-General_Concept
labeling	I-General_Concept
is	O
not	O
to	O
be	O
confused	O
with	O
segmentation	B-Algorithm
.	O
</s>
<s>
Connected-component	B-General_Concept
labeling	I-General_Concept
is	O
used	O
in	O
computer	B-Application
vision	I-Application
to	O
detect	O
connected	O
regions	O
in	O
binary	B-Algorithm
digital	B-Algorithm
images	I-Algorithm
,	O
although	O
color	B-Algorithm
images	I-Algorithm
and	O
data	O
with	O
higher	O
dimensionality	O
can	O
also	O
be	O
processed	O
.	O
</s>
<s>
When	O
integrated	O
into	O
an	O
image	O
recognition	O
system	O
or	O
human-computer	O
interaction	O
interface	O
,	O
connected	B-General_Concept
component	I-General_Concept
labeling	I-General_Concept
can	O
operate	O
on	O
a	O
variety	O
of	O
information	O
.	O
</s>
<s>
Blob	B-General_Concept
extraction	I-General_Concept
is	O
generally	O
performed	O
on	O
the	O
resulting	O
binary	B-Algorithm
image	I-Algorithm
from	O
a	O
thresholding	O
step	O
,	O
but	O
it	O
can	O
be	O
applicable	O
to	O
gray-scale	O
and	O
color	B-Algorithm
images	I-Algorithm
as	O
well	O
.	O
</s>
<s>
Blob	B-General_Concept
extraction	I-General_Concept
is	O
related	O
to	O
but	O
distinct	O
from	O
blob	B-Algorithm
detection	I-Algorithm
.	O
</s>
<s>
The	O
vertices	O
contain	O
information	O
required	O
by	O
the	O
comparison	O
heuristic	B-Algorithm
,	O
while	O
the	O
edges	O
indicate	O
connected	O
'	O
neighbors	O
 '	O
.	O
</s>
<s>
Connectivity	O
is	O
determined	O
by	O
the	O
medium	O
;	O
image	O
graphs	O
,	O
for	O
example	O
,	O
can	O
be	O
4-connected	B-Algorithm
neighborhood	I-Algorithm
or	O
8-connected	B-Algorithm
neighborhood	I-Algorithm
.	O
</s>
<s>
define	O
connected	O
components	O
labeling	O
as	O
the	O
“[c]reation	O
of	O
a	O
labeled	O
image	O
in	O
which	O
the	O
positions	O
associated	O
with	O
the	O
same	O
connected	O
component	O
of	O
the	O
binary	B-Algorithm
input	O
image	O
have	O
a	O
unique	O
label.	O
”	O
Shapiro	O
et	O
al	O
.	O
</s>
<s>
:	O
“	O
Connected	B-General_Concept
component	I-General_Concept
analysis	I-General_Concept
consists	O
of	O
connected	B-General_Concept
component	I-General_Concept
labeling	I-General_Concept
of	O
the	O
black	O
pixels	O
followed	O
by	O
property	O
measurement	O
of	O
the	O
component	O
regions	O
and	O
decision	O
making.	O
”	O
The	O
definition	O
for	O
connected-component	B-General_Concept
analysis	I-General_Concept
presented	O
here	O
is	O
more	O
general	O
,	O
taking	O
the	O
thoughts	O
expressed	O
in	O
into	O
account	O
.	O
</s>
<s>
This	O
algorithm	O
is	O
part	O
of	O
Vincent	O
and	O
Soille	O
's	O
watershed	B-Algorithm
segmentation	I-Algorithm
algorithm	I-Algorithm
,	O
other	O
implementations	O
also	O
exist	O
.	O
</s>
<s>
In	O
order	O
to	O
do	O
that	O
a	O
linked	B-Data_Structure
list	I-Data_Structure
is	O
formed	O
that	O
will	O
keep	O
the	O
indexes	O
of	O
the	O
pixels	O
that	O
are	O
connected	O
to	O
each	O
other	O
,	O
steps	O
(	O
2	O
)	O
and	O
(	O
3	O
)	O
below	O
.	O
</s>
<s>
The	O
method	O
of	O
defining	O
the	O
linked	B-Data_Structure
list	I-Data_Structure
specifies	O
the	O
use	O
of	O
a	O
depth	B-Algorithm
or	O
a	O
breadth	B-Algorithm
first	I-Algorithm
search	I-Algorithm
.	O
</s>
<s>
The	O
simplest	O
kind	O
of	O
a	O
last	B-Application
in	I-Application
first	I-Application
out	I-Application
queue	O
implemented	O
as	O
a	O
singly	O
linked	B-Data_Structure
list	I-Data_Structure
will	O
result	O
in	O
a	O
depth	B-Algorithm
first	I-Algorithm
search	I-Algorithm
strategy	O
.	O
</s>
<s>
It	O
is	O
assumed	O
that	O
the	O
input	O
image	O
is	O
a	O
binary	B-Algorithm
image	I-Algorithm
,	O
with	O
pixels	O
being	O
either	O
background	O
or	O
foreground	O
and	O
that	O
the	O
connected	O
components	O
in	O
the	O
foreground	O
pixels	O
are	O
desired	O
.	O
</s>
<s>
The	O
pseudocode	B-Language
is	O
:	O
</s>
<s>
Relatively	O
simple	O
to	O
implement	O
and	O
understand	O
,	O
the	O
two-pass	O
algorithm	O
,	O
(	O
also	O
known	O
as	O
the	O
Hoshen	B-Algorithm
–	I-Algorithm
Kopelman	I-Algorithm
algorithm	I-Algorithm
)	O
iterates	O
through	O
2-dimensional	O
binary	B-Algorithm
data	O
.	O
</s>
<s>
Connectivity	O
checks	O
are	O
carried	O
out	O
by	O
checking	O
neighbor	O
pixels	O
 '	O
labels	O
(	O
neighbor	O
elements	O
whose	O
labels	O
are	O
not	O
assigned	O
yet	O
are	O
ignored	O
)	O
,	O
or	O
say	O
,	O
the	O
north-east	O
,	O
the	O
north	O
,	O
the	O
north-west	O
and	O
the	O
west	O
of	O
the	O
current	O
pixel	O
(	O
assuming	O
8-connectivity	B-Algorithm
)	O
.	O
</s>
<s>
This	O
algorithm	O
uses	O
the	O
union-find	B-Algorithm
data	I-Algorithm
structure	I-Algorithm
which	O
provides	O
excellent	O
performance	O
for	O
keeping	O
track	O
of	O
equivalence	O
relationships	O
.	O
</s>
<s>
Union-find	B-Algorithm
essentially	O
stores	O
labels	O
which	O
correspond	O
to	O
the	O
same	O
blob	O
in	O
a	O
disjoint-set	B-Algorithm
data	I-Algorithm
structure	I-Algorithm
,	O
making	O
it	O
easy	O
to	O
remember	O
the	O
equivalence	O
of	O
two	O
labels	O
by	O
the	O
use	O
of	O
an	O
interface	O
method	O
E.g.	O
</s>
<s>
The	O
array	O
from	O
which	O
connected	O
regions	O
are	O
to	O
be	O
extracted	O
is	O
given	O
below	O
(	O
8-connectivity	B-Algorithm
based	O
)	O
.	O
</s>
<s>
We	O
first	O
assign	O
different	O
binary	B-Algorithm
values	O
to	O
elements	O
in	O
the	O
graph	O
.	O
</s>
<s>
The	O
pseudocode	B-Language
is	O
:	O
</s>
<s>
The	O
find	O
and	O
union	O
algorithms	O
are	O
implemented	O
as	O
described	O
in	O
union	B-Algorithm
find	I-Algorithm
.	O
</s>
<s>
For	O
every	O
pixel	O
check	O
the	O
north	O
and	O
west	O
pixel	O
(	O
when	O
considering	O
4-connectivity	O
)	O
or	O
the	O
northeast	O
,	O
north	O
,	O
northwest	O
,	O
and	O
west	O
pixel	O
for	O
8-connectivity	B-Algorithm
for	O
a	O
given	O
region	O
criterion	O
(	O
i.e.	O
</s>
<s>
intensity	O
value	O
of	O
1	O
in	O
binary	B-Algorithm
image	I-Algorithm
,	O
or	O
similar	O
intensity	O
to	O
connected	O
pixels	O
in	O
gray-scale	O
image	O
)	O
.	O
</s>
<s>
In	O
the	O
early	O
1990s	O
,	O
there	O
was	O
considerable	O
interest	O
in	O
parallelizing	O
connected-component	O
algorithms	O
in	O
image	B-General_Concept
analysis	I-General_Concept
applications	O
,	O
due	O
to	O
the	O
bottleneck	O
of	O
sequentially	O
processing	O
each	O
pixel	O
.	O
</s>
<s>
In	O
the	O
last	O
two	O
decades	O
many	O
novel	O
approaches	O
on	O
connected-component	B-General_Concept
labeling	I-General_Concept
have	O
been	O
proposed	O
and	O
almost	O
none	O
of	O
them	O
was	O
compared	O
on	O
the	O
same	O
data	O
.	O
</s>
<s>
(	O
acronym	O
for	O
Yet	O
Another	O
Connected	O
Components	O
Labeling	O
Benchmark	O
)	O
is	O
an	O
example	O
of	O
C++	B-Language
open	O
source	O
framework	O
which	O
collects	O
,	O
runs	O
,	O
and	O
tests	O
connected-component	B-General_Concept
labeling	I-General_Concept
algorithms	O
.	O
</s>
<s>
The	O
emergence	O
of	O
FPGAs	B-Architecture
with	O
enough	O
capacity	O
to	O
perform	O
complex	O
image	O
processing	O
tasks	O
also	O
led	O
to	O
high-performance	O
architectures	O
for	O
connected-component	B-General_Concept
labeling	I-General_Concept
.	O
</s>
<s>
Most	O
of	O
these	O
architectures	O
utilize	O
the	O
single	O
pass	O
variant	O
of	O
this	O
algorithm	O
,	O
because	O
of	O
the	O
limited	O
memory	O
resources	O
available	O
on	O
an	O
FPGA	B-Architecture
.	O
</s>
<s>
These	O
types	O
of	O
connected	B-General_Concept
component	I-General_Concept
labeling	I-General_Concept
architectures	O
can	O
process	O
several	O
image	O
pixels	O
in	O
parallel	O
,	O
thereby	O
achieving	O
high	O
throughput	O
and	O
low	O
processing	O
latency	O
.	O
</s>
