Download presentation
Presentation is loading. Please wait.
Published byDylan Powell Modified over 9 years ago
1
Mathematical Morphology Lecture 14 Course book reading: GW 9.1-4 Lucia Ballerini Digital Image Processing
2
Mathematical Morphology mathematical framework used for: pre-processing noise filtering, shape simplification,... enhancing object structure skeletonization, convex hull... segmentation watershed,… quantitative description area, perimeter,...
3
Set theory A is a set in Z 2 a=(a 1,a 2 ) is an element in A: a A a=(a 1,a 2 ) is not an element in A: a A empty set: set specified using { }, e.g., C={w|w=-d, for d D} every element in A is also in B (subset): A B
4
Set theory union of A and B: C=A B={c|c A or c B} intersection of A and B: C=A B={c|c A and c B} disjoint/mutually exclusive: A B= ABAB ABAB
5
Set theory complement of A: A C ={w|w A} difference of A and B: A-B={w|w A,w B}=A B C ACAC A-B
6
Set theory reflection of A: Â={w|w=-a, for a A} translation of A by a point z=(z 1,z 2 ): (A) z ={c|c=a+c, for a A} Â (A) z
7
Logical operations ► pixelwise combination of images ► AND, OR, NOT pq p AND q (p q, p q) p OR q (p+q, p q) NOT p (p, p) 00001 01011 10010 11110
8
AB NOT AA AND B A OR BA XOR B
9
Structuring element (SE) ► small set to probe the image under study ► for each SE, define origo SE in point p: origo coincides with p ► shape and size must be adapted to geometric properties for the objects
10
Basic idea ► 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 pixels in output image if check is: SE fits
11
How to describe SE many different ways! information needed: position of origo for SE positions of elements belonging to SE line segment pair of points (separated by one pixel) line segment (origo is not in SE) origo line segment (origo is not in SE)
12
Basic morphological operations ► erosion ► dilation ► combine to opening closening keep general shape but smooth with respect to object background
13
Erosion Does the structuring element fit the set? shrink the object erosion of a set A by structuring element B: all z in A such that B is in A when origin of B=z
14
Erosion SE=
15
Erosion
17
Dilation Does the structuring element hit the set? grow the object dilation of a set A by structuring element B: all z in A such that B hits A when origin of B=z
18
Dilation SE=
19
Dilation
21
notation if SE is symmetric with respect to its origin (almost) only symmetric SEs in GW!!
22
Duality erosion and dilation are dual with respect to complementation and reflection note! the operations are not self dual
23
A A⊖BA⊖B(A ⊖ B) C ACAC AC⊕BAC⊕B
24
useful ► erosion removal of structures of certain shape and size, given by SE ► dilation filling of holes of certain shape and size, given by SE
25
Combining erosion and dilation WANTED: remove structures / fill holes without affecting remaining parts SOLUTION: combine erosion and dilation (using same SE)
26
input: squares of size 1x1, 3x3, 5x5, 7x7, 9x9, and 15x15 pixels erosion: SE=square of size 13x13 dilation: SE=square of size 13x13
27
Opening erosion followed by dilation, denoted ∘ eliminates protrusions breaks necks smoothes contour
28
Opening B= A A⊖BA⊖B A∘BA∘B
29
Opening A A⊖BA⊖B A∘BA∘B
30
Opening: roll ball(=SE) inside object see B as a ”rolling ball” boundary of A ∘ B = points in B that reaches farthest into A when B is rolled inside A
31
Closing dilation followed by erosion, denoted smooth contour fuse narrow breaks and long thin gulfs eliminate small holes fill gaps in the contour
32
Closing B= A A⊕BA⊕B A B
33
Closing B= A A⊕BA⊕B A B
34
Closing: roll ball(=SE) outside object see B as a ”rolling ball” boundary of A B = points in B that reaches farthest into A when B is rolled outside A
36
Properties ► opening A ∘ B subset/image of A C D C ∘ B D ∘ B (A ∘ B) ∘ B= A ∘ B ► closing A subset/image of A B C D C B D B (A B) B= A B Note: idempotent repeated openings/closings has no effect!
37
Duality opening and closing are dual with respect to complementation and reflection
38
A A∘BA∘B(A ∘ B) C ACBACB ACAC
39
Uselful: open & close A opening of A removal of small protrusions, thin connections, … closing of A removal of holes
40
Application: filtering 1.erode A ⊖ B 2. dilate (A ⊖ B) B= A ∘ B 4. erode ((A ∘ B) B) ⊖ B= (A ∘ B) B 3. dilate (A ∘ B) B
41
Hit-or-Miss Transformation ⊛ (HMT) find location of one shape among a set of shapes ”template matching” composite SE: object part (B 1 ) and background part (B 2 ) does B 1 fits the object while, simultaneously, B 2 misses the object, i.e., fits the background?
42
A=X Y Z Y X Z WW-X A⊖XA⊖X A C ⊖ (W-X) A ⊛ X=(A ⊖B 1 ) (A c ⊖ B 2 )
43
Hit-or-Miss Transformation ⊛ (HMT) find location of one shape among a set of shapes WW-X B=(B 1,B 2 ) B 1 =X B 2 =W-X
44
use HMT endpoints isolated points B1B1 B2B2 B1B1 B2B2 B2B2 B2B2 B2B2
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.