![Page 1: Morphological Image Processing Francesca Pizzorni Ferrarese 07/04/2010](https://reader034.vdocuments.us/reader034/viewer/2022051211/5542eb5a497959361e8c7c2c/html5/thumbnails/1.jpg)
Morphological Image Processing
Francesca Pizzorni Ferrarese07/04/2010
![Page 2: Morphological Image Processing Francesca Pizzorni Ferrarese 07/04/2010](https://reader034.vdocuments.us/reader034/viewer/2022051211/5542eb5a497959361e8c7c2c/html5/thumbnails/2.jpg)
Introduction
2
Morphology deals with form and Structure of animals and plants
Mathematical Morphology deals with set theory
Sets in Mathematical Morphology represents objects in an Image
![Page 3: Morphological Image Processing Francesca Pizzorni Ferrarese 07/04/2010](https://reader034.vdocuments.us/reader034/viewer/2022051211/5542eb5a497959361e8c7c2c/html5/thumbnails/3.jpg)
Mathematic Morphology
3
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 4: Morphological Image Processing Francesca Pizzorni Ferrarese 07/04/2010](https://reader034.vdocuments.us/reader034/viewer/2022051211/5542eb5a497959361e8c7c2c/html5/thumbnails/4.jpg)
Mathematic Morphology
4
mathematical framework used for: pre-processing
noise filtering, shape simplification, ... enhancing object structure
skeletonization, convex hull... Segmentation
watershed,… quantitative description
area, perimeter, ...
![Page 5: Morphological Image Processing Francesca Pizzorni Ferrarese 07/04/2010](https://reader034.vdocuments.us/reader034/viewer/2022051211/5542eb5a497959361e8c7c2c/html5/thumbnails/5.jpg)
Z2 and Z3
5
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
X axis
Y axisY axis
X axis Z axis
![Page 6: Morphological Image Processing Francesca Pizzorni Ferrarese 07/04/2010](https://reader034.vdocuments.us/reader034/viewer/2022051211/5542eb5a497959361e8c7c2c/html5/thumbnails/6.jpg)
Basic Set Operators
6
Set operators Denotations
A Subset B A B
Union of A and B C= A B
Intersection of A and B C = A B
Disjoint A B =
Complement of A Ac ={ w | w A}
Difference of A and B A-B = {w | w A, w B }
Reflection of A Â = { w | w = -a for a A}
Translation of set A by point z(z1,z2) (A)z = { c | c = a + z, for a A}
![Page 7: Morphological Image Processing Francesca Pizzorni Ferrarese 07/04/2010](https://reader034.vdocuments.us/reader034/viewer/2022051211/5542eb5a497959361e8c7c2c/html5/thumbnails/7.jpg)
Basic Set Theory
7
![Page 8: Morphological Image Processing Francesca Pizzorni Ferrarese 07/04/2010](https://reader034.vdocuments.us/reader034/viewer/2022051211/5542eb5a497959361e8c7c2c/html5/thumbnails/8.jpg)
Reflection and Translation
8
€
ˆ B = {w ∈ E 2 : w = −b, for b∈ B}
€
(A)z = {c ∈ E 2 : c = a + z, for a∈ A}
![Page 9: Morphological Image Processing Francesca Pizzorni Ferrarese 07/04/2010](https://reader034.vdocuments.us/reader034/viewer/2022051211/5542eb5a497959361e8c7c2c/html5/thumbnails/9.jpg)
Logic Operations
9
![Page 10: Morphological Image Processing Francesca Pizzorni Ferrarese 07/04/2010](https://reader034.vdocuments.us/reader034/viewer/2022051211/5542eb5a497959361e8c7c2c/html5/thumbnails/10.jpg)
Example
10
![Page 11: Morphological Image Processing Francesca Pizzorni Ferrarese 07/04/2010](https://reader034.vdocuments.us/reader034/viewer/2022051211/5542eb5a497959361e8c7c2c/html5/thumbnails/11.jpg)
Structuring element (SE)
11
small set to probe the image under study for each SE, define origo shape and size must be adapted to geometricproperties for the objects
![Page 12: Morphological Image Processing Francesca Pizzorni Ferrarese 07/04/2010](https://reader034.vdocuments.us/reader034/viewer/2022051211/5542eb5a497959361e8c7c2c/html5/thumbnails/12.jpg)
Basic idea
12
in parallel for each pixel in binary image: check if SE is ”satisfied” output pixel is set to 0 or 1 depending on used
operation
![Page 13: Morphological Image Processing Francesca Pizzorni Ferrarese 07/04/2010](https://reader034.vdocuments.us/reader034/viewer/2022051211/5542eb5a497959361e8c7c2c/html5/thumbnails/13.jpg)
How to describe SE
13
many different ways! information needed:
position of origo for SE positions of elements belonging to SE
![Page 14: Morphological Image Processing Francesca Pizzorni Ferrarese 07/04/2010](https://reader034.vdocuments.us/reader034/viewer/2022051211/5542eb5a497959361e8c7c2c/html5/thumbnails/14.jpg)
Basic morphological operations
14
Erosion
Dilation
combine to Opening object Closening background
keep general shape but smooth with respect to
![Page 15: Morphological Image Processing Francesca Pizzorni Ferrarese 07/04/2010](https://reader034.vdocuments.us/reader034/viewer/2022051211/5542eb5a497959361e8c7c2c/html5/thumbnails/15.jpg)
Erosion
15
Does the structuring element fit the set? Erosion of a set A by structuring element B: all
z in A such that B is in A when origin of B=z
shrink the object
€
A − B = {z ∈ E 2 : (B)z ⊆ A}
![Page 16: Morphological Image Processing Francesca Pizzorni Ferrarese 07/04/2010](https://reader034.vdocuments.us/reader034/viewer/2022051211/5542eb5a497959361e8c7c2c/html5/thumbnails/16.jpg)
Erosion
16
![Page 17: Morphological Image Processing Francesca Pizzorni Ferrarese 07/04/2010](https://reader034.vdocuments.us/reader034/viewer/2022051211/5542eb5a497959361e8c7c2c/html5/thumbnails/17.jpg)
Erosion
17
Properties L’erosione non è commutativa
L’erosione è associativa quando l’elemento strutturante è decomponibile intermini di dilatazioni:
Se l’elemento strutturante contiene l’origine (O ∈ B) l’erosione è una trasformazione antiestensiva: l’insieme eroso è contenuto nell’insieme
L’erosione è una trasformazione crescente
![Page 18: Morphological Image Processing Francesca Pizzorni Ferrarese 07/04/2010](https://reader034.vdocuments.us/reader034/viewer/2022051211/5542eb5a497959361e8c7c2c/html5/thumbnails/18.jpg)
Erosion
18
![Page 19: Morphological Image Processing Francesca Pizzorni Ferrarese 07/04/2010](https://reader034.vdocuments.us/reader034/viewer/2022051211/5542eb5a497959361e8c7c2c/html5/thumbnails/19.jpg)
Erosion
19
![Page 20: Morphological Image Processing Francesca Pizzorni Ferrarese 07/04/2010](https://reader034.vdocuments.us/reader034/viewer/2022051211/5542eb5a497959361e8c7c2c/html5/thumbnails/20.jpg)
Erosion Consideriamo ora l’immagine binaria seguente:
A causa del valore troppo elevato della soglia alcuni oggetti che dovrebbero essere separati risultano connessi. Ciò può introdurre degli errori nelle elaborazioni successive (ad esempio, nel conteggio del numero di oggetti presenti nell’immagine).
20
![Page 21: Morphological Image Processing Francesca Pizzorni Ferrarese 07/04/2010](https://reader034.vdocuments.us/reader034/viewer/2022051211/5542eb5a497959361e8c7c2c/html5/thumbnails/21.jpg)
Erosion
21
![Page 22: Morphological Image Processing Francesca Pizzorni Ferrarese 07/04/2010](https://reader034.vdocuments.us/reader034/viewer/2022051211/5542eb5a497959361e8c7c2c/html5/thumbnails/22.jpg)
Dilation
22
Does the structuring element hit the set? Dilation of a set A by structuring element B: all
z in A such that B hits A when origin of B=z
grow the object
}ˆ{ ΦA)Bz|(BA z
![Page 23: Morphological Image Processing Francesca Pizzorni Ferrarese 07/04/2010](https://reader034.vdocuments.us/reader034/viewer/2022051211/5542eb5a497959361e8c7c2c/html5/thumbnails/23.jpg)
Dilation
23
![Page 24: Morphological Image Processing Francesca Pizzorni Ferrarese 07/04/2010](https://reader034.vdocuments.us/reader034/viewer/2022051211/5542eb5a497959361e8c7c2c/html5/thumbnails/24.jpg)
Dilation Properties La dilatazione è commutativa
A ⊕ B = B ⊕ A La dilatazione è associativa
A ⊕ (B ⊕ C) = (A ⊕ B) ⊕ C Se l’elemento strutturante contiene l’origine
(O ∈ B) la dilatazione è una trasformazione estensiva: l’insieme originario è contenuto nell’insieme dilatato (A ⊆ A ⊕ B )
La dilatazione è una trasformazione crescente A ⊆ C ⇒ A ⊕ B ⊆ C ⊕ B
24
![Page 25: Morphological Image Processing Francesca Pizzorni Ferrarese 07/04/2010](https://reader034.vdocuments.us/reader034/viewer/2022051211/5542eb5a497959361e8c7c2c/html5/thumbnails/25.jpg)
Dilation
25
![Page 26: Morphological Image Processing Francesca Pizzorni Ferrarese 07/04/2010](https://reader034.vdocuments.us/reader034/viewer/2022051211/5542eb5a497959361e8c7c2c/html5/thumbnails/26.jpg)
Dilation
26
![Page 27: Morphological Image Processing Francesca Pizzorni Ferrarese 07/04/2010](https://reader034.vdocuments.us/reader034/viewer/2022051211/5542eb5a497959361e8c7c2c/html5/thumbnails/27.jpg)
Dilation
27
Supponiamo ora di binarizzare l’immagine seguente utilizzando una soglia troppo bassa:
A causa del valore troppo basso di soglia l’oggetto presenta delle lacune
![Page 28: Morphological Image Processing Francesca Pizzorni Ferrarese 07/04/2010](https://reader034.vdocuments.us/reader034/viewer/2022051211/5542eb5a497959361e8c7c2c/html5/thumbnails/28.jpg)
Dilation : Bridging gaps
28
![Page 29: Morphological Image Processing Francesca Pizzorni Ferrarese 07/04/2010](https://reader034.vdocuments.us/reader034/viewer/2022051211/5542eb5a497959361e8c7c2c/html5/thumbnails/29.jpg)
Usefulness
29
Erosion Removal of structures of certain shape and size,
given by SE Dilation
Filling of holes of certain shape and size, given by SE
![Page 30: Morphological Image Processing Francesca Pizzorni Ferrarese 07/04/2010](https://reader034.vdocuments.us/reader034/viewer/2022051211/5542eb5a497959361e8c7c2c/html5/thumbnails/30.jpg)
Combining erosion and dilation
30
WANTED: remove structures / fill holes without affecting remaining parts
SOLUTION: combine erosion and dilation (using same SE)
![Page 31: Morphological Image Processing Francesca Pizzorni Ferrarese 07/04/2010](https://reader034.vdocuments.us/reader034/viewer/2022051211/5542eb5a497959361e8c7c2c/html5/thumbnails/31.jpg)
Erosion : eliminating irrelevant detail
31structuring element B = 13x13 pixels of gray level 1
![Page 32: Morphological Image Processing Francesca Pizzorni Ferrarese 07/04/2010](https://reader034.vdocuments.us/reader034/viewer/2022051211/5542eb5a497959361e8c7c2c/html5/thumbnails/32.jpg)
Dilation: filling Infine, la dilatazione viene usata insieme agli
operatori logici per eseguire operazioni morfologiche più complesse. Un esempio è l’operazione di filling, che ricostruisce
le regioni associate agli oggetti (immagine binaria Io) “riempiendo” i contorni estratti mediante un edge detector. Supponendo di aver estratto i contorni (immagine binaria IB) e di conoscere almeno un pixel appartenente all’oggetto (immagine binaria X0), è possibile ricostruire l’oggetto calcolando iterativamente la relazione:
dove con B si è indicato l’elemento strutturante
32
![Page 33: Morphological Image Processing Francesca Pizzorni Ferrarese 07/04/2010](https://reader034.vdocuments.us/reader034/viewer/2022051211/5542eb5a497959361e8c7c2c/html5/thumbnails/33.jpg)
Dilation: filling (cont.) Quando il calcolo della relazione converge (Xn+1 =
Xn) si può ottenere Io dalla relazione: Io = (Xn) OR (IB)
33
![Page 34: Morphological Image Processing Francesca Pizzorni Ferrarese 07/04/2010](https://reader034.vdocuments.us/reader034/viewer/2022051211/5542eb5a497959361e8c7c2c/html5/thumbnails/34.jpg)
Relazione di dualità fra erosione e dilatazione Detto In generale vale che
34
![Page 35: Morphological Image Processing Francesca Pizzorni Ferrarese 07/04/2010](https://reader034.vdocuments.us/reader034/viewer/2022051211/5542eb5a497959361e8c7c2c/html5/thumbnails/35.jpg)
Relazione di dualità fra erosione e dilatazione Se B è simmetrico
quindi la dilatazione dell’oggetto è “equivalente” all’erosione dello sfondo e l’erosione dell’oggetto è “equivalente” alla dilatazione dello sfondo. Le operazioni di erosione e dilatazione per uno stesso
elemento strutturante possonoessere impiegate in sequenza al fine di eliminare dall’immagine binaria le parti aventiforma “diversa” da quella dell’elemento strutturante senza distorcere le parti cheinvece vengono mantenute.
35
![Page 36: Morphological Image Processing Francesca Pizzorni Ferrarese 07/04/2010](https://reader034.vdocuments.us/reader034/viewer/2022051211/5542eb5a497959361e8c7c2c/html5/thumbnails/36.jpg)
Opening
36
Erosion followed by dilation, denoted ∘
eliminates protrusions breaks necks smoothes contour
BBABA )(
![Page 37: Morphological Image Processing Francesca Pizzorni Ferrarese 07/04/2010](https://reader034.vdocuments.us/reader034/viewer/2022051211/5542eb5a497959361e8c7c2c/html5/thumbnails/37.jpg)
Opening
37
![Page 38: Morphological Image Processing Francesca Pizzorni Ferrarese 07/04/2010](https://reader034.vdocuments.us/reader034/viewer/2022051211/5542eb5a497959361e8c7c2c/html5/thumbnails/38.jpg)
Opening
38
![Page 39: Morphological Image Processing Francesca Pizzorni Ferrarese 07/04/2010](https://reader034.vdocuments.us/reader034/viewer/2022051211/5542eb5a497959361e8c7c2c/html5/thumbnails/39.jpg)
Closing
39
dilation followed by erosion, denoted •
smooth contour fuse narrow breaks and long thin gulfs eliminate small holes fill gaps in the contour
BBABA )(
![Page 40: Morphological Image Processing Francesca Pizzorni Ferrarese 07/04/2010](https://reader034.vdocuments.us/reader034/viewer/2022051211/5542eb5a497959361e8c7c2c/html5/thumbnails/40.jpg)
Closing
40
![Page 41: Morphological Image Processing Francesca Pizzorni Ferrarese 07/04/2010](https://reader034.vdocuments.us/reader034/viewer/2022051211/5542eb5a497959361e8c7c2c/html5/thumbnails/41.jpg)
Closing
41
![Page 42: Morphological Image Processing Francesca Pizzorni Ferrarese 07/04/2010](https://reader034.vdocuments.us/reader034/viewer/2022051211/5542eb5a497959361e8c7c2c/html5/thumbnails/42.jpg)
Properties
42
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: Morphological Image Processing Francesca Pizzorni Ferrarese 07/04/2010](https://reader034.vdocuments.us/reader034/viewer/2022051211/5542eb5a497959361e8c7c2c/html5/thumbnails/43.jpg)
Duality
43
Opening and closing are dual with respect to complementation and reflection
Possiamo sfruttare la dualità per comprendere l’effetto dell’operazione di closing. Poichè il closing dell’oggetto è “equivalente” all’opening dello sfondo, l’operatore di closing esegue il “matching” fra l’elemento strutturante (o il suo riflesso) e le parti dello sfondo, preservando quelle uguali all’elemento strutturante (o al suo riflesso) ed eliminando (cioè annettendo all’oggetto) quelle diverse. Il sostanza l’oggetto viene “dilatato” annettendo le parti dello sfondo diverse da B ( o da ).
€
(A • B)c = (Ac o ˆ B )
€
ˆ B
![Page 44: Morphological Image Processing Francesca Pizzorni Ferrarese 07/04/2010](https://reader034.vdocuments.us/reader034/viewer/2022051211/5542eb5a497959361e8c7c2c/html5/thumbnails/44.jpg)
44
![Page 45: Morphological Image Processing Francesca Pizzorni Ferrarese 07/04/2010](https://reader034.vdocuments.us/reader034/viewer/2022051211/5542eb5a497959361e8c7c2c/html5/thumbnails/45.jpg)
Usefulness: open & close
45
![Page 46: Morphological Image Processing Francesca Pizzorni Ferrarese 07/04/2010](https://reader034.vdocuments.us/reader034/viewer/2022051211/5542eb5a497959361e8c7c2c/html5/thumbnails/46.jpg)
Application: filtering
46
![Page 47: Morphological Image Processing Francesca Pizzorni Ferrarese 07/04/2010](https://reader034.vdocuments.us/reader034/viewer/2022051211/5542eb5a497959361e8c7c2c/html5/thumbnails/47.jpg)
Hit-or-Miss Transformation ⊛ (HMT)
47
find location of one shape among a set of shapes ”template matching”
composite SE: object part (B1) and background part (B2)
does B1 fits the object while, simultaneously, B2 misses the object, i.e., fits the background?
)]([)( XWAXABA c
![Page 48: Morphological Image Processing Francesca Pizzorni Ferrarese 07/04/2010](https://reader034.vdocuments.us/reader034/viewer/2022051211/5542eb5a497959361e8c7c2c/html5/thumbnails/48.jpg)
Boundary Extraction
48
)()( BAAA
![Page 49: Morphological Image Processing Francesca Pizzorni Ferrarese 07/04/2010](https://reader034.vdocuments.us/reader034/viewer/2022051211/5542eb5a497959361e8c7c2c/html5/thumbnails/49.jpg)
Example
49
![Page 50: Morphological Image Processing Francesca Pizzorni Ferrarese 07/04/2010](https://reader034.vdocuments.us/reader034/viewer/2022051211/5542eb5a497959361e8c7c2c/html5/thumbnails/50.jpg)
Region Filling
50
,...3,2,1 )( 1 kABXX ckk
![Page 51: Morphological Image Processing Francesca Pizzorni Ferrarese 07/04/2010](https://reader034.vdocuments.us/reader034/viewer/2022051211/5542eb5a497959361e8c7c2c/html5/thumbnails/51.jpg)
Example
51
![Page 52: Morphological Image Processing Francesca Pizzorni Ferrarese 07/04/2010](https://reader034.vdocuments.us/reader034/viewer/2022051211/5542eb5a497959361e8c7c2c/html5/thumbnails/52.jpg)
Extraction of connected components
52
![Page 53: Morphological Image Processing Francesca Pizzorni Ferrarese 07/04/2010](https://reader034.vdocuments.us/reader034/viewer/2022051211/5542eb5a497959361e8c7c2c/html5/thumbnails/53.jpg)
Example
53
![Page 54: Morphological Image Processing Francesca Pizzorni Ferrarese 07/04/2010](https://reader034.vdocuments.us/reader034/viewer/2022051211/5542eb5a497959361e8c7c2c/html5/thumbnails/54.jpg)
Convex hull
54
A set A is is said to be convex if the straight line segment joining any two points in A lies entirely within A.
i
iDAC
4
1)(
,...3,2,1 and 4,3,2,1 )( kiABXX iik
ik
![Page 55: Morphological Image Processing Francesca Pizzorni Ferrarese 07/04/2010](https://reader034.vdocuments.us/reader034/viewer/2022051211/5542eb5a497959361e8c7c2c/html5/thumbnails/55.jpg)
Thinning
55
cBAA
BAABA
)(
)(
![Page 56: Morphological Image Processing Francesca Pizzorni Ferrarese 07/04/2010](https://reader034.vdocuments.us/reader034/viewer/2022051211/5542eb5a497959361e8c7c2c/html5/thumbnails/56.jpg)
Thickening
56
)( BAABA
![Page 57: Morphological Image Processing Francesca Pizzorni Ferrarese 07/04/2010](https://reader034.vdocuments.us/reader034/viewer/2022051211/5542eb5a497959361e8c7c2c/html5/thumbnails/57.jpg)
Skeletons
57
K
kk ASAS
0
)()(
BkBAkBAASk )()()(
})(|max{ kBAkK
))((0
kBASA k
K
k
![Page 58: Morphological Image Processing Francesca Pizzorni Ferrarese 07/04/2010](https://reader034.vdocuments.us/reader034/viewer/2022051211/5542eb5a497959361e8c7c2c/html5/thumbnails/58.jpg)
Skeletons
58
![Page 59: Morphological Image Processing Francesca Pizzorni Ferrarese 07/04/2010](https://reader034.vdocuments.us/reader034/viewer/2022051211/5542eb5a497959361e8c7c2c/html5/thumbnails/59.jpg)
Pruning
59
}{1 BAX
AHXX )( 23
314 XXX
H = 3x3 structuring element of 1’s
)( 1
8
12
k
kBXX
![Page 60: Morphological Image Processing Francesca Pizzorni Ferrarese 07/04/2010](https://reader034.vdocuments.us/reader034/viewer/2022051211/5542eb5a497959361e8c7c2c/html5/thumbnails/60.jpg)
60
![Page 61: Morphological Image Processing Francesca Pizzorni Ferrarese 07/04/2010](https://reader034.vdocuments.us/reader034/viewer/2022051211/5542eb5a497959361e8c7c2c/html5/thumbnails/61.jpg)
61
![Page 62: Morphological Image Processing Francesca Pizzorni Ferrarese 07/04/2010](https://reader034.vdocuments.us/reader034/viewer/2022051211/5542eb5a497959361e8c7c2c/html5/thumbnails/62.jpg)
62
![Page 63: Morphological Image Processing Francesca Pizzorni Ferrarese 07/04/2010](https://reader034.vdocuments.us/reader034/viewer/2022051211/5542eb5a497959361e8c7c2c/html5/thumbnails/63.jpg)
63