Professional Documents
Culture Documents
03 Enhancement
03 Enhancement
03 Enhancement
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
3.1 Background
3.2 Some basic gray level transformations
3.3 Histogram processing
3.4 Enhancement using arithmetic/logic operations
3.5 Basics of spatial filtering
3.6 Smoothing spatial filters
3.7 Sharpening spatial filters
3.8 Combining spatial enhancement methods
1
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
3.1 Background
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
3.1 Background
2
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
3.1 Background
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
3.1 Background
3
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
3.1 Background
1 1 1
9 9 9
Mask = 1 1 1
9 9 9
1
Original Image 19 1
9 9 Processed Image
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
4
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
s = (L − 1) − r (3.2 - 1)
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
5
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
s = c log(1 + r ) (3.2 - 2)
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
6
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
s = cr γ (3.2 - 3)
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
7
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
8
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
Contrast Stretching
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
9
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
Gray-level slicing
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
10
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
Bit-plane slicing
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
11
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
h(rk ) = nk
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
12
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
Transformation Function
s = T (r ) 0 ≤ r ≤1 (3.3 - 1)
Conditions:
(a) T(r) is single valued and
monotonically increasing
(b) 0 ≤ T(r) ≤ 1 for 0 ≤ r ≤ 1
Inverse function
r = T −1 (s ) 0 ≤ s ≤1 (3.3 - 2)
*不一定符合條件(a)或(b)
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
PDFs(機率密度函式) of r and s
r的機率密度函式: pr (r )
s的機率密度函式:ps (s ) = pr (r ) dr (3.3 - 3)
ds
s的機率密度函式為所有經3.3-1公式轉換後會對映到s值之所
有r值之機率密度函式的總和
13
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
*符合條件(a)與(b)
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
ps (s ) = pr (r )
dr
ds
14
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
Discrete Version
0 ≤ sk ≤ 1
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
Histogram Equalization
to produce an output image that has a uniform
histogram
像素值均勻分佈可拉大影像明暗對比
procedures
求影像的Histogram
求影像的機率密度函數
產生CDF(累積密度函數)T()
使用T()處理每個像素
15
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
16
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
17
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
Discrete Version
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
18
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
Implementation
1.取得影像的Histogram
2.使用公式(3.3-13)計算每個 sk
3.使用公式(3.3-14)取得pz(z)的轉換函式G
4.使用公式(3.3-17)計算每個 zk
5.使用步驟2-4的結果處理每個像素
取得 rk 的對映像素sk
取得 sk的對映像素zk
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
19
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
20
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
步驟:1.定義方型或矩型的大小
2.針對每個像素
2.1.找出以目前像素為中心點之區塊內像素的histogram
2.2.使用histogram equalization/matching 方法取得像素對應值
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
使用像素統計資訊
N-Norm
mean value
2-Norm
Standard Deviation
21
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
22
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
23
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
24
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
平均結果
25
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
26
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
Mask
filter, kernel, templete, window
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
Mask
filter, kernel, templete, window
converlution mask/kernel
27
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
28
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
Mask大小與影像平滑效果的關係
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
29
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
30
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
Second-order derivative
31
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
32
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
33
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
34
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
35
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
36
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
for 3 x 3 masks
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
37
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
水平強度
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
垂直強度
38
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
Digital
Digital Image
Image Processing,
Processing, 2nd
2nd ed.
ed. www.imageprocessingbook.com
39