MMCOURS1 - PowerPoint PPT Presentation

About This Presentation
Title:

MMCOURS1

Description:

Idempotence: A transformation Y is idempotent if its output is invariant with ... Opening and closing are both idempotent transformations: gg = g and ... – PowerPoint PPT presentation

Number of Views:56
Avg rating:3.0/5.0
Slides: 89
Provided by: jsp29
Category:

less

Transcript and Presenter's Notes

Title: MMCOURS1


1
Mathematical Morphology from Erosion to
Watersheds
Allan Hanbury
PRIP, Vienna University of TechnologyFavoritenst
raße 9/1832A-1040 Vienna, Austriahanbury_at_prip.tu
wien.ac.athttp//www.prip.tuwien.ac.at/hanbury
2
Contents
  • Introduction
  • Erosion and Dilation
  • Opening and Closing
  • Binary Geodesic Operators
  • Numerical Geodesic Operators
  • SKIZ and Watershed
  • Applications

3
Contents
  • Introduction
  • Erosion and Dilation
  • Opening and Closing
  • Binary Geodesic Operators
  • Numerical Geodesic Operators
  • SKIZ and Watershed
  • Applications

4
Image Processing (I)
  • gt Image processing may be divided into three
    classes of questions, namely Codification,
    Extraction of characteristics and Segmentation.
  • 1) Codification
  • Codification concerns the representation of the
    images. It comprises

Numerical Image
Analog Image
Acquisition Transformation of analogue images
into numerical ones. Compression Modification
of image representation. Synthesis Generation
of an image from a more symbolic representation.
Acquisition
Numerical Image n 1
Numerical Image n 2
Compression
Numerical Image
Numbers
Synthesis
5
Image Processing (II)
  • 2) Extraction of Characteristics
  • The aim here is to improve image quality or to
    exhibit some of its features. This includes in
    particular measurements, noise reduction, and
    filtering.
  • 3) Segmentation
  • Segmentation consists in partitioning the
    images into zones which are homogeneous according
    to a given criterion.

Image2
Image1
Image Tranformations
Numbers
6
Definitions of Mathematical Morphology
Mathematics
Physics
Lattice theory for objects or operators in
continuous or discrete spaces Topological and
stochastic models.
  • Signal analysis techniques based on set theory
    aiming at the study of relations between physical
    and structural properties.

Engineering
Signal Processing
Algorithms and software / hardware tools for
developing signal processing applications.
Nonlinear signal processing technique based on
minimum and maximum operations.
7
Input Output Comparison (I)
  • Extensivity and Anti-extensivity A
    transformation Y is extensive if its output is
    always greater than its input. It is
    anti-extensive when the output is always smaller
    than the input.
  • Extensivity X Í Y (X)
    Anti-extensivity X Ê Y (X) X Í E
  • Set (extensivity)
    Function (extensivity)

8
Input Output Comparison (II)
  • Idempotence A transformation Y is idempotent if
    its output is invariant with respect to the
    transformation itself
  • Idempotence Y Y (X) Y (X)
  • Increasingness A transformation Y is increasing
    if it preserves the ordering relation between
    images
  • Increasing ?f , g, f ? g ? Y (
    f ) ? Y ( g )

9
Contents
  • Introduction
  • Erosion and Dilation
  • Opening and Closing
  • Binary Geodesic Operators
  • Numerical Geodesic Operators
  • SKIZ and Watershed
  • Applications

10
Erosion
  • A structuring element (SE) is a small set used to
    probe the image under study.
  • For the Erosion of a set, we ask the question
    Where does the structuring element fit the set?
  • The erosion of a set X by a structuring element B
    is denoted by eB(X) and is defined as the locus
    of points x such that B is included in X when its
    origin is placed at x
  • eB(X) X?B x Bx Í X

Initial set X
Erosion of X
Image size 256 ? 256 pixelsSE size 15 ? 15 pixels
11
Dilation
  • Dilation is the dual operator of erosion.
  • It is based on the question Where does the
    structuring hit the set?
  • The dilation of a set X by a structuring element
    B is denoted by dB(X) and is defined as the locus
    of points x such that B hits X when its origin
    coincides with x
  • dB(X) X?B x Bx Ç X ? ?

Initial set X
Dilation of X
Image size 256 ? 256 pixelsSE size 15 ? 15 pixels
12
Equivalence between Sets and Functions
  • A function can be viewed as a stack of decreasing
    sets. Each set is the intersection between the
    umbra of the function and a horizontal plane.
  • Xl (f) xÎ E , f(x) ³ l Û f(x)
    sup l xÎ Xl (f)

13
Dilation and Erosion by a flat structuring Element
grey levels
Definition The dilation (erosion) of a function
by a flat structuring element B is introduced as
the dilation (erosion) of each set Xf (l) by B.
They are said to be planar. This definition
leads to the following formulae ( f?B) (x)
sup f(x-y), y?B ( f?B) (x) inf f(x-y),
y?B
Dilate
Original
Eroded
Structuring
element
Space
  • Erosion shrinks positive peaks. Peaks thinner
    that the structuring element disappear. It also
    expands the valleys and the sinks.
  • Dilation produces the dual effects.

14
Greyscale Dilation and Erosion examples
Erode
Dilate
Initial image
Image size 256 ? 256 pixelsSE size 9 ? 9 pixels
15
Properties of Dilation and Erosion (I)
  • Dilation and Erosion are dual transformations
    with respect to complementation.
  • This means that any erosion of an image is
    equivalent to a complementation of the dilation
    of the complemented image with the same
    structuring element (and vice-versa).
  • In terms of symbols eB ?dB?

eB
?
?
dB
16
Properties of Dilation and Erosion (II)
  • Dilation and Erosion are increasing
    transformations.

17
Residues of Transformations
  • Definition
  • The residue between two transformations y et z is
    their difference
  • Set case
  • Functions case rY,z(X) y(X) -
    z(X)

rY,z(X) y(X) \ z(X)
y
y
z
z
Residue
Residue
18
Morphological Gradients
The goal of gradient transformations is to
highlight contours. In digital morphology, three
Beuchers gradients based on the unit disc are
defined
  • Gradient by erosion
  • It is the residue between the identity and an
    erosion , i.e.
  • for sets g- (X) X / (X?B)
  • for functions g- (f) f - (f?B)
  • Gradient by dilation
  • It is the residue between a dilation and the
    identity, i.e.
  • for sets g (X) (XB) / X
  • for functions g (f ) (fB) - f

19
Morphological Gradients (II) and Laplacian
  • Laplacian
  • It is the residue between the gradients by
    dilation and erosion, for functions
  • L(f) g (f ) - g- (f)
  • Symmetrical gradient
  • It is the residue between a dilation and an
    erosion
  • for sets g (X) (XB) / (X,B)
  • for functions g(f) (fB) - (f,B)

Note These notions correspond the classical
notions of gradient and Laplacian (if they
exist), in the limit when the radius of the disc
tends towards zero.
20
Morphological Gradient examples
Gradientby erosion
Initial image
Gradientby dilation
Image size 256 ? 256 pixelsSE size 3 ? 3 pixels
21
Contents
  • Introduction
  • Erosion and Dilation
  • Opening and Closing
  • Binary Geodesic Operators
  • Numerical Geodesic Operators
  • SKIZ and Watershed
  • Applications

22
Opening and Closing
The problem of an inverse operator Several
different sets may admit a same erosion, or a
same dilate. But among all possible inverses,
there always exists a smallest one (a largest
one). It is obtained by composing erosion with
the corresponding dilation (or vice versa) .
  • The mapping is called opening, and is denoted by
  • g B dB eB
  • XoB (X, B) Å B
  • By commuting the factors dB and eB we obtain the
    closing
  • jB eB dB
  • XB (X Å B) , B

structuring element
Erosion
?
23
Effects of Opening
Structuring element
  • Geometrical interpretation
  • The opened set gB(X) is the union of the
    structuring elements Bx which are included in set
    X.

Opening
When B is a disc, the opening reduces the capes,
removes the small islands and opens isthmuses.
24
Effects of Closing
Structuring element
  • Geometrical interpretation
  • The closing ?B(X) is the complement of the domain
    swept by B as it misses set X.
  • All background structures that cannot contain the
    structuring element are filled by the closing.

Closing
When B is a disc, the closing closes the
channels, fills completely the small lakes, and
partly the gulfs.
25
Effects on Functions
  • The opening and closing create a simpler function
    than the original. They smooth in a nonlinear
    way.
  • The opening (closing) removes positive (negative)
    peaks that are thinner than the structuring
    element.
  • The opening (closing) remains below (above) the
    original function.

26
Greyscale Opening and Closing examples
Opening
Closing
Initial image
Image size 256 ? 256 pixelsSE size 9 ? 9 pixels
27
Properties of Opening and Closing
  • Opening and Closing are dual transformations with
    respect to complementation.
  • Openings are anti-extensive transformations (some
    pixels are removed) and closings are extensive
    transformations (some pixels are added).
  • Opening and closing are both increasing
    transformations.
  • Opening and closing are both idempotent
    transformations gg g and
    ?? ?

28
Suprema of Openings
  • Theorem
  • Any supremum of openings is still an opening.
  • Any infimum of closings is still a closing.
  • Application
  • For creating openings with specific selection
    properties, one can use structuring elements with
    various shapes and take their supremum.

Opening by
sup.
Opening by
Original
Opening by
29
Top-hat Transformation
  • Goal
  • The top-hat transformation, due to F. Meyer,
    aims to suppress slow trends, therefore to
    enhance the contrasts of some features in
    images, according to size or shape criteria. This
    operator is used mainly for numerical functions.
  • Definition
  • The top-hat transformation is the residue
    between the identity and an opening
  • r(f) f - g(f) ( functions) r(X)
    X \ g(X) (sets)
  • A dual top-hat can be defined the residue
    between a closing and the identity
  • r(f) j(f) - f ( functions) r(X)
    j(X) \ X (sets)

30
Use of the Top-hat
  • Sets
  • The top-hat extracts the objects that have not
    been eliminated by the opening. That is, it
    removes objects larger than the structuring
    element.
  • Functions
  • The top-hat is used to extract contrasted
    components with respect to the background. The
    basic top-hat extracts positive components and
    the dual top hat the negative ones.
  • Typically, top-hats remove the slow trends, and
    thus performs a contrast enhancement.

31
Example of a Top-hat
Comment The goal is the extraction of the
aneurisms (the small white spots). Top hat c),
better than b) is far from being perfect. Here
opening by reconstruction yields a correct
solution.
Top hat by a hexagonal opening of size 10.
Negative image of the retina.
Top hat by the sup of three openings by
linear segments of size 10.
32
Contents
  • Introduction
  • Erosion and Dilation
  • Opening and Closing
  • Binary Geodesic Operators
  • Numerical Geodesic Operators
  • SKIZ and Watershed
  • Applications

33
Geodesic Distance
  • Definition
  • The set geodesic distance dX ?n-?n ?, with
    respect to reference set X is defined by
  • dX(x,y) Infimum of the lengths of the paths
    going from x to y and included X
  • dX(x,y) T, if no such path exists.
  • Properties
  • 1) dX is a generalized distance, since
  • dX(x,y) dX(y,x)
  • dX(x,y) 0 Û x y
  • dX(x,z) dX(x,y) dX(y,z)
  • 2) The geodesic distance is always larger than
    the Euclidean one
  • 3) A geodesic segment may not be unique.

Examples of geodesics in ?2
x

z
y'
y
X
N.B. the portions of geodesics
included in the interior of X are
line segments
34
Geodesic Discs
  • The notion of geodesic path is seldom used. By
    contrast, the notion of geodesic discs appears
    very often
  • BX,l (z) y, dX(z,y) l
  • When the radius r increases, the discs progress
    as a wave front emitted from z inside the medium
    X.
  • For a given radius l, the discs BX,l can be
    viewed as a set of structuring elements which
    vary from place to place.

z
BX,l (z)
X
35
Geodesic Dilation
  • The geodesic dilation of size l of Y inside X is
    written as follows
  • dX,l (Y) BX,l (y) , yÎY

geodesic dilation
Y
X
36
Geodesic Erosion
  • The geodesic erosion is the dual transformation
    of the geodesic dilation with respect to set
    complementation.
  • But the complement is taken inside the mask X
    (i.e. YDX \ Y X Ç YC), which results in the
    erosion
  • eX(Y) X \ dX (X \ Y)
  • i.e.
  • eX(Y) e ( Y È Xc ) Ç X
  • where e stands for an isotropic erosion of size
    1.
  • Note the difference between and eX(Y) and e
    (Y)Ç X.

Geodesic erosion
Y
e
(Y)
X
X
Y
e
(Y)
Ç
X
37
(Binary) Digital Geodesic Dilation
  • In the digital metrics on ?n , and when d(x)
    stands for the unit ball centered at point x,
    then the unit geodesic dilation is defined by the
    relation
  • dX(Y) d (Y) Ç X
  • The dilation of size n is then obtained by
    iteration
  • dX,n(Y) dX(n)(Y) , with
  • dX(n)(Y) d( ... d(d (Y) Ç X) Ç X ... ) Ç X
  • X is called the mask, and Y the marker.

X
Y
dX(Y)
dX(2)(Y)
38
Reconstruction by dilation
  • The reconstruction by dilation of a mask image X
    from a marker image Y is defined as the geodesic
    dilation of Y with respect to X until stability.
  • This can be seen as an infinite geodesic
    dilation
  • dX, (Y) È dX,l(Y) , lgt0 or as
    an iteration of unit geodesic dilations until
    there is no further change
  • RX(Y) dX(i)(Y)
  • where i is such that dX(i)(Y) dX(i1)(Y)
  • This an opening as it is
  • Increasing Y1 ? Y2 ? RX(Y1) ? RX(Y2)
  • Anti-extensive RX(Y) ? X
  • Idempotent RR (Y)(Y) RX(Y)

Y
X
X
39
Application Filtering by Erosion-Reconstruction
  • Firstly, the erosion X,Bl suppresses the
    connected components of X that cannot contain a
    disc of radius l. This is then used as the marker
    Y.
  • Then the opening RX(Y) of marker Y X,Bl
    re-builds all the others.

c) Reconstruction of b) inside a)
a) Initial image
b) Eroded of a) by a disc
40
Application Removal of the edge grains
  • Let Z be the set of the edges, and X be the
    grains under study
  • Set Y is the reconstruction of Z?X inside set X
  • the set difference between X and Y extracts the
    internal particles.

X
Z
a) Initial image
b) Particles that hit the edges
c) Residue a) - b)
41
Application Hole Filling
Comment efficient algorithm, except for the
particles that hit the edges of the field.
initial image X
reconstruction of A inside XC
A part of the edge that hits XC
42
Individual Analysis of Particles
  • Algorithm (J.C. Klein)
  • While set X is not empty do
  • p first point of the video scan
  • Y connected component of X reconstructed
    from p
  • Processing of Y (and various measurements)
  • X X \ Y

X
Y
new X
Individual extraction of particles
43
Contents
  • Introduction
  • Erosion and Dilation
  • Opening and Closing
  • Binary Geodesic Operators
  • Numerical Geodesic Operators
  • SKIZ and Watershed
  • Applications

44
Numerical Geodesic Dilations (I)
  • Let f and g be two numerical functions from Åd
    into Å, with g f.
  • The binary geodesic dilation of size l of each
    cross section of g inside that of f at the same
    level induces on g a dilation df,l(g) (S.
    Beucher).
  • Function g is the marker, and f is the mask.

Numerical geodesic dilation of g with
respect to f
f
df,l(g)
g
45
Numerical geodesic Dilations (II)
  • The digital version starts from the unit geodesic
    dilation df (g) inf (g B , f )
  • which is iterated n times to give a geodesic
    dilation of size n
  • df ,n(g) df (n)(g) df (df .... (df (g))).
  • The Euclidean and digital erosions derive from
    the corresponding dilations by the following
    duality ef(g) m - d(m-f ) (m - g) ,
    which is different to the
    binary duality.
  • m is the maximum possible value in the image
    (i.e. 255 for 8-bit images).

Numerical geodesic erosion of f with respect
to g
f
ef,l(g)
g
46
Numerical Reconstruction
  • The reconstruction opening of f from g is the
    supremum of the geodesic dilations of g inside f,
    this sup being considered as a function of f
  • Rf(g) df,l(g) , lgt0 or, as before
  • Rf(g) df(i)(g)
  • where i is such that df(i)(g) df(i1)(g).
  • The corresponding reconstruction by erosion
    is Rf(g) ef(i)(g)
  • where i is such that ef(i)(g) ef(i1)(g).

Numerical Reconstruction of g inside
f
f
grec(f g)
g
47
Applications of Reconstruction
  • The three major applications are
  • swamping, or reconstruction of a function by
    imposing markers for the maxima
  • reconstruction from an erosion
  • contrast opening, which extracts and filters the
    maxima.

48
Reconstruction Opening by Erosion
  • Goal contour preservation
  • Whereas the standard opening modifies contours,
    this transform is aimed at efficiently and
    precisely reconstructing the contours of the
    objects which have not been totally removed by
    the filtering process.

Structuring
B
element
Algorithm - the mask is the original signal, -
the marker is an eroded of the mask.
Dilation
opening by a disc
Erosion
Reconstruction
Original
Rf eB(f) df(n)eB(f ) , n gt 0
Opening by reconstruction
49
Application to Retina Examination
Comment The aim is to extract and to localise
aneurisms. Reconstruction operators ensure that
one can remove exclusively the small and
isolated peaks (case study due to F. Zana and J.
C. Klein).
b) closing by dilation-reconstruction followed
by opening by erosion-reconstruction
a) Initial image
c) difference a) minus b) followed by a threshold
50
Reconstruction of a Function from Markers
  • Goal
  • To remove the useless maxima (or minima) of
    a function.
  • Algorithm
  • The marker is a bi-valued (0,m) function
    identifying the peaks of interest.
  • The reconstruction process result is the largest
    function f and admitting maxima at the marked
    points only. It is called the swamping of f by
    opening (S. Beucher, F. Meyer),

marker
Swamping of f by markers m ( by
opening )
51
An Example of Swamping Contrast Opening
  • Goal
  • Both morphological and reconstruction openings
    reduce the functions according to size criteria
    which work on their cross sections. In opening by
    dynamics, the criterion holds on grey tone
    contrast (M.Grimaud).
  • Algorithm
  • Shift down the initial function f by constant c
  • Rebuild f from function f - c, i.e.
  • Rf(f-c) df(n)(f-c) , n gt 0

52
Application to Maxima Detection
  • The maxima of a numerical function on a space E
    are the connected components of E where f is
    constant and surrounded by lower values.
  • Therefore they are given by the residues of
    contrast opening of shift c 1
  • More generally, the residuals associated with a
    shift c extract the maxima surrounded by a
    descending zone deeper than c. They are called
    Extended Maxima (S. Beucher).

53
Contents
  • Introduction
  • Erosion and Dilation
  • Opening and Closing
  • Binary Geodesic Operators
  • Numerical Geodesic Operators
  • SKIZ and Watershed
  • Applications

54
SKIZ, or Skeleton by Influence Zones
  • Definition (C. Lantuejoul) Consider a compact set
    X in Å2 .
  • The zone of influence of a component Xi of X is
    the set of points of the plane that are closer
    to Xi than to any other component.
  • The SKIZ is then defined as the boundary of all
    zones of influence.
  • Algorithm
  • In the digital case, the SKIZ is constructed in
    two steps
  • 1) Thinning of the background (with L in the
    hexagonal case)
  • 2) Pruning of the thinned transform (with E in
    the hexagonal case)

55
Geodesic SKIZ
  • Let Y Yi , iÎI be a set of the
    Euclidean plane made of I compact connected
    components, and included in a compact set X.
  • The geodesic zone of influence of a component Yi
    in X, is formed by all points of X whose geodesic
    distance to Yi is smaller than to any other
    component of Y
  • zi (Yi \ X) aÎX , "k ¹ i, dX(a, Yj)
    dX(a,Yk)
  • where the geodesic distance from point a to
    set Y is the inf of the geodesic distances from a
    to all points of Y.
  • The geodesic SKIZ is then the boundaries of all
    geodesic zones of influence.

SKIZ (Y)
Y
2
Y
1
ziX (Y1)
Y
3
X
An example of geodesic SKIZ
56
Distance function (I)
  • Definition
  • The distance function is an intermediate step
    between sets and functions.
  • When a distance has been defined on E, it is
    possible to associate, with each set X, the
    subset Xl composed of all those points of X
    whose distance to the boundary is larger than l.
  • As l increases, the subsets Xl are included
    within each other (and parallel in the Euclidean
    case). They can be considered as the horizontal
    thresholds of a function whose grey level is l
    at point x if x is at distance l to the boundary.
    This function is called Distance Function.

57
Distance Function (II) an Example
Comment Figure b shows the supremum of both
distance functions of X and Xc
Set X
Corresponding Distance Functions
58
Topographic Image Representation
  • The height in the topographic representation
    corresponds to the greylevel in the initial
    image.

y
x
y
x
59
Watershed Lines for Numerical Functions
  • If a drop of water falls on such a topographic
    surface, it will obey the law of gravitation and
    flow along the steepest slope path until it
    reaches a minimum.
  • The whole set of points of the surface whose
    steepest slope paths reach a given minimum
    constitutes the catchment basin associated with
    this minimum.
  • The watersheds are the zones dividing adjacent
    catchment basins.

topographical patterns of a numerical image
Catchment Basins
Watershed Lines
surface of the function
Minima
N.B. Beucher-Lantuejouls algorithm is
presented below for the sake of pedagogy. But it
is not the unique one, it has been improved by P.
Soille and L. Vincent. Another implementation,
based on hierarchical queues, due to F. Meyer is
more efficient.
60
Construction of the Watersheds by Flooding (I)
  • Suppose that holes are made in each local minimum
    and that the surface is flooded from these holes.
    Progressively, the water level will increase.
  • In order to prevent the merging of water coming
    from two different holes, a dam is progressively
    built at each contact point.
  • At the end, the union of all complete dams
    constitute the watersheds.

Dams in construction
Water level
Minima
61
Construction of the Watersheds by Flooding
Example
62
Construction of the Watersheds by Flooding (II)
  • Flooding algorithm (S. Beucher, Ch. Lantuejoul)
  • Let m be the minimum of function f. Put
  • X0 x f(x) m,
  • Xk x f(x) mk with 1 k max f
  • Denote by Y1 the geodesic zones of influence of
    X0 inside X1. Distinguish three types of
    connected components of X1
  • those, X1,1 that do not contain points of X0
    then they do not belong to Y1
  • those, X1,2 that contain a unique c.c. of X0
    then they fully belong to Y1
  • those, X1,3 that contain several c.c. of X0 Y1
    recovers then X1,3 minus the branches of its
    geodesic SKIZ.

Evolution of the flooding
X1.1
c.c. of X0

X1.2
c.c. of X0

skiz ( X0 \ X1 )
63
Construction of the Watersheds by Flooding (III)
  • Since the X1,1 's are minima which appear at
    level 1, we have to incorporate them into the
    flooding process. Thus we replace
    X1 by Y1X1,1
  • ...and we iterate. The geodesic zones of
    influence
  • Y2 of Y1X1,1 inside X2 are
    calculated
  • They provide markers Y2X2,1 etc...
  • The process ends when level k max (f) is
    reached. Then one has
    Ymax f union of the
    basins Ymax f c
    Watershed lines.

64
An example of Watershed by Flooding (I)
2
1
Geodesic skiz of (1) into (2) (in white
lines).
Minima (1), and next level (2).
Initial image.
65
An example of Watershed by Flooding (II)
Level 2, minus the first skiz , and level 3.
Final watershed (The result is
significant in spite of the small number of
gray levels).
Second skiz (note that it extends
the first one).
66
Contents
  • Introduction
  • Erosion and Dilation
  • Opening and Closing
  • Binary Geodesic Operators
  • Numerical Geodesic Operators
  • SKIZ and Watershed
  • Applications

67
Two Examples
Electrophoresis ( S. Beucher) 1-
Delineate the spots, 2- Determine the neighbors.
Highway ( S. Beucher) Delineate the
lanes.
68
Morphological Segmentation Paradigm( S. Beucher,
F. Meyer )
Intelligent Phase
One, or more, images
Function f
Markers M
Pre-processing
Automatic Phase
synthetic function f' ( f, M )
Watershed of f'
Possible Hierarchy
69
Input Variables
  • The watersheds extend the minima of an image as
    far as its topography allows it. One can act on
    these minima
  • - either by means of filtering which
    removes some minima,
  • - or by swamping, which impose their markers
    as new minima.
  • One can also force the segmentation to pass along
    some portions of contours which are known a
    priori (the dotted lines on the road in example
    2). Then the watersheds are conditioned by
    means of an input image where these portions are
    maxima.
  • Finally, a first watershed can generate a new
    image, if we fill its divides with convenient
    values, and create a mosaic image. This new image
    is no longer based on pixels, but on the
    components of a planar graph. One can apply new
    watersheds or swampings, leading to a second
    mosaic image, etc.

70
Minima selection by Filtering
  • As a general rule, images have too many
    minima, and a careless computation of their
    watersheds often leads to a disastrous
    over-segmentation.
  • In order to obtain significant minima, one can
    begin with filtering the images
  • either horizontally by plane alternating
    filters, with or without reconstruction
  • or vertically by closings Rf(fh) of dynamic
    h. In particular, for h1 all the minima are
    extracted.
  • If dealing with maxima, one takes Rf (f - h).

horizontal filtering
vertical filtering
71
Changing the Minima by Swamping
  • The markers may not coincide with the minima of
    f. In that case, they act on f via the swamping
    transformation.
  • The marker image is calculated as
  • Two steps
  • The point-wise minimum between the input image
    and the marker image is computed (f 1) ?
    gRemark f 1 is used to avoid the case where
    two minima to impose belong to the same minimum
    in f.
  • A reconstruction by erosion of (f 1) ? gfrom
    g is performed. R(f 1) ? g(g)

72
Changing the Minima by Swamping Example
73
1st Example Electrophoresis Gels
Problem to segment the spots, and to
characterize the adjacency relations. The
solution for this famous case study is due to S.
Beucher and F. Meyer.
(
(a) Initial image of electrophoresis
(b) Watershed of the initial image
74
Electrophoresis Minima
Criticism the over-segmentation comes from the
excess of minima so we will filter initial
image by a jg (opening followed by closing) of
size 1 before computing the watershed.
(c) Inital image minima
(d) Minima of the filtered image (e)
75
Electrophoresis zones of influence
Criticism the segmentation, now correct,
provides the zones of influence of the spots,
but not their contours. The latter should be
derived from the watershed of the½gradient½.
(e) Hexagonal alternating filter of (a)
(f) Watershed of the filtered image (e)
76
Electrophoresis Watershed of the Gradient (I)
Criticism a few contours are revealed, blurred
in a maze of over-segmentation. Since we know the
significant minima of (e), we can introduce them,
by swamping, as markers in the gradient image (g)
(g) Modulus of the gradient of the filtered
image
(h) Watershed of the gradient (g)
77
Electrophoresis Watershed of the Gradient (II)
Criticism We forgot to mark that the gradient is
zero not only at the centres of the spots, but
also in the background. We must swamp (g) with
the watershed (f).
(i) Swamping of gradient (g) by the minima (d)
(j) Watershed of (i)
78
Electrophoresis Contours
Criticism BRAVO !
(k) (g) Swamped by the union of the minima (d)
and of the watershed(f)
(l) Watershed of (k), superimposed on
the initial image
79
Electrophoresis Edge Effects
Comment We must make an assumption about the
outside of the field . Up to now, we implicitly
assumed it was white, i.e. lighter than all the
pixels in the image. If, on the contrary, we
take a black outside, then the graph no longer
crosses the boundary of the field.
80
Lessons Drawn from the Example
  • In a first analysis, over-segmentation may be
    corrected by filtering, but this approach can
    only suppress minima. If we want to add some new
    ones, or to move some of them, we have to apply
    swamping.
  • An object is individualized when it has a unique
    minimum. The watershed lines of individualized
    objects delineate their zones of influence.
    Therefore they are exclusively located in the
    background, for which they can provide an ideal
    marker.
  • For obtaining the contours of individualized
    objects, we must deal with the watershed of their
    gradients.
  • The outside of the image has always to be chosen
    either as being a minimum or a maximum.
  • ....Finally, a number of situations are far
    from pertaining to that of the previous example,
    as we will see now.

81
Segmentation of Road Lanes (I)
  • Problem Delineate the traffic lanes of a road,
    from a sequence of 450 views taken from a fixed
    camera with a high angle shot.
  • Differences Unlike the previous case
  • - we now start from a sequence of images. How to
    synthesize information?
  • - The segmentation holds on the road only,
    without any distinction between foreground and
    background. Then, how do we build up markers?
  • - The watershed must pass through the white
    dotted lines. How can we introduce this
    constraint?

(a) Image extracted from the initial sequence.
82
Road (II) Synthetic Images
Comment We summarized the whole useful
information in two images (instead of 450 ). One
of them emphasises the static portions, and the
other the moving ones.
(b) Sum S (½fi1 - fi ½ , 1 i 449 ) 449
(a) Sum S ( fi , 1 i 450 ) 450
83
Road (III) Markers
Comment image (b), under threshold, provides a
first set of markers (c) it is completed by the
complement (d) of the road, which marks the
outside (e).
(c) thresholded version of (b)
(d) dilation of (c) by a horizontal segment
whose length increases as it moves down
the image.
(e) difference between (c) and (d). In
white, the four zones to thin.
84
Road (IV) Conditioning
Comment the condition of passing through the
dotted lines demands we build up a function in
which these dotted lines are maxima. It results
in variants (g) and (h).
(f) top hat of image (a).
(g) 3 level function, derived from (e) and from
the filtered restriction of (f) to the
central stripes of (c)
(h) (inversed) geodesic distance function of
the higher level of (g) inside its median level.
The two stripes without dotted white lines have
been added.
85
Road (V) Results
Comment OK for (j). The three level function is
also not such a bad starting point. In both
cases, the digitalization of the watershed
creates slight variations from the dotted lines.
(i) Watershed of the three level function (g)
(j) Watershed of the geodesic distance function
86
Lessons Drawn from the Example
  • For imposing some points or lines on a watershed,
    one must introduce them as maxima in the source
    image. This goal can be achieved by taking their
    geodesic distance function with respect to a
    significant zone of the image. Such an image
    synthesis may viewed as complementary to the
    swamping procedure, which holds on the minima.
  • In the limit, it is possible to concentrate
    information in a three level synthetic image
    based upon the two following conditioning sets
  • - low level markers of the minima,
  • - high level arcs which are imposed to the
    watershed .
  • The median level is a constant value given to
    the rest of the input function.
  • Finally, if the upper level is missing, the
    watershed comes back to a SKIZ of the minima.
  • In sequences taken by a fixed camera without
    zoom, the first two abstracts of the information
    are the means of the images and of their time
    gradients.

87
Summary
  • You have seen
  • Some of the basic operations of mathematical
    morphology.
  • Some examples of where they are useful.
  • Many more exist, which havent been covered
    Leveling, Granulometry, Morphology for graph
    representations, etc.
  • Applying these operations to colour images is
    more complicated, as will be discussed in my next
    talk.

88
Acknowledgements
  • This lecture is based on
  • Jean Serras one week course on Mathematical
    Morphology held at the Paris School of Mines
    (its part of the GEI-Athens European courses, so
    its most probably possible to get money from the
    EU to attend it).
  • Pierre Soilles book.
Write a Comment
User Comments (0)
About PowerShow.com