kb/data/en.wikipedia.org/wiki/Morphological_gradient-0.md

234 lines
3.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: "Morphological gradient"
chunk: 1/1
source: "https://en.wikipedia.org/wiki/Morphological_gradient"
category: "reference"
tags: "science, encyclopedia"
date_saved: "2026-05-05T11:36:29.332732+00:00"
instance: "kb-cron"
---
In mathematical morphology and digital image processing, a morphological gradient is the difference between the dilation and the erosion of a given image. It is an image where each pixel value (typically non-negative) indicates the contrast intensity in the close neighborhood of that pixel. It is useful for edge detection and segmentation applications.
== Mathematical definition and types ==
Let
f
:
E
R
{\displaystyle f:E\mapsto R}
be a grayscale image, mapping points from a Euclidean space or discrete grid E (such as R2 or Z2) into the real line. Let
b
(
x
)
{\displaystyle b(x)}
be a grayscale structuring element. Usually, b is symmetric and has short-support, e.g.,
b
(
x
)
=
{
0
,
|
x
|
1
,
,
otherwise
{\displaystyle b(x)=\left\{{\begin{array}{ll}0,&|x|\leq 1,\\-\infty ,&{\mbox{otherwise}}\end{array}}\right.}
.
Then, the morphological gradient of f is given by:
G
(
f
)
=
f
b
f
b
{\displaystyle G(f)=f\oplus b-f\ominus b}
,
where
{\displaystyle \oplus }
and
{\displaystyle \ominus }
denote the dilation and the erosion, respectively.
An internal gradient is given by:
G
i
(
f
)
=
f
f
b
{\displaystyle G_{i}(f)=f-f\ominus b}
,
and an external gradient is given by:
G
e
(
f
)
=
f
b
f
{\displaystyle G_{e}(f)=f\oplus b-f}
.
The internal and external gradients are "thinner" than the gradient, but the gradient peaks are located on the edges, whereas the internal and external ones are located at each side of the edges. Notice that
G
i
+
G
e
=
G
{\displaystyle G_{i}+G_{e}=G}
.
If
b
(
0
)
0
{\displaystyle b(0)\geq 0}
, then all the three gradients have non-negative values at all pixels.
== References ==
Image Analysis and Mathematical Morphology by Jean Serra, ISBN 0-12-637240-3 (1982)
Image Analysis and Mathematical Morphology, Volume 2: Theoretical Advances by Jean Serra, ISBN 0-12-637241-1 (1988)
An Introduction to Morphological Image Processing by Edward R. Dougherty, ISBN 0-8194-0845-X (1992)
== External links ==
Morphological gradients, Centre de Morphologie Mathématique, École_des_Mines_de_Paris