Professional Documents
Culture Documents
chapter3-
chapter3-
Preview
“Morphology “ – a branch in biology that deals with the
form and structure of animals and plants.
“Mathematical Morphology” – as a tool for extracting
image components, that are useful in the representation
and description of region shape.
The language of mathematical morphology is – Set theory.
Unified and powerful approach to numerous image
processing problems.
In binary images , the set elements are members of the 2-D
integer space – Z2. where each element (x,y) is a coordinate
of a black (or white) pixel in the image.
Mathematic Morphology
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
3
Mathematic Morphology
mathematical framework used for:
pre-processing
noise filtering, shape simplification, ...
enhancing object structure
skeletonization, convex hull...
Segmentation
watershed,…
quantitative description
area, perimeter, ...
4
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
5
Basic Concepts in Set Theory
Subset
Union
Intersection
10
How to describe SE
many different ways!
information needed:
position of origo for SE
positions of elements belonging to SE
11
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
12
Basic morphological operations
Erosion
Dilation
13
Erosion
Erosion is used for shrinking of element A by using
element B
Erosion for Sets A and B in Z2, is defined by the
following equation:
A B {z|( Bˆ )z A Φ}
17
Dilation
Dilation is used for expanding an element A by using structuring
element B
Dilation of A by B and is defined by the following equation:
25
Combining erosion and dilation
WANTED:
remove structures / fill holes
without affecting remaining parts
SOLUTION:
combine erosion and dilation
(using same SE)
26
Erosion : eliminating irrelevant detail
A B ( A B) B
eliminates protrusions
breaks necks
smoothes contour
28
Opening
29
Opening
30
Opening
A B ( A B) B
A B {( B) z | ( B) z A} 31
Closing
dilation followed by erosion, denoted •
A B ( A B) B
smooth contour
fuse narrow breaks and long thin gulfs
eliminate small holes
fill gaps in the contour
32
Closing
33
Closing
34
Closing
A B ( A B) B
35
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
c ˆ
( A B) ( A B) c
37
38
39
Useful: open & close
40
Application: filtering
41
Hit-or-Miss Transformation ⊛ (HMT)
find location of one shape among a set of shapes
”template matching
A B ( A X ) [ A (W X )]
c
43
Boundary Extraction
( A) A ( A B)
44
Example
45
Region Filling
X k ( X k 1 B ) A c
k 1,2,3,...
46
Example
47
Thinning
A B A ( A B)
A ( A B) c
48
Thickening
A B A ( A B)
49
K
S ( A) S k ( A)
Skeletons k 0
S k ( A) ( A kB) ( A kB ) B
K max{k | ( A kB) }
K
A ( S k ( A) kB)
k 0
50
51
H = 3x3 structuring element of 1’s X 1 A {B}
8
Pruning X 2 ( X1 B )
k
k 1
X3 (X2 H ) A
X 4 X1 X 3
52
53
54
55
56
5 basic structuring elements
57
Image Reconstruction and
Restoration
Preview
Goal of image restoration
Improve an image in some predefined sense
Difference with image enhancement ?
Features
Image restoration v.s image enhancement
Objective process v.s. subjective process
• A prior knowledge v.s heuristic process
A prior knowledge of the degradation
phenomenon is considered
Modeling the degradation and apply the
inverse process to recover the original
image
Preview (cont.)
Target
Degraded digital image
Sensor, digitizer, display degradations are
less considered
Spatial domain approach
Frequency domain approach
Outline
g(x,y)=f(x,y)*h(x,y)
+ (x,y)
G(u,v)=F(u,v)H(u,v)+N(u,v)
Noise models
Source of noise
Image acquisition (digitization)
Image transmission
Spatial properties of noise
Statistical behavior of the gray-level values
of pixels
Noise parameters, correlation with the
image
Frequency properties of noise
Fourier spectrum
Ex. white noise (a constant Fourier
spectrum)
Noise probability density
functions
Noises are taken as random variables
Random variables
Probability density function (PDF)
PDFs of some important
noise models
Test for noise behavior
Test Pattern
Its histogram:
0 55
Periodic noise
Arise from electrical or
electromechanical interference during
image acquisition
Spatial dependence
Observed in the frequency domain
Estimation of noise
parameters
Periodic noise
Observe the frequency spectrum
Random noise with unknown
PDFs
Case1:imagingsystem
is available
Capture images of “fl at” environment
Case2:noisyimagesavailable
Take a strip from constant area
Draw the histogram and obser ve it
Measure the mean and variance
Observe the histogram
Outline
g(x,y)=f(x,y)
+ (x,y)
G(u,v)=F(u,v)+N(u,v)
Spatial filters for de-
noising additive noise
Skills similar to image enhancement
Mean filters
Order-statistics filters
Adaptive filters
Mean filters
• Arithmetic mean
Geometric Mean
Filter
Contraharmonic Mean
Filte
ORDER-STATISTIC FILTERS
Median Filter:
Midpoint Filter:
Alpha-Trimmed Mean Filter:
The white bars in the test
pattern shown are 7 pixels
wide and 210 pixels high. The
separation between bars is 17
pixels. What would this
image look like after
application of (a) A 3 3 ×
arithmetic mean filter? (b) A
7 7 × arithmetic mean filter?
(c) A 9 9 × arithmetic mean
filter?
Adaptive filters
A d a pt e d t o h
t b e h a v o
i r b as e
st ic a l c h a r ac teri s ti c s o ft h e i m
d o n h
t e s a
t it
ag e in s id e th
efi lteregionS x y
I m p rovedperformancev.sincreasedcompl
e xi ty
E x ample:Adaptivelocalnoisereductionfilt
reduction filter
Adaptive local noise
Simpleststatisticalmeasurement
Meanandvariance
KnownparametersonlocalregionS xy
g(x,y):noisyimagepixelvalue
: noise variance (as ume known a prior)
mL :localmean
L : local variance
reduction filter (cont.)
Adaptive
local
Analysis: we noise
want to do
If is zero, return g(x,y)
If > , return value
L
close to g(x,y)
If = , return the
L
arithmetic mean mL
2η
f^ ( x,y ) =g( x,y σ g( x,y )
Formula [ L
)− σ L2 −m
]
Gaussian
Arith.
oise
0 mean
7x7
1000
Geometric
mean
x7
adaptive
Adaptive Median Filter
Outline
π
]
j
Periodic noise reduction
(cont.)
Bandrejectfilters
Bandpassfilters
Notchfi lters
Optimum notchfiltering
Bandreject filte
rs
*Rejectanisotropicfrequency
bandreject
Bandpassfilte
rs
Hbp(u,v)=1-Hbr(u,v)
ℑ {G(u,v )H
−1
(u,v )}
bp
Notch filters
Reject(or pass) frequencies in
predefined neighborhoods about a
center frequency
ideal
Butterworth Gaussian
Horizontal
Scan lines
Notch
DFT pas
Notch Notch
Outline