Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Mathematical morphology
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Binary morphology == In binary morphology, an image is viewed as a [[subset]] of a [[Euclidean space]] <math>\mathbb{R}^d</math> or the integer grid <math>\mathbb{Z}^d</math>, for some dimension ''d''. === Structuring element === The basic idea in binary morphology is to probe an image with a simple, pre-defined shape, drawing conclusions on how this shape fits or misses the shapes in the image. This simple "probe" is called the [[structuring element]], and is itself a binary image (i.e., a subset of the space or grid). Here are some examples of widely used structuring elements (denoted by ''B''): * Let <math>E = \mathbb{R}^2</math>; ''B'' is an open disk of radius ''r'', centered at the origin. * Let <math>E = \mathbb{Z}^2</math>; ''B'' is a 3 × 3 square, that is, ''B'' = {(−1, −1), (−1, 0), (−1, 1), (0, −1), (0, 0), (0, 1), (1, −1), (1, 0), (1, 1)}. * Let <math>E = \mathbb{Z}^2</math>; ''B'' is the "cross" given by ''B'' = {(−1, 0), (0, −1), (0, 0), (0, 1), (1, 0)}. === Basic operators === The basic operations are shift-invariant ([[Translational invariance|translation invariant]]) operators strongly related to [[Minkowski addition]]. Let ''E'' be a Euclidean space or an integer grid, and ''A'' a binary image in ''E''. ==== Erosion ==== [[File:Erosion.png|thumb|right|The erosion of the dark-blue square by a disk, resulting in the light-blue square.]] The [[Erosion (morphology)|erosion]] of the binary image ''A'' by the structuring element ''B'' is defined by : <math>A \ominus B = \{z\in E | B_{z} \subseteq A\},</math> where ''B''<sub>''z''</sub> is the translation of ''B'' by the vector ''z'', i.e., <math>B_z = \{b + z \mid b \in B\}</math>, <math>\forall z \in E</math>. When the structuring element ''B'' has a center (e.g., ''B'' is a disk or a square), and this center is located on the origin of ''E'', then the erosion of ''A'' by ''B'' can be understood as the [[Locus (mathematics)|locus]] of points reached by the center of ''B'' when ''B'' moves inside ''A''. For example, the erosion of a square of side 10, centered at the origin, by a disc of radius 2, also centered at the origin, is a square of side 6 centered at the origin. The erosion of ''A'' by ''B'' is also given by the expression <math>A \ominus B = \bigcap_{b \in B} A_{-b}</math>. Example application: Assume we have received a fax of a dark photocopy. Everything looks like it was written with a pen that is bleeding. Erosion process will allow thicker lines to get skinny and detect the hole inside the letter "o". ==== Dilation ==== [[File:Dilation.png|thumb|right|The dilation of the dark-blue square by a disk, resulting in the light-blue square with rounded corners.]] The [[Dilation (morphology)|dilation]] of ''A'' by the structuring element ''B'' is defined by : <math>A \oplus B = \bigcup_{b \in B} A_b.</math> The dilation is commutative, also given by <math>A \oplus B = B \oplus A = \bigcup_{a \in A} B_a</math>. If ''B'' has a center on the origin, as before, then the dilation of ''A'' by ''B'' can be understood as the locus of the points covered by ''B'' when the center of ''B'' moves inside ''A''. In the above example, the dilation of the square of side 10 by the disk of radius 2 is a square of side 14, with rounded corners, centered at the origin. The radius of the rounded corners is 2. The dilation can also be obtained by <math>A \oplus B = \{z \in E \mid (B^s)_z \cap A \neq \varnothing\}</math>, where ''B''<sup>''s''</sup> denotes the [[rotational symmetry|symmetric]] of ''B'', that is, <math>B^s = \{x \in E \mid -x \in B\}</math>. Example application: dilation is the dual operation of the erosion. Figures that are very lightly drawn get thick when "dilated". Easiest way to describe it is to imagine the same fax/text is written with a thicker pen. ==== Opening ==== [[File:Opening.png|thumb|right|The opening of the dark-blue square by a disk, resulting in the light-blue square with round corners.]] The [[Opening (morphology)|opening]] of ''A'' by ''B'' is obtained by the erosion of ''A'' by ''B'', followed by dilation of the resulting image by ''B'': : <math>A \circ B = (A \ominus B) \oplus B.</math> The opening is also given by <math>A \circ B = \bigcup_{B_x \subseteq A} B_x</math>, which means that it is the locus of translations of the structuring element ''B'' inside the image ''A''. In the case of the square of side 10, and a disc of radius 2 as the structuring element, the opening is a square of side 10 with rounded corners, where the corner radius is 2. Example application: Let's assume someone has written a note on a non-soaking paper and that the writing looks as if it is growing tiny hairy roots all over. Opening essentially removes the outer tiny "hairline" leaks and restores the text. The side effect is that it rounds off things. The sharp edges start to disappear. ==== Closing ==== [[File:Closing.png|thumb|right|The closing of the dark-blue shape (union of two squares) by a disk, resulting in the union of the dark-blue shape and the light-blue areas.]] The [[Closing (morphology)|closing]] of ''A'' by ''B'' is obtained by the dilation of ''A'' by ''B'', followed by erosion of the resulting structure by ''B'': : <math>A \bullet B = (A \oplus B) \ominus B.</math> The closing can also be obtained by <math>A \bullet B = (A^c \circ B^s)^c</math>, where ''X''<sup>''c''</sup> denotes the [[complement (set theory)|complement]] of ''X'' relative to ''E'' (that is, <math>X^c = \{x \in E \mid x \notin X\}</math>). The above means that the closing is the complement of the locus of translations of the symmetric of the structuring element outside the image ''A''. ==== Properties of the basic operators ==== Here are some properties of the basic binary morphological operators (dilation, erosion, opening and closing): * They are [[Translational invariance|translation invariant]]. * They are [[increasing]], that is, if <math>A\subseteq C</math>, then <math>A\oplus B \subseteq C\oplus B</math>, and <math>A\ominus B \subseteq C\ominus B</math>, etc. * The dilation is [[commutative]]: <math>A\oplus B = B\oplus A</math> . * If the origin of ''E'' belongs to the structuring element ''B'', then <math>A\ominus B\subseteq A\circ B\subseteq A\subseteq A\bullet B\subseteq A\oplus B</math>. * The dilation is [[associative]], i.e., <math>(A\oplus B)\oplus C = A\oplus (B\oplus C)</math>. Moreover, the erosion satisfies <math>(A\ominus B)\ominus C = A\ominus (B\oplus C)</math>. * Erosion and dilation satisfy the duality <math>A \oplus B = (A^{c} \ominus B^{s})^{c}</math>. * Opening and closing satisfy the duality <math>A \bullet B = (A^{c} \circ B^{s})^{c}</math>. * The dilation is [[Distributive property|distributive]] over [[set union]] * The erosion is [[Distributive property|distributive]] over [[set intersection]] * The dilation is a [[pseudo-inverse]] of the erosion, and vice versa, in the following sense: <math>A\subseteq (C\ominus B)</math> if and only if <math>(A\oplus B)\subseteq C</math>. * Opening and closing are [[idempotent]]. * Opening is [[anti-extensive]], i.e., <math>A\circ B\subseteq A</math>, whereas the closing is ''extensive'', i.e., <math>A\subseteq A\bullet B</math>. === Other operators and tools === * [[Hit-or-miss transform]] * [[Pruning (morphology)|Pruning transform]] * [[Morphological skeleton]] * [[Filtering by reconstruction]] * [[Ultimate erosions]] and [[conditional bisector]]s * [[Granulometry (morphology)|Granulometry]] * [[Geodesic distance function]]s
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)