Upload
pauline-davis
View
234
Download
0
Tags:
Embed Size (px)
Citation preview
Digital Image Processing
Image Enhancement
Part II
Intensity Histogram
Intensity Histogram
1
3
8
6
6
8
6
11
8
10
8
9
9
7
10
10
0 1 2 3 4k 6 7 8 9 10 11 12 13 14 15
0 1 0 1 0 0 3 1 4 2 3 1 0 0 0 0
5
H(k)
• Examplea 4x4, 4bits/pixel image
Intensity Histogram
From [Gonzalez & Woods]
Intensity Histogram
From [Gonzalez & Woods]
Fixed Intensity Transformations
Basic Transformations
From [Gonzalez & Woods]
rLs 1
)1log( rcs
crs
Negative:
Log:
Power-law:
1 cresInverse Log:
……
Negative Transformation
From [Gonzalez & Woods]
rLs 1
Log Transformation
From [Gonzalez & Woods]
)1log( rcs
Power-law (Gamma) Transformation
From [Gonzalez & Woods]
crs
Power-law (Gamma) Transformation
From [Gonzalez & Woods]
crs
Power-law (Gamma) Transformation
From [Gonzalez & Woods]
crs
mrif
mrifcs
0
Thresholding
From [Gonzalez & Woods]
m : threshold
Example: Fixed Intensity Transformation
1
3
8
6
6
8
6
11
8
10
8
9
9
7
10
10
2
15
1)( rroundrTs
• A 4x4, 4bits/pixel image passes through
an intensity transformation
0
1
4
2
2
4
2
8
4
7
4
5
5
3
7
7
1 round(0.0667) = 0;3 round(0.6) = 1;6 round(2.4) = 2;7 round(3.2667) = 3;8 round(4.2667) = 4;9 round(5.4) =5;10 round(6.6667) = 7;11 round(8.0667) = 8;
The resulting
image is:
Example: Histogram Change
1
3
8
6
6
8
6
11
8
10
8
9
9
7
10
10
0
1
4
2
2
4
2
8
4
7
4
5
5
3
7
7
Contrast Stretch
General Idea: Make Best Use of the Dynamic Range
From [Gonzalez & Woods]
Contrast Stretch
minmax
min)12(rr
rrs B
1212
)12(12
12
0
22
22
2
2
2112
1221
12
12
11
1
BB
BB
B
rrr
rsr
r
s
rrrrr
rsrsr
rr
ss
rrrr
s
s
max2 rr
General form:
Special case Full-scale contrast stretch:
min1 rr
122 Bs
01 s
minmax
min)12(rr
rrrounds B
Typically used:
Example: Full-Scale Contrast Stretch4
4
8
6
6
8
6
11
8
11
8
8
9
7
10
10
4min r
0
0
9
4
4
9
4
15
9
15
9
9
11
6
13
13
• Full-scale contrast stretch of a 4x4, 4bits/pixel image
• Find 11max r 1512 B
)4(
7
15
411
415)12(
minmax
min rroundr
roundrr
rrrounds B
4 round(0) = 0;6 round(4.29) = 4;7 round(6.43) = 6;8 round(8.57) = 9;9 round(10.71) = 11;10 round(12.86) = 13;11 round(15) = 15;
The resulting
image is:
Example: Histogram Change
4
4
8
6
6
8
6
11
8
11
8
8
9
7
10
10
0
0
9
4
4
9
4
15
9
15
9
9
11
6
13
13
Histogram Equalization
Histogram Equalization
From [Gonzalez & Woods]
Histogram Equalization
From [Gonzalez & Woods]
Example2
3
8
2
9
9
9
10
8
3
3
8
3
11
11
10
2min r
0
2
10
0
12
12
12
13
10
2
2
10
2
15
15
13
• A 4x4, 4bits/pixel image
• First try: full-scale contrast stretch
11max r
)2(
3
5
211
215)12(
minmax
min rroundr
roundrr
rrrounds B
2 round(0) = 0;3 round(1.67) = 2;8 round(10.00) = 10;9 round(11.67) = 12;10 round(13.33) = 13;11 round(15) = 15;
The resulting
image is:
Example: Histogram Change
2
3
8
2
9
9
9
10
8
3
3
8
3
11
11
10
0
2
10
0
12
12
12
13
10
2
2
10
2
15
15
13
big gap
full-scale contrast stretch
original
Cumulative Histogram
0 1 2 3 4k 6 7 8 9 10 11 12 13 14 15
0 0 2 4 0 0 0 0 3 3 2 2 0 0 0 0
5
H(k)
0 0 2 6 6 6 6 6 9 12 14 16 16 16 16 16Q(k)
2
3
8
2
9
9
9
10
8
3
3
8
3
11
11
10
H(k)
Q(k)
Intermediate Image
2
3
8
2
9
9
9
10
8
3
3
8
3
11
11
10
2
6
9
2
12
12
12
14
9
6
6
9
6
16
16
14
0 1 2 3 4k 6 7 8 9 10 11 12 13 14 15
0 0 2 4 0 0 0 0 3 3 2 2 0 0 0 0
5
H(k)
0 0 2 6 6 6 6 6 9 12 14 16 16 16 16 16Q(k)
intermediate image
original
2
6
9
2
12
12
12
14
9
6
6
9
6
16
16
14
2min r
0
4
8
0
11
11
11
13
8
4
4
8
4
15
15
13
16max r
)2(
14
15
216
215)12(
minmax
min rroundr
roundrr
rrrounds B
2 round(0) = 0;6 round(4.29) = 4;9 round(7.50) = 8;12 round(10.71) = 11;14 round(12.86) = 13;16 round(15) = 15;
final result:histogram equalized
image
Full-Scale Contrast Stretch of Intermediate Image
intermediate image
Histogram Comparison
4
4
8
6
6
8
6
11
8
11
8
8
9
7
10
10
0
4
8
0
11
11
11
13
8
4
4
8
4
15
15
13
0
2
10
0
12
12
12
13
10
2
2
10
2
15
15
13
original direct full-scale contrast stretch
histogram-equalized
more equalize
d
Summary of the Histogram Equalization Algorithm
original image
histogram H(k)
cumulative histogram Q(k)
intermediate image
full-scale contrast stretch
histogram-equalized image