ee.sharif.edu/~dip E. Fatemizadeh, Sharif University of Technology, 2012 Digital Image Processing Intensity Transformations and Spatial Filtering 1 • Image Enhancement: – No Explicit definition • Methods – Spatial Domain: • Linear • Nonlinear – Frequency Domain: • Linear • Nonlinear
88
Embed
No Slide Titlesbisc.sharif.edu/~dip/Files... · Intensity Transformations and Spatial Filtering 1 ... Intensity Transformations and Spatial Filtering 4 •Intensity Transformation
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
1
Digital Image Processing
Intensity Transformations and Spatial Filtering
1
• Image Enhancement:
– No Explicit definition
• Methods
– Spatial Domain: • Linear
• Nonlinear
– Frequency Domain: • Linear
• Nonlinear
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
2
Digital Image Processing
Intensity Transformations and Spatial Filtering
2
• Spatial Domain Process
, ,g x y T f x y
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
3
Digital Image Processing
Intensity Transformations and Spatial Filtering
3
• For 1×1 neighborhood: – Contrast Enhancement/Stretching/Point Process
• For w×w neighborhood: – Filtering/Mask/Kernel/Window/Template Processing
s T r
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
4
Digital Image Processing
Intensity Transformations and Spatial Filtering
4
• Intensity Transformation Functions:
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
5
Digital Image Processing
Intensity Transformations and Spatial Filtering
5
• Image Negatives:
1s L r
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
6
Digital Image Processing
Intensity Transformations and Spatial Filtering
6
• Log Transform:
log 1s c r
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
7
Digital Image Processing
Intensity Transformations and Spatial Filtering
7
• Power-Law Transform:
s cr
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
8
Digital Image Processing
Intensity Transformations and Spatial Filtering
8
• Gamma Correction:
11.8 2.5
r
1.8 2.5r
1.8 2.5r
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
9
Digital Image Processing
Intensity Transformations and Spatial Filtering
9
Original =0.6
=0.4 =0.3
• Gamma Correction
– Too Dark Image
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
10
Digital Image Processing
Intensity Transformations and Spatial Filtering
10
=5
Original =3
=4
• Gamma Correction
– Too Bright Image
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
11
Digital Image Processing
Intensity Transformations and Spatial Filtering
11
Original
C. S. THR.
• Contrast Stretching
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
12
Digital Image Processing
Intensity Transformations and Spatial Filtering
12
• Gray Level Slicing
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
13
Digital Image Processing
Intensity Transformations and Spatial Filtering
13
• Example Using Fig 3.11 (a) Using Fig 3.11 (b)
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
14
Digital Image Processing
Intensity Transformations and Spatial Filtering
14
• Bit-Plane Slicing:
– Highlighting effect of a single bit!
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
15
Digital Image Processing
Intensity Transformations and Spatial Filtering
15
• Example:
– LSB -> MSB (Left to Right and Top to Bottom)
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
16
Digital Image Processing
Intensity Transformations and Spatial Filtering
16
Bits (7,8) Bits (6,7,8) Bits (5,6,7,8)
• Image Reconstruction from bit-planes
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
17
Digital Image Processing
Intensity Transformations and Spatial Filtering
17
• Histogram Processing:
– Enhancement based on statistical Properties:
• Local
• Global
– Histogram Definition:
, 0, 1 , 0,
1
k k k k
kk k
h r n r L n M N
np r n
n M N
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
18
Digital Image Processing
Intensity Transformations and Spatial Filtering
18
• Histogram Visual Meaning:
– Dark
– Light
– Low Contrast
– High Contrast
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
19
Digital Image Processing
Intensity Transformations and Spatial Filtering
19
• Histogram Equalization:
– Continuous Case.
– Seek for a suitable transform (Except for negative):
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
20
Digital Image Processing
Intensity Transformations and Spatial Filtering
20
• Effect of Point Process on Histogram:
• Special Case (CDF):
1 S r
s T r drP s P r
r T s ds
0
Uniform Distribution on [0, -1]
1 1
1 1, 0 1
1
r
r r
s r r
r
dT rdss T r L p w dw L p r
dr dr
drp s p r p r s L
ds p r
L
L
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
21
Digital Image Processing
Intensity Transformations and Spatial Filtering
21
• Concept Illustration:
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
22
Digital Image Processing
Intensity Transformations and Spatial Filtering
22
• Discrete Case
• Perfect equalization is NOT possible
0 0
1
min2
min
, 0,1,2, , 1
11 , 0,1, , 1
ˆ 0.5
ˆ 1 0.51
k kr k
k k
k k r j k
j J
k k k
k kk
k
n np r k L
MN n
LS T r L p r n k L
MN
S S round S
S SS L
L S
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
23
Digital Image Processing
Intensity Transformations and Spatial Filtering
23
• Numerical Example:
0
7k
k r j
j
S p r
𝑆𝑘 𝑆 𝑘
1.33 1
3.08 3
4.55 5
5.67 6
6.23 6
6.56 7
6.86 7
7.00 7
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
24
Digital Image Processing
Intensity Transformations and Spatial Filtering
24
• Numerical Examples (Cont.)
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
25
Digital Image Processing
Intensity Transformations and Spatial Filtering
25
• Real Experiment:
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
26
Digital Image Processing
Intensity Transformations and Spatial Filtering
26
• Gray-Level Transfer Function
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
27
Digital Image Processing
Intensity Transformations and Spatial Filtering
27
• Histogram Matching and Modification:
– Goal: Specify the shape of the histogram:
– Example: Pages: 133-136
?
0 1 1
0
1
1
r z
r
r
z
z
p r p z
s T r L p w dw
z G T r G s
G z L p t dt
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
28
Digital Image Processing
Intensity Transformations and Spatial Filtering
28
• Example (Mars image and its histogram):
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
29
Digital Image Processing
Intensity Transformations and Spatial Filtering
29
• Histogram Matching:
– Washout Gray
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
30
Digital Image Processing
Intensity Transformations and Spatial Filtering
30
Desired
Transform using
Initial CDF
Transform using
Initial Modified CDF
• Histogram Matching:
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
31
Digital Image Processing
Intensity Transformations and Spatial Filtering
31
• Local Histogram Enhancement
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
32
Digital Image Processing
Intensity Transformations and Spatial Filtering
32
• Histogram Statistics For Image Enhancement:
– Use of Global Statistical Measures
– Gross adjustments in overall intensity (m) and contrast (µ2)
1
0 1 1
1
0 1 1
1,
1,
L M Nnn
n i i
i x y
L M N
i i
i x y
r r m p r f x y mMN
m r p r f x yMN
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
33
Digital Image Processing
Intensity Transformations and Spatial Filtering
33
• Histogram Statistics For Image Enhancement:
– Local mean and local variance:
– Local information intensity and contrast (edges)
1
0 ,
1 2 22
0 ,
1, ,
1, , , ,
: Neighborhood centered on ,
xy xy
xy
xy xy xy xy
xy
L
S i S i
i s t Sxy
L
S i S S i S
i s t Sxy
xy
m x y r p r f s tS
x y r m x y p r f s t m x yS
S x y
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
34
Digital Image Processing
Intensity Transformations and Spatial Filtering
34
• A simple enhancement algorithm for SEM image:
0 1 2
0 1 2
. , , ,,
, .
4.0, 0.4, 0.02, 0.4
S G G S GE f x y m x y k m and k x y kg x y
f x y OW
E k k k
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
35
Digital Image Processing
Intensity Transformations and Spatial Filtering
35
• Graphical Illustration:
Local Mean Local Var E or one
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
36
Digital Image Processing
Intensity Transformations and Spatial Filtering
36
• Enhanced Image
– Global histogram equalization
– Use of statistical moments
Original Local Histogram Local Statistics
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
37
Digital Image Processing
Intensity Transformations and Spatial Filtering
37
• Fundamentals of Spatial Filtering:
, , ,a b
s a t b
g x y w s t f x s y t
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
38
Digital Image Processing
Intensity Transformations and Spatial Filtering
38
• Spatial Correlation () and Convolution ()
• Reflection/Rotation in convolution:
, , , ,
, , , ,
a b
s a t b
a b
s a t b
w x y f x y w s t f x s y t
w x y f x y w s t f x s y t
4 6 6 45 5
3 7
7 3
2 8
2
1 9
98 1
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
39
Digital Image Processing
Intensity Transformations and Spatial Filtering
39
• Smoothing Spatial Filters:
– Linear Filters (averaging, lowpass)
– General Formulation
, ,
,
,
a b
s a t b
a b
s a t b
w s t f x s y t
g x y
w s t
2 2
22,
x y
G x y e
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
40
Digital Image Processing
Intensity Transformations and Spatial Filtering
40
• Square averaging Filter:
– Denoising/Smoothing
– Blurring (Equal Value Kernel
1 3
5 9
15 35
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
41
Digital Image Processing
Intensity Transformations and Spatial Filtering
41
• Blurring Usage:
– Delete unwanted (small) subjects.
Original Smoothed Thresholded
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012