<s>
In	O
mathematical	B-Algorithm
morphology	I-Algorithm
and	O
digital	B-Algorithm
image	I-Algorithm
processing	I-Algorithm
,	O
a	O
morphological	B-Algorithm
gradient	I-Algorithm
is	O
the	O
difference	O
between	O
the	O
dilation	B-Algorithm
and	O
the	O
erosion	B-Algorithm
of	O
a	O
given	O
image	O
.	O
</s>
<s>
It	O
is	O
an	O
image	O
where	O
each	O
pixel	B-Algorithm
value	O
(	O
typically	O
non-negative	O
)	O
indicates	O
the	O
contrast	O
intensity	O
in	O
the	O
close	O
neighborhood	O
of	O
that	O
pixel	B-Algorithm
.	O
</s>
<s>
It	O
is	O
useful	O
for	O
edge	B-Algorithm
detection	I-Algorithm
and	O
segmentation	B-Algorithm
applications	O
.	O
</s>
<s>
Let	O
be	O
a	O
grayscale	O
structuring	B-Algorithm
element	I-Algorithm
.	O
</s>
<s>
Then	O
,	O
the	O
morphological	B-Algorithm
gradient	I-Algorithm
of	O
f	O
is	O
given	O
by	O
:	O
</s>
<s>
where	O
and	O
denote	O
the	O
dilation	B-Algorithm
and	O
the	O
erosion	B-Algorithm
,	O
respectively	O
.	O
</s>
<s>
If	O
,	O
then	O
all	O
the	O
three	O
gradients	O
have	O
non-negative	O
values	O
at	O
all	O
pixels	B-Algorithm
.	O
</s>
