Chapter 5 Mathematical Morphology

5.1 Introduction
mathematical morphology works on shape
shape: prime carrier of information in machine vision
morphological operations: simplify image data,
preserve essential shape characteristics, eliminate irrelevancies
shape: correlates directly with decomposition of objects, object features,
object surface defects, assembly defects

5.2 Binary Morphology
set theory: language of binary mathematical morphology
sets in mathematical morphology: represent shapes
Euclidean -space:
discrete Euclidean -space:
: hexagonal grid, square grid

dilation, erosion: primary morphological operations
opening, closing: composed from dilation, erosion
opening, closing: related to shape representation, decomposition, primitive
extraction

5.2.1 Binary Dilation
dilation: combines two sets by vector addition of set elements
dilation of by :

=====Fig. 5.1=====
: referred as set, image
: structuring element: kernel

dilation by disk: isotropic swelling or expansion
=====Fig. 5.2=====
dilation by kernel without origin: might not have common pixels with
translation of dilation: always can contain
=====lena.bin.128=====
=====lena.bin.dil=====

for noise removal
: set of four 4-neighbors of (0,0) but not (0,0)
4-isolated pixels removed
only points in with at least one of its 4-neighbors remain

: translation of by the point

dilation: union of translates of kernel

associativity of dilation: chain rule: iterative rule

dilation of translated kernel: translation of dilation

dilation distributes over union

dilating by union of two sets: the union of the dilation

dilating by kernel with origin guaranteed to contain
extensive: operators whose output contains input
dilation extensive when kernel contains origin

dilation preserves order

increasing: preserves order
=====Reader's Digest, Oct. 1994, p. 73=====

5.2.2 Binary Erosion
erosion: morphological dual of dilation
erosion of by : set of all s.t. for every

erosion: shrink: reduce
=====Fig. 5.3=====
=====lena.bin.ero=====
erosion of by : set of all for which translated to contained in

if translated to contained in , then in

erosion: difference of elements and

dilation: union of translates
erosion: intersection of negative translates

=====Fig. 5.4=====
Minkowski subtraction: close relative to erosion
Minkowski subtraction:

erosion: shrinking of the original image
antiextensive: operated set contained in the original set
erosion antiextensive: if origin contained in kernel
if then because:
if then for every , since thus

eroding by kernel without origin can have nothing in common with
=====Fig. 5.5=====

possible: and
e.g. , then , yet

dilating translated set results in a translated dilation

eroding by translated kernel results in negatively translated erosion

dilation, erosion: increasing

eroding by larger kernel produces smaller result

dilation, erosion similar that one does to foreground, the other to background
similarity: duality
dual: negation of one equals to the other on negated variables
DeMorgan's law: duality between set union and intersection

negation of a set: complement

negation of a set in two possible ways in morphology

• logical sense: set complement
• geometric sense: reflection: reversing of set orientation

: reflection about the origin of

: symmetrical set of with respect to origin [Matheron 1975]
: transpose [Serra 1982]

complement of erosion: dilation of the complement by reflection
Theorem 5.1: Erosion Dilation Duality

=====Fig. 5.6=====
Corollary 5.1:

erosion of intersection of two sets: intersection of erosions

=====Fig. 5.7=====
erosion of a kernel of union of two sets: intersection of erosions

erosion of kernel of intersection of two sets: contains union of erosions

no stronger
=====Fig. 5.8=====

chain rule for erosion holds when kernel decomposable through dilation

duality does not imply cancellation on morphological equalities

containment relationship holds

genus : number of connected components minus number of holes of
4-connected for object, 8-connected for background

8-connected for object, 4-connected for background

=====Fig. 5.9=====

5.2.3 Hit-and-Miss Transform
hit-and-miss: selects corner points, isolated points, border points
hit-and-miss: performs template matching, thinning, thickening, centering
hit-and-miss: intersection of erosions
kernels satisfy
hit-and-miss of set by

hit-and-miss: to find upper right-hand corner
=====Fig. 5.11=====
locates all pixels with south, west neighbors part of
locates all pixels of with south, west neighbors in
and displaced from one another

hit-and-miss: locate particular spatial patterns
then : set of all 4-isolated pixels
hit-and-miss: to compute genus of a binary image

=====Fig. 5.10=====

hit-and-miss: thickening and thinning
hit-and-miss: counting
hit-and-miss: template matching

5.2.4 Dilation and Erosion Summary
=====dilation and erosion summary, p. 173=====
=====Garfield 17:5=====

5.2.5 Opening and Closing
dilation and erosions: usually employed in pairs
: opening of image by kernel

: closing of image by kernel

open under : open w.r.t. :
closed under : closed w.r.t. :
morphological opening, closing: no relation to topologically open, closed sets

opening characterization theorem

: selects points covered by some translation of , entirely contained in
=====lena.bin.open=====
opening with disk kernel: smoothes contours, breaks narrow isthmuses
opening with disk kernel: eliminates small islands, sharp peaks, capes
=====lena.bin.close=====
closing by disk kernel: smoothes contours, fuses narrow breaks, long, thin gulfs
closing with disk kernel: eliminates small holes, fill gaps on the contours

unlike erosion and dilation: opening invariant to kernel translation

opening antiextensive

like erosion and dilation: opening increasing

: those pixels covered by sweeping kernel all over inside of

: shape with body and handle
: small disk structuring element with radius just larger than handle width
extraction of the body and handle by opening and taking the residue
=====Fig. 5.16=====
extraction of trunk and arms with vertical and horizontal kernels
=====Fig. 5.17=====
extraction of base, trunk, horizontal and vertical areas
=====Fig. 5.18=====
noisy background line segment removal
=====Fig. 5.19=====
decomposition into parts
=====Fig. 5.20==========Fig. 5.21=====

closing: dual of opening

like opening: closing invariant to kernel translation

closing extensive

like dilation, erosion, opening: closing increasing

opening idempotent

closing idempotent

if not necessarily follows that
=====Fig. 5.22=====

closing may be used to detect spatial clusters of points
=====Fig. 5.23=====

5.2.6 Morphological Shape Feature Extraction
morphological pattern spectrum: shape-size histogram [Maragos 1987]

5.2.7 Fast Dilations and Erosions
decompose kernels to make dilations and erosions fast

5.3 Connectivity
morphology and connectivity: close relation

5.3.1 Separation Relation
separation if and only if symmetric, exclusive, hereditary, extensive

5.3.2 Morphological Noise Cleaning and Connectivity
images perturbed by noise can be morphologically filtered to remove some noise

5.3.3 Openings, Holes, and Connectivity
opening can create holes in a connected set that is being opened
=====Fig. 5.25=====

5.3.4 Conditional Dilation
select connected components of image that have nonempty erosion
conditional dilation , defined iteratively
are points in the regions we want to select

conditional dilation where is the smallest index
=====Fig. 5.26=====

5.4 Generalized Openings and Closings
generalized opening: any increasing, antiextensive, idempotent operation
generalized closing: any increasing, extensive, idempotent operation
=====Oldie 33:18=====

5.5 Gray Scale Morphology
binary dilation, erosion, opening, closing naturally extended to gray scale
extension: uses min or max operation
gray scale dilation: surface of dilation of umbra
gray scale dilation: maximum and a set of addition operations
gray scale erosion: minimum and a set of subtraction operations

5.5.1 Gray Scale Dilation and Erosion
top: top surface of : denoted by :

umbra of : denoted by

=====Fig. 5.28=====
gray scale dilation: surface of dilation of umbras
dilation of by : denoted by

=====Fig. 5.29=====
=====Fig. 5.30=====

and , then

=====Fig. 5.31=====
=====lena.im=====
=====lena.im.dil=====

gray scale erosion: surface of binary erosions of one umbra by the other umbra

=====Fig. 5.32=====

and , then

=====Fig. 5.33=====
=====lena.im.ero=====
=====Fig. 5.34=====

5.5.2 Umbra Homomorphism Theorems
surface and umbra operations: inverses of each other, in a certain sense
surface operation: left inverse of umbra operation

Proposition 5.1

Proposition 5.2

Proposition 5.3

5.5.3 Gray Scale Opening and Closing
gray scale opening of by kernel : denoted by

=====lena.im.open=====

gray scale closing of by kernel : denoted by

=====lena.im.close=====

duality of gray scale dilation, erosion duality of opening, closing

=====Fig. 5.37=====

5.6 Openings, Closings, and Medians
median filter: most common nonlinear noise-smoothing filter
median filter: for each pixel, the new value is the median of a window
median filter: robust to outlier pixel values, leaves edges sharp
median root images: images remain unchanged after median filter

5.7 Bounding Second Derivatives
opening or closing a gray scale image: simplifies the image complexity

5.8 Distance Transform and Recursive Morphology
Fig. 5.39 (b) fire burns from outside but burns only downward and right-ward
=====Fig. 5.39=====

5.9 Generalized Distance Transform

5.10 Medial Axis
medial axis transform: medial axis with distance function

5.10.1 Medial Axis and Morphological Skeleton
morphological skeleton of a set by kernel , where

skeleton of given by
=====Fig. 5.40=====
=====Fig. 5.41=====

5.11 Morphological Sampling Theorem

5.11.1 Set-Bounding Relationships

5.11.2 Examples

5.11.3 Distance Relationships
=====Garfield 17:7=====

5.12 Summary
morphological operations: shape extraction, noise cleaning, thickening
morphological operations: thinning, skeletonizing

2001-09-19
Counter:

FastCounter by bCentral