<s>
In	O
mathematical	B-Algorithm
morphology	I-Algorithm
and	O
digital	B-Algorithm
image	I-Algorithm
processing	I-Algorithm
,	O
top-hat	B-Algorithm
transform	I-Algorithm
is	O
an	O
operation	O
that	O
extracts	O
small	O
elements	O
and	O
details	O
from	O
given	O
images	O
.	O
</s>
<s>
There	O
exist	O
two	O
types	O
of	O
top-hat	B-Algorithm
transform	I-Algorithm
:	O
the	O
white	O
top-hat	B-Algorithm
transform	I-Algorithm
is	O
defined	O
as	O
the	O
difference	O
between	O
the	O
input	O
image	O
and	O
its	O
opening	B-Algorithm
by	O
some	O
structuring	B-Algorithm
element	I-Algorithm
,	O
while	O
the	O
black	O
top-hat	B-Algorithm
transform	I-Algorithm
is	O
defined	O
dually	O
as	O
the	O
difference	O
between	O
the	O
closing	B-Algorithm
and	O
the	O
input	O
image	O
.	O
</s>
<s>
Top-hat	B-Algorithm
transforms	I-Algorithm
are	O
used	O
for	O
various	O
image	B-Algorithm
processing	I-Algorithm
tasks	O
,	O
such	O
as	O
feature	B-Algorithm
extraction	I-Algorithm
,	O
background	O
equalization	O
,	O
image	B-Application
enhancement	I-Application
,	O
and	O
others	O
.	O
</s>
<s>
Let	O
be	O
a	O
structuring	B-Algorithm
element	I-Algorithm
of	O
grayscale	O
.	O
</s>
<s>
Then	O
,	O
the	O
white	O
top-hat	B-Algorithm
transform	I-Algorithm
of	O
f	O
is	O
given	O
by	O
:	O
</s>
<s>
where	O
denotes	O
the	O
opening	B-Algorithm
operation	I-Algorithm
.	O
</s>
<s>
where	O
is	O
the	O
closing	B-Algorithm
operation	I-Algorithm
.	O
</s>
<s>
The	O
white	O
top-hat	B-Algorithm
transform	I-Algorithm
returns	O
an	O
image	O
,	O
containing	O
those	O
"	O
objects	O
"	O
or	O
"	O
elements	O
"	O
of	O
an	O
input	O
image	O
that	O
:	O
</s>
<s>
The	O
size	O
,	O
or	O
width	O
,	O
of	O
the	O
elements	O
that	O
are	O
extracted	O
by	O
the	O
top-hat	B-Algorithm
transforms	I-Algorithm
can	O
be	O
controlled	O
by	O
the	O
choice	O
of	O
the	O
structuring	B-Algorithm
element	I-Algorithm
.	O
</s>
<s>
Both	O
top-hat	B-Algorithm
transforms	I-Algorithm
are	O
images	O
that	O
contain	O
only	O
non-negative	O
values	O
at	O
all	O
pixels	O
.	O
</s>
<s>
One	O
of	O
its	O
most	O
important	O
uses	O
in	O
image	B-Algorithm
segmentation	I-Algorithm
is	O
to	O
adjust	O
nonuniform	O
lighting	O
conditions	O
on	O
an	O
image	O
and	O
provide	O
a	O
better	O
threshold	O
value	O
for	O
separating	O
objects	O
.	O
</s>
<s>
In	O
this	O
case	O
,	O
the	O
white	O
top-hat	B-Algorithm
transform	I-Algorithm
can	O
remove	O
larger	O
bright	O
objects	O
and	O
retain	O
small	O
blobs	O
by	O
selecting	O
the	O
size	O
of	O
the	O
structuring	B-Algorithm
element	I-Algorithm
that	O
is	O
between	O
removed	O
objects	O
and	O
objects	O
of	O
interest	O
.	O
</s>
<s>
In	O
addition	O
,	O
the	O
objects	O
of	O
interest	O
are	O
circular	O
shapes	O
so	O
we	O
choose	O
a	O
disk	O
shaped	O
structuring	B-Algorithm
element	I-Algorithm
with	O
radius	O
5	O
.	O
</s>
<s>
However	O
,	O
selecting	O
different	O
shapes	O
and	O
sizes	O
for	O
the	O
structuring	B-Algorithm
element	I-Algorithm
result	O
in	O
different	O
images	O
depending	O
on	O
whether	O
objects	O
fit	O
in	O
the	O
structuring	B-Algorithm
element	I-Algorithm
or	O
not	O
.	O
</s>
<s>
The	O
common	O
method	O
for	O
image	B-Algorithm
segmentation	I-Algorithm
is	O
to	O
threshold	O
the	O
input	O
image	O
based	O
on	O
intensity	O
value	O
.	O
</s>
<s>
However	O
,	O
if	O
the	O
image	O
is	O
under	O
nonuniform	O
lighting	O
,	O
it	O
is	O
possible	O
that	O
segmentation	B-Algorithm
errors	O
might	O
present	O
themselves	O
since	O
some	O
objects	O
in	O
darker	O
area	O
have	O
close	O
intensity	O
values	O
as	O
background	O
intensity	O
values	O
and	O
would	O
not	O
be	O
extracted	O
by	O
only	O
utilizing	O
threshold	O
method	O
.	O
</s>
<s>
In	O
this	O
case	O
,	O
before	O
Otsu	B-Algorithm
's	I-Algorithm
method	I-Algorithm
is	O
applied	O
to	O
input	O
image	O
,	O
white	O
top-hat	B-Algorithm
transform	I-Algorithm
should	O
be	O
implemented	O
to	O
correct	O
nonuniform	O
lighting	O
condition	O
and	O
make	O
obvious	O
contrast	O
between	O
background	O
and	O
objects	O
.	O
</s>
<s>
Therefore	O
,	O
the	O
objects	O
can	O
be	O
extracted	O
entirely	O
from	O
background	O
without	O
segmentation	B-Algorithm
errors	O
.	O
</s>
<s>
The	O
threshold	O
values	O
are	O
0.5216	O
and	O
0.2	O
and	O
normalized	O
to	O
for	O
original	O
image	O
and	O
applied	O
white	O
top-hat	B-Algorithm
transform	I-Algorithm
respectively	O
.	O
</s>
