Mathematical Morphology: Erosion Dilation Opening Closing
Mathematical Morphology: Erosion Dilation Opening Closing
• Erosion
• Dilation
• Opening
• Closing
1
Erosion
2
Erosion
3
Erosion
B X = ∩b∈B X −b
Which can be extended to also include grayscale images:
B f = ∧b∈B f −b
4
Erosion
• Based on
B f = ∧b∈B f −b
we can define an algorithm to find the erosion of image f:
[ B f ] x=min b∈B f xb
5
Erosion
• Example, grayscale image
f f+1
6 f-1 εΒ(f)
Erosion example
Erosion using
a SE matching
the inner
texture
7
Another erosion example
8
Original image
Another erosion example
10
Identified finger print branches
Dilation
11
Dilation
12
Dilation
B X = ∪b∈ B X −b
Which can be extended to also include grayscale images:
B f = ∨b∈B f −b
13
Dilation
• Based on
B f = ∨b∈B f −b
we can define an algorithm to find the dilation of image f:
[dilation B f ] x =max b∈B f xb
14
Dilation
• Example, grayscale image
f f+1
15 f-1 δΒ(f)
Dilation
16
Dilation and erosion example
17
Beucher gradient
18
Properties of dilation and erosion
19
Dilation and erosion composition
B B =
2 1 B 2 B1
B B =
2 1 B 2
B1
• For instance can a dilation with a 5x5 SE instead be computed using two
3x3 SEs:
20
Improving calculation efficiency using
parallel computing
• Dilation and erosion are algorithms that can be efficiently parallelised
• Solutions:
– Large multiprocessor computer
– Computer cluster
– Cellular neural network (implemented in hardware)
– The graphics processing units (GPU) on a modern graphics card
– More++?
21
GPU
23
Graphs courtesy of Ian Buck, Stanford University
GPU shortcomings
• Shortcomings
– No better than 32 bit floating point throughout the pipeline
– GPU programming currently requires GPU-specific knowledge
– Not all image processing tasks can be implemented on the GPU
– If branches are not efficient (can sometimes be replaced by more efficient
max or min operators)
24
GPU example uses
27
Images courtesy of Aaron Lefohn, University of California
Morphological opening
• Binary example:
28
Morphological opening
• Grayscale example
29
Morphological closing
• Binary example:
30
Another example
• How to segment the text from the uneven illumination in the image?
31
Another example
• How to segment the text from the uneven illumination in the image?
32
Another example
• How to segment the text from the uneven illumination in the image?
33
Properties of opening and closing
34