Title: Morphological Filtering
1Morphological Filtering
2Morphological Filtering
Spatial Filtering
- Morphological operators are used to change image
data to reflect new geometric structure. - Basics of Morphological Filtering
- To kinds
- Binary Morphology
- Grey Level Morphology
3Libraries of Structuring Elements
- Application specific structuring elements created
by the user
4Binary Morphology
- Binary images often suffer from noise
(specifically salt-and-pepper noise) - Binary regions also suffer from noise (isolated
black pixels in a white region). Can also have
cracks, picket fence , etc. - Dilation and erosion are two binary morphological
operations that can assist with these problems.
5Dilation
- Dilation is used for expanding an element A by
using structuring element B. - The dilation operator takes two pieces of data as
input - A binary image, which is to be dilated
- A structuring element (or kernel), which
determines the behavior of the morphological
operation
6Main Applications of Dilation
- Expand shapes
- Fills in holes, crack, valleys between spiky
regions - Smoothes object boundaries.
- Adds an extra outer ring of pixels onto object
boundary, ie, object becomes slightly larger. - (sets background pixels adjacent to object's
contour to object's value) - smoothes small negative grey level regions
7Main Applications of Dilation
8 Dilation A More interesting Example cracks
9Dilation
10Dilation fills holes
- Fills in holes.
- Smoothes object boundaries.
- Adds an extra outer ring of pixels onto object
boundary, ie, object becomes slightly larger.
11Dilation example
12Dilation explained pixed by pixel
B
A
Denotes origin of B i.e. its (0,0)
Denotes origin of A i.e. its (0,0)
13Dilation explained by shape of A
Shape of A repeated without shift
B
Shape of A repeated with shift
A
14Structuring Element for Dilation
Length 6
Length 5
15Structuring Element for Dilation
16Structuring Element for Dilation
Single point in Image replaced with this in
the Result
17Structuring Element for Dilation
18Illustration of Extensitivity of Dilation
A
B
Replaced with
19Definition of Dilation Mathematically
- Let A and B are subsets in 2-D space. A image
undergoing analysis, B Structuring element,
denotes dilation
20Dilation explained pixed by pixel
B
A
(0,1) (0,0) (0,1) (1,2) (0,0) (1,2) (1,3) (0,0) (1,3) (1,4) (0,0) (1,4) (2,2) (0,0) (2,2) (0,1) (1,0) (1,1) (1,2) (1,0) (2,2) (1,3) (1,0) (2,3) (1,4) (1,0) (2,4) (2,2) (1,0) (3,2)
21Mathematical Properties of Dilation
- Commutative
- Associative
- Linearity
- Containment
- Decomposition of structuring element
-
-
22More Properties of Dilation
- Translation Invariance
- Linearity
- Containment
- Decomposition of structuring element
23Dilation
Question Suppose that the structuring element
is a 3x3 square with the origin at its center
evaluate the new image
(-1,-1), (0,-1), (1,-1), (-1,0), (0,0),
(1,0), ( 1,1), (0,1), (1,1)
B
A
24Dilation
25In MATLAB Codes
- strelThis function creates amorphological
structuring element. SEstrel(shape,parameters) - Dilation image
- imdilate This function Dilate the image.
- I2imerode(image,SE)
shape parameters
disk R
line Len,deg
square w
rectangle m n
26Codes
- Example1
- A imread(Image.tif')
- figure,imshow(A)
- se strel('disk',3)
- A2 imdilate(A, se)
- imshow(A), figure,imshow(A2)
- Example 2
- A imread('broken-text.tif')
- B 0 1 0 1 1 1 0 1 0
- A2 imdilate(A,B)
- imshow(A),figure,imshow(A2)
27Example of Dilation with various sizes of
structuring elements
Pablo Picasso, Pass with the Cape, 1960