Edge Detection using Mathematical Morphology - University of
SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders...
Transcript of SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders...
![Page 1: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/1.jpg)
Image Processing
Morphological image
processing
![Page 2: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/2.jpg)
Outline
2
What is Mathematical Morphology?
Background Notions
Introduction to Set Operations on Images
Basic operation
Erosion, Dilation, Opening, Closing, Hit-or-Miss
Algorithms
Morphological operations on gray-level images
![Page 3: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/3.jpg)
Morphology
3
Morphology, in biology, is the study of the size,
shape, and structure of animals, plants, and
micro-organisms and the relationships of their
internal parts.
Morphology, in linguistics, is the study of the
internal construction of words
Mathematical morphology?
![Page 4: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/4.jpg)
Mathematical morphology
4
Mathematical Morphology was founded in the mid-sixties in France
George Matheron and Jean Serra are two founders of mathematical
morphology
Study of geometry of porous media
Mathematical morphology is well established discipline in applied
mathematics and image analysis
International Symposium on Mathematical Morphology
![Page 5: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/5.jpg)
Mathematical morphology
5
The theory for the analysis of spatial structures
Analysis of shapes and form of objects
It is based on set theory, integral geometry and
lattice algebra
Structuring elements
Mathematical morphology framework is used for:
Image filtering (shape simplification, enhancing object
structure,...)
Image segmentation (watersheds)
Image measurements (area, perimeter, granulometry)
Pattern recognition
Texture analysis
![Page 6: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/6.jpg)
Quick Example
Image after segmentation Image after segmentation and
morphological processing
6
![Page 7: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/7.jpg)
7
Morphological Image Processing…
used to extract image components that are
useful in the representation and description of
region shape, such as
boundaries extraction
skeletons
convex hull
morphological filtering
thinning
pruning
![Page 8: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/8.jpg)
Morphological Image Processing
8
“Mathematical Morphology” – as a tool for extracting image
components, that are useful in the representation and description
of region shape.
Morphological image processing (or morphology) describes a
range of image processing techniques that deal with the shape
(or morphology) of features in an image
Morphological operations are typically applied to remove
imperfections introduced during segmentation, and typically
operate on bi-level images
The language of mathematical morphology is – Set theory.
Unified and powerful approach to numerous image processing
problems.
![Page 9: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/9.jpg)
9
Z2 and Z3
set in mathematic morphology represent
objects in an image
binary image (0 = white, 1 = black) : the element
of the set is the coordinates (x,y) of pixel belong
to the object Z2
gray-scaled image : the element of the set is
the coordinates (x,y) of pixel belong to the object
and the gray levels Z3
![Page 10: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/10.jpg)
Basic Concepts in Set Theory
Subset
Union
Intersection
disjoint / mutually exclusive
Complement
Difference
Reflection
Translation
![Page 11: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/11.jpg)
11
Basic Set Theory
![Page 12: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/12.jpg)
12
Reflection and Translation
} ,|{ˆ Bfor bbwwB
} ,|{)( Afor azaccA z
![Page 13: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/13.jpg)
Logic Operations Involving
Binary Pixels and Images
13
The principal logic operations used in image processing
are: AND, OR, NOT (COMPLEMENT).
These operations are functionally complete.
Logic operations are preformed on a pixel by pixel basis between
corresponding pixels (bitwise).
Other important logic operations :
XOR (exclusive OR), NAND (NOT-AND)
Logic operations are just a private case for a binary set operations, such :
AND – Intersection , OR – Union, NOT-Complement.
![Page 14: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/14.jpg)
14
Example
![Page 15: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/15.jpg)
Structuring Element (SE)
15
Small set used to probe the image under study
For each SE, define an origin:
the origin of the SE is in point p
The shape and size must be adapted to geometric
properties for the objects
![Page 16: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/16.jpg)
SE can be described in many different ways!
Information needed:
Position of origin for SE
Position of elements belonging to SE
16
Structuring Element (SE)
OBS!
Matlab assumes that the center of the structuring elements is its origin
![Page 17: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/17.jpg)
Structuring Elements, Hits &
Fits
B
AC
Structuring Element
Fit: All on pixels in the
structuring element cover
on pixels in the image [A]
Hit: Any on pixel in the
structuring element covers
an on pixel in the image [B]
All morphological processing operations are based
on these simple ideas 17
![Page 18: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/18.jpg)
Fundamental Operations
Fundamentally morphological image
processing is very like spatial filtering
The structuring element is moved across
every pixel in the original image to give a
pixel in a new processed image
The value of this new pixel depends on the
operation performed18
![Page 19: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/19.jpg)
Five binary morphological operators
⊖ Erosion
⊕ Dilation
◦ Opening
• Closing
⊗ Hit-or-Miss transform19
![Page 20: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/20.jpg)
⊖Erosion
Does the structuring element fit the set?
Erosion of a set X by structuring element B,
: all x in X such that B is in X when
origin of B is x
Gonzalez-Woods:
Shrink the object
20
![Page 21: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/21.jpg)
Erosion
otherwise 0
fits if 1),(
fsyxg
Erosion of image f by structuring element s is
given by f s
The structuring element s is positioned with
its origin at (x, y) and the new pixel value is
determined using the rule:
21
![Page 22: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/22.jpg)
Erosion Example
Original image Erosion by 3*3
square structuring
element
Erosion by 5*5
square structuring
element
22
![Page 23: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/23.jpg)
Erosion Example 2
Original
image
After erosion
with a disc of
radius 10
After erosion
with a disc of
radius 20
After erosion
with a disc of
radius 5
23
![Page 24: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/24.jpg)
Erosion can split apart
joined objects
Erosion can strip away
extrusion
Erosion shrinks objects
How is Erosion used?
24
![Page 25: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/25.jpg)
Does the structuring element hit the set?
Dilation of a set X by structuring element B,
: all x in X such that the reflection of B
hits X when origin of B is x
Gonzalez-Woods:
Enlarge the object
⊕ Dilation
25
![Page 26: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/26.jpg)
Dilation of image f by structuring element s is
given by f s
The structuring element s is positioned with
its origin at (x, y) and the new pixel value is
determined using the rule:
⊕ Dilation
otherwise 0
hits if 1),(
fsyxg
26
![Page 27: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/27.jpg)
⊕ Dilation Example
Original image Dilation by 3*3
square structuring
element
Dilation by 5*5
square structuring
element
27
![Page 28: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/28.jpg)
Dilation Example
Structuring element
Original image After dilation
28
![Page 29: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/29.jpg)
Dilation can repair
breaks
Dilation can repair
intrusions
Dilation enlarges objects
How is Dilation used?
29
![Page 30: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/30.jpg)
⊖ Erosion - properties
It is commutative
It is increasing, i.e.,
if A ⊂ C, then A ⊖ B ⊂ C ⊖ B
If the origin belongs to the structuring element B,
then the erosion is anti-extensive, i.e., A ⊖ B ⊂ A
It is distributive over set intersection, i.e.,
(A1 ∩ A2) ⊖ B = (A1 ⊖ B) ∩ (A2 ⊖ B)
It is translation invariant
30
![Page 31: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/31.jpg)
⊕ Dilation - properties
It is commutative
It is increasing, i.e.,
if A ⊂ C, then A ⊕ B ⊂ C ⊕ B
If the origin belongs to the structuring element B,
then it is extensive A ⊂ A ⊕ B
It is distributive over set union, i.e.,
(A1 ∪ A2) ⊕ B = (A1 ⊕ B) ∪ (A2 ⊕ B)
It is translation invariant
31
![Page 32: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/32.jpg)
Erosion - Dilation duality
Erosion and dilation are dual with respect to complementation and
reflection
32
![Page 33: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/33.jpg)
Compound Operations
More interesting morphological operations
can be performed by performing
combinations of erosions and dilations
The most widely used of these compound
operations are:
Opening
Closing
33
![Page 34: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/34.jpg)
The opening of image f by structuring
element s, denoted f ○ s is simply an erosion
followed by a dilation
f ○ s = (f s) s
◦ Opening
Original shape After erosion After dilation
(opening) 34
![Page 35: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/35.jpg)
◦ Opening
35
erosion followed by dilation, denoted ∘
eliminates protrusions
breaks necks
smoothes contour
BBABA )(
![Page 36: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/36.jpg)
◦ Opening
erosion followed by dilation, denoted ∘
eliminates protrusions
breaks necks
smoothes contour
36
BBABA )(
![Page 37: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/37.jpg)
◦ Opening Example
Original
Image
Image
After
Opening
37
![Page 38: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/38.jpg)
38
◦ Opening
BBABA )(})(|){( ABBBA zz
![Page 39: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/39.jpg)
The closing of image f by structuring element
s, denoted f • s is simply a dilation followed by
an erosion
f • s = (f s)s
• Closing
Original shape After dilation After erosion
(closing) 39
![Page 40: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/40.jpg)
• Closing
dilation followed by erosion, denoted •
smooth contour
fuse narrow breaks and long thin gulfs
eliminate small holes
fill gaps in the contour
40
BBABA )(
![Page 41: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/41.jpg)
41
• Closing
BBABA )(
![Page 42: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/42.jpg)
42
Properties
Opening(i) AB is a subset (subimage) of A(ii) If C is a subset of D, then C B is a subset of D B(iii) (A B) B = A B
Closing(i) A is a subset (subimage) of AB(ii) If C is a subset of D, then C B is a subset of D B(iii) (A B) B = A B
Note: repeated openings/closings has no effect!
![Page 43: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/43.jpg)
• Closing Example
Original
Image
Image
After
Closing
43
![Page 44: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/44.jpg)
Morphological Processing
Example: filtering
erosion
opening
opening
+ dilation
opening + closing
![Page 45: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/45.jpg)
Morphological Algorithms
Using the simple technique we have looked at
so far we can begin to consider some more
interesting morphological algorithms
Hit-or-miss transform
Boundary extraction
Region filling
Extraction of connected components
Thinning/thickening
Skeletonisation
Pruning
45
![Page 46: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/46.jpg)
⊗ Hit-or-miss transformation
The hit-or-miss transform is a general binary
morphological operation that can be used to look
for particular patterns of foreground and
background pixels in an image.
The hit-and-miss transform is a basic tool for
shape detection.
To detect a shape:
Hit object
Miss background
46
![Page 47: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/47.jpg)
⊗ Hit-or-miss transformation
The structural elements (SE) used for Hit-or-
miss transforms are an extension to the ones
used with dilation, erosion etc.
The SE contain both foreground and background
pixels, rather than just foreground pixels, i.e. both
ones and zeros.
If the SE covers something which matches
the content of the SE it is a hit, otherwise it is
a miss
47
)()()( 21 BABABX
![Page 48: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/48.jpg)
⊗ Hit-or-miss transformation
Transformation that involves two structuring
elements
First has to fit with the object while,
simultaneously, the second has to fit the
background
First has to hit the object while, simultaneously,
second has to miss it
A ⊗ B = (A ⊖ B1) ∩ (AC ⊖ B2)
Composite SE B = (B1,B2): Object part (B1) and
background (B2)48
![Page 49: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/49.jpg)
⊗ Hit-or-miss transformation
Alternative:
A ⊗ B = (A ⊖ B1) ∩ (AC ⊖ B2)
= (A ⊖ B1) ∩ (A ⊕ ˆB2)C
= (A ⊖ B1) \ (A ⊕ ˆB2)
B1 and B2 share the same origin and are
disjoint sets
49
![Page 50: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/50.jpg)
⊗ Hit-or-miss transformation
50
Structuring
elements
![Page 51: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/51.jpg)
Extracting the boundary (or outline) of an object is often
extremely useful
The boundary can be given simply as
β(A) = A – (AB)
Boundary Extraction
51
![Page 52: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/52.jpg)
Boundary Extraction Example
Original Image Extracted Boundary
A simple image and the result of performing
boundary extraction using a square 3*3
structuring element
52
![Page 53: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/53.jpg)
Given a pixel inside a boundary, region filling
attempts to fill that boundary with object
pixels (1s)
Region Filling
Given a point inside
here, can we fill the
whole circle?
53
![Page 54: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/54.jpg)
The key equation for region filling is
Where X0 is simply the starting point inside
the boundary, B is a simple structuring
element and Ac is the complement of A
This equation is applied repeatedly until Xk is
equal to Xk-1
Region Filling
.....3,2,1 )( 1 kABXX c
kk
54
![Page 55: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/55.jpg)
Region Filling Step By Step
![Page 56: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/56.jpg)
Region Filling Example
Original Image One Region
Filled
All Regions
Filled
56
![Page 57: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/57.jpg)
57
Extraction of connected
components
.....3,2,1 )( 1 kABXX kk
![Page 58: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/58.jpg)
58
Example
![Page 59: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/59.jpg)
Convex hull
i
iDAC
4
1)(
,...3,2,1 and 4,3,2,1 )( kiABXX ii
k
i
k
A set A is said to
be convex if the
straight line
segment joining
any two points in
A lies entirely
within A.
59
![Page 60: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/60.jpg)
Thinning
The thinning of a set A by a structuring element B, can
be defined by terms of the hit-and-miss transform:
A more useful expression for thinning A symmetrically is
based on a sequence of structuring elements:
{B}={B1, B2, B3, …, Bn}
Where Bi is a rotated version of Bi-1. Using this concept
we define thinning by a sequence of structuring
elements:
![Page 61: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/61.jpg)
Thinning cont…
The process is to thin by one pass with B1 ,
then thin the result with one pass with B2, and
so on until A is thinned with one pass with Bn.
The entire process is repeated until no further
changes occur.
Each pass is preformed using the equation:
![Page 62: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/62.jpg)
62
Thinning
cBAA
BAABA
)(
)(
![Page 63: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/63.jpg)
Thickening
Thickening is a morphological dual of
thinning.
Definition of thickening .
As in thinning, thickening can be defined as a
sequential operation:
the structuring elements used for thickening
have the same form as in thinning, but with
all 1’s and 0’s interchanged.
![Page 64: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/64.jpg)
Thickening - cont
A separate algorithm for thickening is often used in practice, Instead the usual procedure is to thin the background of the set in question and then complement the result.
In other words, to thicken a set A, we form C=Ac , thin C and than form Cc.
depending on the nature of A, this procedure may result in some disconnected points. Therefore thickening by this procedure usually require a simple post-processing step to remove disconnected points.
![Page 65: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/65.jpg)
Thickening- example
We will notice in the next example that the
thinned background forms a boundary for the
thickening process, this feature does not
occur in the direct implementation of
thickening
This is one of the reasons for using
background thinning to accomplish
thickening.
![Page 66: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/66.jpg)
Thickening example
![Page 67: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/67.jpg)
Thinning and Thickening
67
![Page 68: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/68.jpg)
Skeleton
The notion of a skeleton S(A) of a set A is
intuitively defined, we deduce from this figure
that:
a) If z is a point of S(A) and (D)z is the largest disk
centered in z and contained in A (one cannot
find a larger disk that fulfils this terms) – this
disk is called “maximum disk”.
b) The disk (D)z touches the boundary of A at two
or more different places.
![Page 69: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/69.jpg)
Skeleton The skeleton of A is defined by terms of erosions and
openings:
with
Where B is the structuring element and indicates
k successive erosions of A:
k times, and K is the last iterative step before A erodes to an empty
set, in other words:
in conclusion S(A) can be obtained as the union of
skeleton subsets Sk(A).
![Page 70: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/70.jpg)
BkBAkBAASk )()()(
70
Skeletons
K
kk ASAS
0
)()(
})(|max{ kBAkK
))((0
kBASA k
K
k
![Page 71: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/71.jpg)
71
![Page 72: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/72.jpg)
Skeleton
A can be also reconstructed from subsets
Sk(A) by using the equation:
Where denotes k successive
dilations of Sk(A) that is:
![Page 73: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/73.jpg)
73
Pruning
}{1 BAX
AHXX )( 23
314 XXX
)( 1
8
12
k
kBXX
H = 3x3 structuring element of 1’s
![Page 74: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/74.jpg)
74
![Page 75: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/75.jpg)
75
![Page 76: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/76.jpg)
76
![Page 77: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/77.jpg)
77
![Page 78: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/78.jpg)
Gray-Scale Images
In gray scale images on the contrary to binary
images we deal with digital image functions of
the form f(x,y) as an input image and b(x,y) as a
structuring element.
(x,y) are integers from Z*Z that represent a
coordinates in the image.
f(x,y) and b(x,y) are functions that assign gray
level value to each distinct pair of coordinates.
For example the domain of gray values can be
0-255, whereas 0 – is black, 255- is white.
![Page 79: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/79.jpg)
Gray-Scale Images
![Page 80: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/80.jpg)
Dilation – Gray-Scale
Equation for gray-scale dilation is:
Df and Db are domains of f and b.
The condition that (s-x),(t-y) need to be in the domain of f and x,y in the domain of b, is analogous to the condition in the binary definition of dilation, where the two sets need to overlap by at least one element.
![Page 81: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/81.jpg)
Dilation – Gray-Scale (cont)
We will illustrate the previous equation in terms of
1-D. and we will receive an equation for 1 variable:
The requirements the (s-x) is in the domain of f and x is in the domain of b imply that f and b overlap by at least one element.
Unlike the binary case, f, rather than the structuring element b is shifted.
Conceptually f sliding by b is really not different than b sliding by f.
![Page 82: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/82.jpg)
Dilation – Gray-Scale (cont)
The general effects of performing dilation on
a gray scale image is twofold:
1. If all the values of the structuring elements are
positive than the output image tends to be
brighter than the input.
2. Dark details either are reduced or elimanted,
depending on how their values and shape relate
to the structuring element used for dilation
![Page 83: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/83.jpg)
Dilation – Gray-Scale example
![Page 84: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/84.jpg)
Erosion – Gray-Scale
Gray-scale erosion is defined as:
The condition that (s+x),(t+y) have to be in the
domain of f, and x,y have to be in the domain of
b, is completely analogous to the condition in the
binary definition of erosion, where the structuring
element has to be completely combined by the
set being eroded.
The same as in erosion we illustrate with 1-D
function
![Page 85: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/85.jpg)
Erosion– Gray-Scale example 1
![Page 86: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/86.jpg)
Erosion– Gray-Scale (cont)
General effect of performing an erosion in grayscale
images:
1. If all elements of the structuring element are positive, the output
image tends to be darker than the input image.
2. The effect of bright details in the input image that are smaller in
area than the structuring element is reduced, with the degree of
reduction being determined by the grayscale values surrounding
by the bright detail and by shape and amplitude values of the
structuring element itself.
Similar to binary image grayscale erosion and dilation
are duals with respect to function complementation and
reflection.
![Page 87: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/87.jpg)
Dilation & Erosion– Gray-Scale
“flat-top” structuring element in the shape of a parallelepiped of unit
height and size 5x5 pixels
87
![Page 88: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/88.jpg)
Opening And Closing Similar to the binary algorithms
Opening –
Closing –
In the opening of a gray-scale image, we
remove small light details, while relatively
undisturbed overall gray levels and larger bright
features
In the closing of a gray-scale image, we remove
small dark details, while relatively undisturbed
overall gray levels and larger dark features
![Page 89: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/89.jpg)
Opening And Closing
Opening a G-S picture is describable as
pushing object B under the scan-line graph,
while traversing the graph according the
curvature of B
![Page 90: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/90.jpg)
Opening And Closing
Closing a G-S picture is describable as pushing object B
on top of the scan-line graph, while traversing the graph
according the curvature of B
The peaks are usually remains in their original form
![Page 91: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/91.jpg)
Opening And Closing
![Page 92: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/92.jpg)
Applications of G-S Morphology
Morphological smoothing Perform opening followed by a closing
The net result of these two operations is to remove or attenuate both bright and dark artifacts or noise.
Morphological gradient Dilation and erosion are use to compute the
morphological gradient of an image, denoted g:
It uses to highlights sharp gray-level transitions in the input image.
Obtained using symmetrical structuring elements tend to depend less on edge directionality.
![Page 93: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/93.jpg)
Applications of G-S Morphology
Morphological smoothing
Morphological gradient
![Page 94: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/94.jpg)
Applications of G-S Morphology
Top-hat transformation Denoted h, is defined as:
Cylindrical or parallelepiped structuring element functionwith a flat top.
Useful for enhancing detail in the presence of shading.
Textural segmentation The objective is to find the boundary between different
image regions based on their textural content.
Close the input image by using successively larger
structuring elements.
Then, single opening is preformed ,and finally a simple threshold that yields the boundary between the textural regions.
![Page 95: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/95.jpg)
Applications of G-S Morphology
Top-hat transformation
Textural segmentation
![Page 96: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/96.jpg)
Applications of G-S Morphology
Granulometry Granulometry is a field that deals principally with
determining the size distribution of particles in an image.
Because the particles are lighter than the background, we can use a morphological approach to determine size distribution. To construct at the end a histogramof it.
Based on the idea that opening operations of particular size have the most effect on regions of the input image that contain particles of similar size.
This type of processing is useful for describing regions with a predominant particle-like character.
![Page 97: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/97.jpg)
Applications of G-S Morphology
Granulometry
![Page 98: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/98.jpg)
Matlab examples
98
%%dilation
originalBW = imread('text.png');
se = strel('line',11,90);
dilatedBW = imdilate(originalBW,se);
figure, imshow(originalBW), figure,
imshow(dilatedBW)
originalI = imread('cameraman.tif');
se = strel('ball',5,5);
dilatedI = imdilate(originalI,se);
figure, imshow(originalI), figure, imshow(dilatedI)
se1 = strel('line',3,0);
se2 = strel('line',3,90);
composition = imdilate(1,[se1 se2],'full');
![Page 99: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/99.jpg)
99
%%erosion
originalBW = imread('text.png');
se = strel('line',11,90);
erodedBW = imerode(originalBW,se);
figure, imshow(originalBW)
figure, imshow(erodedBW)
originalI = imread('cameraman.tif');
se = strel('ball',5,5);
erodedI = imerode(originalI,se);
figure, imshow(originalI), figure, imshow(erodedI)
![Page 100: SVD and digital image processing - TFE-Moodle 2 · George Matheron and Jean Serra are two founders of mathematical morphology Study of geometry of porous media Mathematical morphology](https://reader036.fdocuments.us/reader036/viewer/2022070913/5fb4acb9ef4bf108a92ff99a/html5/thumbnails/100.jpg)
100
%%closing
originalBW = imread('circles.png');
figure, imshow(originalBW);
se = strel('disk',10);
closeBW = imclose(originalBW,se);
figure, imshow(closeBW);
%%opening
original = imread('snowflakes.png');
se = strel('disk',5);
afterOpening = imopen(original,se);
figure, imshow(original), figure, imshow(afterOpening)
%%HMT
bw=[0 0 0 0 0 0;0 0 1 1 0 0;0 1 1 1 1 0
0 1 1 1 1 0;0 0 1 1 0 0;0 0 1 0 0 0];
interval = [0 -1 -1;1 1 -1;0 1 0];
bw2 = bwhitmiss(bw,interval)