Upload
others
View
9
Download
0
Embed Size (px)
Citation preview
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
42
Digital Image Processing
Intensity Transformations and Spatial Filtering
42
• Order Statistics Filters:
– Impulsive noise: • Mono Level : Salt, Pepper noises
• Bi Level: Salt-Pepper noises
– Filter • Median
• Max
• Min
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
43
Digital Image Processing
Intensity Transformations and Spatial Filtering
43
• Example:
Salt-Pepper Noise 3×3 Averaging 3×3 Median
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
44
Digital Image Processing
Intensity Transformations and Spatial Filtering
44
• Sharpening Spatial Filter
– Highlights Intensity Transitions
– First and Second order Derivatives
1, ,
, 1,
0.5 1, 1,
f x y f x yf
f x y f x yx
f x y f x y
2
21, 2 , 1,
ff x y f x y f x y
x
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
45
Digital Image Processing
Intensity Transformations and Spatial Filtering
45
• First Order Derivative:
– Zero in flat region
– Non-zero at start of step/ramp region
– Non-zero along ramp
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
46
Digital Image Processing
Intensity Transformations and Spatial Filtering
46
• Second Order Derivative:
– Zero in flat region
– Non-zero at start/end of step/ramp region
– Zero along ramp
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
47
Digital Image Processing
Intensity Transformations and Spatial Filtering
47
• Comparison:
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
48
Digital Image Processing
Intensity Transformations and Spatial Filtering
48
• 1st and 2nd Order Derivative Comparison:
– First Derivative: • Thicker Edge;
• Strong Response for step changes;
– Second Derivative: • Strong response for fine details and isolated points;
• Double response at step changes.
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
49
Digital Image Processing
Intensity Transformations and Spatial Filtering
49
• Laplacian as an isotropic Enhancer:
• Discrete Implementation:
2 22
2 2
f ff
x y
2 1, , 1 1, , 1 4 ,f f x y f x y f x y f x y f x y
0 1 0
1 4 1 90
0 1 0
isotropic
1 1 1
1 8 1 45
1 1 1
isotropic
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
50
Digital Image Processing
Intensity Transformations and Spatial Filtering
50
Practically use:
• Laplacian Masks
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
51
Digital Image Processing
Intensity Transformations and Spatial Filtering
51
• Background Recovering:
2
2
, ,,
, ,
f x y f x y signg x y
f x y f x y sign
0 1 0
1 1 90
0 0
5
1
isotropic
1 1 1
1 1 45
1 1
9
1
isotropic
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
52
Digital Image Processing
Intensity Transformations and Spatial Filtering
52
• Example:
Non-Scaled and scaled Laplacian
Sharpened using 90º and 45º degree isotropic Laplacian
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
53
Digital Image Processing
Intensity Transformations and Spatial Filtering
53
• Unsharp Masking and High-Boost Filtering:
• k≥0
– k=1: Unsharp Masking
– k>1: High Boost
• Another mask:
– Laplacian and any highpass filter
, , , , , : Blurred image
g , , ,
mask
mask
g x y f x y f x y f x y
x y f x y k g x y
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
54
Digital Image Processing
Intensity Transformations and Spatial Filtering
54
• One Dimensional Illustration
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
55
Digital Image Processing
Intensity Transformations and Spatial Filtering
55
• Two Dimensional Example
Blurred, 5×5, σ=3
Unsharp mask
Unsharp masking , k=1
Highboost, k=4.5
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
56
Digital Image Processing
Intensity Transformations and Spatial Filtering
56
• First Derivative - Gradient:
1 222
TT
x y
f ff G G
x y
f f f ff
x y x y
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
57
Digital Image Processing
Intensity Transformations and Spatial Filtering
57
Roberts Cross Gradient
9 5 8 6x yG z z G z z
7 8 9 1 2 3
3 6 9 1 4 7
2 2
2 2
x
y
G z z z z z z
G z z z z z z
Sobel Gradient
• Discrete Implementation
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
58
Digital Image Processing
Intensity Transformations and Spatial Filtering
58
• Example (Sobel Mask):
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
59
Digital Image Processing
Intensity Transformations and Spatial Filtering
59
• Image Subtraction:
– Physically static object and background
– Intensity changes in object but not in background
, , ,g x y f x y f x y
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
60
Digital Image Processing
Intensity Transformations and Spatial Filtering
60
• Example:
– Original
– Discard Some bits
– Difference
– Histogram Equalized
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
61
Digital Image Processing
Intensity Transformations and Spatial Filtering
61
• Image Averaging: – Consider an additive noise condition:
g(x,y)=f(x,y)+η(x,y)
– Conditions: • Noise, η(x,y):
– Uncorrelated
– i.i.d
– Zero Mean
• Subject, f(x,y): – Physical Stationary
– Repeatable Experiments
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
62
Digital Image Processing
Intensity Transformations and Spatial Filtering
62
• Image Averaging:
– For i.i.d RV’s:
2 2
, ,1
, , , , ,
1 1, ,
i i
N
i g x y x yi
g x y f x y x y E g x y f x y
g x y g x yN N
1
Var1, Var
N
i
i
E EN N
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
63
Digital Image Processing
Intensity Transformations and Spatial Filtering
63
• Astronomical Application:
– Repeatable Experiments!
Original Noisy
N=8 N=16
N=64 N=128
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
64
Digital Image Processing
Intensity Transformations and Spatial Filtering
64
• Difference Histogram: N=8
N=16
N=64
N=128
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
65
Digital Image Processing
Intensity Transformations and Spatial Filtering
65
• Combination:
Bone Scan Laplacian
Original+Laplacian Soble of Original
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
66
Digital Image Processing
Intensity Transformations and Spatial Filtering
66
Smoothed Sobel (Orig. + L.)*S.Sobel
Orig.+ (Orig.+L.)*S.Sobel Apply Power-Law
• Combination:
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
67
Digital Image Processing
Intensity Transformations and Spatial Filtering
67
• Fuzzy Image Enhancement:
– Brief Introduction to Fuzzy set
– Fuzzy Intensity Transformation
– Fuzzy Spatial Filtering
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
68
Digital Image Processing
Intensity Transformations and Spatial Filtering
68
• Introduction
– Logic of real world
– “He is young man” is true of false?
– Fuzzy and Crisp sets:
• Membership function:
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
69
Digital Image Processing
Intensity Transformations and Spatial Filtering
69
• Fuzzy Set:
– Definition:
, , :Set of Elements
Empty Set: 0
Equality:
Subset:
Complement: 1
Union (A B, A B): max ,
Intersection (A B, A B): min ,
A
A
A B
A B
AA
C A B
C A B
A z z z Z Z
z
z z
z z
z z
OR z z z
AND z z z
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
70
Digital Image Processing
Intensity Transformations and Spatial Filtering
70
• Graphical Illustration
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
71
Digital Image Processing
Intensity Transformations and Spatial Filtering
71
• Some Membership Functions:
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
72
Digital Image Processing
Intensity Transformations and Spatial Filtering
72
• Using Fuzzy Sets in inferring:
– Example: Using color to categorize fruits
R1: If color is green then the fruit is verdant
OR
R2: If color is yellow then the fruit is half-mature
OR
R3: If color is red then the fruit is mature
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
73
Digital Image Processing
Intensity Transformations and Spatial Filtering
73
• We should to do:
– Fuzzify antecedent and consequent of each rule
– Evaluate membership function of each rules (R1, R2, R3),
– Rules aggregation,
– Final crisp value (Defuzzification).
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
74
Digital Image Processing
Intensity Transformations and Spatial Filtering
74
• Fuzzification of antecedents and consequents
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
75
Digital Image Processing
Intensity Transformations and Spatial Filtering
75
• if-then rule fuzzification:
– Possibility of consequents is less than antecedents • Example: “if x is A then y is D”
– Our Example:
0 01
2 0 0
0 03
, min ,
, min ,
, min ,
green verd
yellow half
red mat
z v z v
z v z v
z v z v
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
76
Digital Image Processing
Intensity Transformations and Spatial Filtering
76
• Rule aggregation
R = R1 OR R2 OR … OR Rn
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
77
Digital Image Processing
Intensity Transformations and Spatial Filtering
77
• Rule aggregation in our Example
– Q = Q1 OR Q2 OR Q3
1 2 030 0 0, max , , , , ,z v z v z v z v
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
78
Digital Image Processing
Intensity Transformations and Spatial Filtering
78
• Defuzzification:
– Max Membership
– Center of Gravity
– ….
1
1
,
N
i i
i
N
i
i
x xx x dx
x xx dx
x
: ,x x x x
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
79
Digital Image Processing
Intensity Transformations and Spatial Filtering
79
• Complex antecedent:
1 2
1 2
1 2 n
1 2 n
R: IF is AND is AND is THEN is B
: IF is THEN is
min , ,
R: IF is OR is OR is THEN is B
: IF is THEN is
, ,
n
n
A A A A
A A A A
x A x A x A y
R x A y B
x x x x
x A x A x A y
R x A y B
x Max x x x
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
80
Digital Image Processing
Intensity Transformations and Spatial Filtering
80
• Fuzzy Intensity Transformation:
R1: If a pixel is Dark then make it Darker
R2: If a pixel is Gray then make it Gray
R3: If a pixel is Bright then make it Brighter
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
81
Digital Image Processing
Intensity Transformations and Spatial Filtering
81
• Results
Original Histogram Equalization Fuzzy Enhancement
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
82
Digital Image Processing
Intensity Transformations and Spatial Filtering
82
• Analysis:
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
83
Digital Image Processing
Intensity Transformations and Spatial Filtering
83
• Spatial Filtering Using Fuzzy Sets
– Goal: Boundary Extraction
– General Rule:
– Uniformity: Intensity difference central pixel and its neighbors
– For a 3×3 maks: di = zi - z5
if “a pixel belongs to a uniform region”, then ”make it
white, else make it black”
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
84
Digital Image Processing
Intensity Transformations and Spatial Filtering
84
• Filtering Rule:
IF d2 is zero AND d6 is zero THEN z5 is white
IF d6 is zero AND d8 is zero THEN z5 is white
IF d8 is zero AND d4 is zero THEN z5 is white
IF d4 is zero AND d2 is zero THEN z5 is white
ELSE z5 is black
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
85
Digital Image Processing
Intensity Transformations and Spatial Filtering
85
• Membership Function
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
86
Digital Image Processing
Intensity Transformations and Spatial Filtering
86
• Rules Graphical Interpretation
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
87
Digital Image Processing
Intensity Transformations and Spatial Filtering
87
• Example:
ee.sharif.edu/~dip
E. Fatemizadeh, Sharif University of Technology, 2012
88
Digital Image Processing
Intensity Transformations and Spatial Filtering
88
• MATLAB Command:
– Image Statistics:
• means2, std2, corr2, imhist, regionprops
– Image Intensity Adjustment:
• imadjust, histeq, adapthisteq, imnoise
– Linear Filter:
• imfilter, fspecial, conv2, corr2,
– Nonlinear filter:
• medfilt2, ordfilt2,