chap 4-2. frequency domain processing jen-chang liu, 2006
Post on 20-Dec-2015
226 views
TRANSCRIPT
![Page 1: Chap 4-2. Frequency domain processing Jen-Chang Liu, 2006](https://reader035.vdocuments.net/reader035/viewer/2022062407/56649d415503460f94a1b20d/html5/thumbnails/1.jpg)
Chap 4-2. Frequency domain processing
Jen-Chang Liu, 2006
![Page 2: Chap 4-2. Frequency domain processing Jen-Chang Liu, 2006](https://reader035.vdocuments.net/reader035/viewer/2022062407/56649d415503460f94a1b20d/html5/thumbnails/2.jpg)
Extend to 2-D DFT from 1-D
2-D DFT: 1-D DFT in horizontal then vertical
1
0
1
0
)(2),(
1),(
N
y
M
x
yM
vx
M
uj
eyxfMN
vuF
1
0
1
0
)(2),(),(
M
u
N
v
yM
vx
M
ujevuFyxf
![Page 3: Chap 4-2. Frequency domain processing Jen-Chang Liu, 2006](https://reader035.vdocuments.net/reader035/viewer/2022062407/56649d415503460f94a1b20d/html5/thumbnails/3.jpg)
Complex Quantities to Real Quantities
Useful representation2/122 )],(),([),( vuIvuRvuF
]),(
),([tan),( 1
vuR
vuIvu
magnitude
phase
),(),(),(),( 222vuIvuRvuFvuP
Power spectrum
![Page 4: Chap 4-2. Frequency domain processing Jen-Chang Liu, 2006](https://reader035.vdocuments.net/reader035/viewer/2022062407/56649d415503460f94a1b20d/html5/thumbnails/4.jpg)
Real part
2d DFT basis functions
127,...,2,1,0,127,...,2,1,0,),()
128
1
128
0(2
yxeyxeyxj
1
0
1
0
)(2),(),(
M
u
N
v
yM
vx
M
ujevuFyxf
iDFT:
將影像用 )(2 yN
vx
M
uje
合成,其中(u, v) 代表頻率
DFT
![Page 5: Chap 4-2. Frequency domain processing Jen-Chang Liu, 2006](https://reader035.vdocuments.net/reader035/viewer/2022062407/56649d415503460f94a1b20d/html5/thumbnails/5.jpg)
More DFT basis (real part)
(u,v)=(0,2)
(0,30)
u
v
(0,63)
(1,1)
(1,30)
(30,30)
(1,0)
![Page 6: Chap 4-2. Frequency domain processing Jen-Chang Liu, 2006](https://reader035.vdocuments.net/reader035/viewer/2022062407/56649d415503460f94a1b20d/html5/thumbnails/6.jpg)
Example: reconstruction from DFT coefficients
1
0
1
0
)(2),(),(
M
u
N
v
yM
vx
M
ujevuFyxf
…Zigzag scan
![Page 7: Chap 4-2. Frequency domain processing Jen-Chang Liu, 2006](https://reader035.vdocuments.net/reader035/viewer/2022062407/56649d415503460f94a1b20d/html5/thumbnails/7.jpg)
Example: reconstruction from DFT coefficients
http://www.ncnu.edu.tw/~jcliu/course/dip2005/lenaidft.m
![Page 8: Chap 4-2. Frequency domain processing Jen-Chang Liu, 2006](https://reader035.vdocuments.net/reader035/viewer/2022062407/56649d415503460f94a1b20d/html5/thumbnails/8.jpg)
Notes on showingDFT
Lena 256x256
F=fft2(I);imshow(abs(F), [])
F(1,1)=7761921 F(1,127)=334.79+10i
imshow(log(abs(F)), [])
![Page 9: Chap 4-2. Frequency domain processing Jen-Chang Liu, 2006](https://reader035.vdocuments.net/reader035/viewer/2022062407/56649d415503460f94a1b20d/html5/thumbnails/9.jpg)
Log transformations
s = c log(1+r)
Compress the dynamic range of images with large variation in pixel values
![Page 10: Chap 4-2. Frequency domain processing Jen-Chang Liu, 2006](https://reader035.vdocuments.net/reader035/viewer/2022062407/56649d415503460f94a1b20d/html5/thumbnails/10.jpg)
M
N
M/2
N/2
0
Periodicity and conjugate symmetry property of 2-D DFT
![Page 11: Chap 4-2. Frequency domain processing Jen-Chang Liu, 2006](https://reader035.vdocuments.net/reader035/viewer/2022062407/56649d415503460f94a1b20d/html5/thumbnails/11.jpg)
Outline
Frequency domain operations Smoothing Frequency Domain Filters Sharpening Frequency Domain Filters Homomorphic Filtering
![Page 12: Chap 4-2. Frequency domain processing Jen-Chang Liu, 2006](https://reader035.vdocuments.net/reader035/viewer/2022062407/56649d415503460f94a1b20d/html5/thumbnails/12.jpg)
mask coefficients
underlying neighborhood
X (product) output
![Page 13: Chap 4-2. Frequency domain processing Jen-Chang Liu, 2006](https://reader035.vdocuments.net/reader035/viewer/2022062407/56649d415503460f94a1b20d/html5/thumbnails/13.jpg)
Convolution – 2-D case
2d convolution 旋積
Masking operation
1
0
1
0
),(),(1
),(),(),(M
m
N
n
nymxhnmfMN
yxhyxfyxg
1
0
1
0
),(),(1
),(M
m
N
n
ynxmhnmfMN
yxg
![Page 14: Chap 4-2. Frequency domain processing Jen-Chang Liu, 2006](https://reader035.vdocuments.net/reader035/viewer/2022062407/56649d415503460f94a1b20d/html5/thumbnails/14.jpg)
Convolution theorem
),(),(),(),( vuHvuFyxhyxf
f:image
Fouriertransform
F
h: filter or mask
Fouriertransform
H
Timedomain
Frequencydomain
convolution
multiplication
![Page 15: Chap 4-2. Frequency domain processing Jen-Chang Liu, 2006](https://reader035.vdocuments.net/reader035/viewer/2022062407/56649d415503460f94a1b20d/html5/thumbnails/15.jpg)
Filtering in the frequency domain
fftshift
![Page 16: Chap 4-2. Frequency domain processing Jen-Chang Liu, 2006](https://reader035.vdocuments.net/reader035/viewer/2022062407/56649d415503460f94a1b20d/html5/thumbnails/16.jpg)
Outline
Frequency Domain Operations Smoothing Frequency Domain Filters Sharpening Frequency Domain Filters Homomorphic Filtering
![Page 17: Chap 4-2. Frequency domain processing Jen-Chang Liu, 2006](https://reader035.vdocuments.net/reader035/viewer/2022062407/56649d415503460f94a1b20d/html5/thumbnails/17.jpg)
Smoothing frequency-domain filters
Design issue G(u,v)=F(u,v) H(u,v) Remove high freq. component (details,
noise, …) Ideal low-pass filter Butterworth filter Gaussian filter
More smoothin the edge ofcut-off frequency
![Page 18: Chap 4-2. Frequency domain processing Jen-Chang Liu, 2006](https://reader035.vdocuments.net/reader035/viewer/2022062407/56649d415503460f94a1b20d/html5/thumbnails/18.jpg)
Ideal low-pass filter
Sharp cut-off frequency
0
0
),( if 0
),( if 1),(
DvuD
DvuDvuH
where D(u,v) is the distance to the center freq.
2/122 ])2/()2/[(),( NvMuvuD
![Page 19: Chap 4-2. Frequency domain processing Jen-Chang Liu, 2006](https://reader035.vdocuments.net/reader035/viewer/2022062407/56649d415503460f94a1b20d/html5/thumbnails/19.jpg)
Ideal low-pass filter (cont.)
Cut-off freq.
![Page 20: Chap 4-2. Frequency domain processing Jen-Chang Liu, 2006](https://reader035.vdocuments.net/reader035/viewer/2022062407/56649d415503460f94a1b20d/html5/thumbnails/20.jpg)
Ideal low-pass filter (con.t)
ILPF can not be realized in electronic components, but can be implemented in a computer
Decision of cut-off freq.? Measure the percentage of image power
within the low freq.
freqoffcutvu
TPvuP ),(
/)],([100
1
0
1
0
),(M
u
N
vT vuPPTotal image power
![Page 21: Chap 4-2. Frequency domain processing Jen-Chang Liu, 2006](https://reader035.vdocuments.net/reader035/viewer/2022062407/56649d415503460f94a1b20d/html5/thumbnails/21.jpg)
ILPF: distribution of image power
original Freq.
99.5
98
96.4
94.692
![Page 22: Chap 4-2. Frequency domain processing Jen-Chang Liu, 2006](https://reader035.vdocuments.net/reader035/viewer/2022062407/56649d415503460f94a1b20d/html5/thumbnails/22.jpg)
original =92D0=5
=94.6D0=15
=96.4D0=30
=98D0=80
=99.5D0=230
Ideal low-passfiltering
![Page 23: Chap 4-2. Frequency domain processing Jen-Chang Liu, 2006](https://reader035.vdocuments.net/reader035/viewer/2022062407/56649d415503460f94a1b20d/html5/thumbnails/23.jpg)
Ringingeffect
![Page 24: Chap 4-2. Frequency domain processing Jen-Chang Liu, 2006](https://reader035.vdocuments.net/reader035/viewer/2022062407/56649d415503460f94a1b20d/html5/thumbnails/24.jpg)
Effects of ideal low-pass filtering
Blurring and ringing
ILPF: Freq.
F-1
blurring
ringing
ILPF: spatial
![Page 25: Chap 4-2. Frequency domain processing Jen-Chang Liu, 2006](https://reader035.vdocuments.net/reader035/viewer/2022062407/56649d415503460f94a1b20d/html5/thumbnails/25.jpg)
Effects of ideal low-pass filtering (cont.)
spatial
impulse
ILPF
spatial
![Page 26: Chap 4-2. Frequency domain processing Jen-Chang Liu, 2006](https://reader035.vdocuments.net/reader035/viewer/2022062407/56649d415503460f94a1b20d/html5/thumbnails/26.jpg)
Butterworth low-pass filters
nDvuDvuH
20 ]/),([1
1),(
H=0.5 whenD(u,v)=D0
![Page 27: Chap 4-2. Frequency domain processing Jen-Chang Liu, 2006](https://reader035.vdocuments.net/reader035/viewer/2022062407/56649d415503460f94a1b20d/html5/thumbnails/27.jpg)
Order of butterworth filters
n=1 n=2 n=5 n=20
Spatial domain filter of butterworth filters
Ringing likeIdeal LPF
![Page 28: Chap 4-2. Frequency domain processing Jen-Chang Liu, 2006](https://reader035.vdocuments.net/reader035/viewer/2022062407/56649d415503460f94a1b20d/html5/thumbnails/28.jpg)
Butterworth filtersOrder = 2
original D0=5
D0=15 D0=30
D0=80 D0=230
![Page 29: Chap 4-2. Frequency domain processing Jen-Chang Liu, 2006](https://reader035.vdocuments.net/reader035/viewer/2022062407/56649d415503460f94a1b20d/html5/thumbnails/29.jpg)
Gaussian low-pass filters
20
2 2/),(),( DvuDevuH Variance orcut-off freq.
D(u,v)=D0
H = 0.607
![Page 30: Chap 4-2. Frequency domain processing Jen-Chang Liu, 2006](https://reader035.vdocuments.net/reader035/viewer/2022062407/56649d415503460f94a1b20d/html5/thumbnails/30.jpg)
Gaussian smoothing
original D0=5
D0=15 D0=30
D0=80 D0=230
![Page 31: Chap 4-2. Frequency domain processing Jen-Chang Liu, 2006](https://reader035.vdocuments.net/reader035/viewer/2022062407/56649d415503460f94a1b20d/html5/thumbnails/31.jpg)
Practical applications: 1
444x508 GLPF, D0=80
斷點
![Page 32: Chap 4-2. Frequency domain processing Jen-Chang Liu, 2006](https://reader035.vdocuments.net/reader035/viewer/2022062407/56649d415503460f94a1b20d/html5/thumbnails/32.jpg)
Practical applications: 2
GLPF, D0=100
GLPF, D0=80
1028x732
![Page 33: Chap 4-2. Frequency domain processing Jen-Chang Liu, 2006](https://reader035.vdocuments.net/reader035/viewer/2022062407/56649d415503460f94a1b20d/html5/thumbnails/33.jpg)
Practical applications: 3
588x600 GLPF, D0=30 GLPF, D0=10
Scan line
![Page 34: Chap 4-2. Frequency domain processing Jen-Chang Liu, 2006](https://reader035.vdocuments.net/reader035/viewer/2022062407/56649d415503460f94a1b20d/html5/thumbnails/34.jpg)
Outline
Frequency Domain Operations Smoothing Frequency Domain Filters Sharpening Frequency Domain Filters Homomorphic Filtering
![Page 35: Chap 4-2. Frequency domain processing Jen-Chang Liu, 2006](https://reader035.vdocuments.net/reader035/viewer/2022062407/56649d415503460f94a1b20d/html5/thumbnails/35.jpg)
Sharpening frequency-domain filters
Image details corresponds to high-frequency Sharpening: high-pass filters Hhp(u,v)=1-Hlp(u,v)
Ideal high-pass filters Butterworth high-pass filters Gaussian high-pass filters Difference filters
Laplacian filters
![Page 36: Chap 4-2. Frequency domain processing Jen-Chang Liu, 2006](https://reader035.vdocuments.net/reader035/viewer/2022062407/56649d415503460f94a1b20d/html5/thumbnails/36.jpg)
Ideal HPF
Butterworth HPF
Gaussian HPF
![Page 37: Chap 4-2. Frequency domain processing Jen-Chang Liu, 2006](https://reader035.vdocuments.net/reader035/viewer/2022062407/56649d415503460f94a1b20d/html5/thumbnails/37.jpg)
Spatial-domain HPF
ideal Butterworth Gaussian
negative
![Page 38: Chap 4-2. Frequency domain processing Jen-Chang Liu, 2006](https://reader035.vdocuments.net/reader035/viewer/2022062407/56649d415503460f94a1b20d/html5/thumbnails/38.jpg)
Ideal high-pass filters
0
0
),( if 1
),( if 0),(
DvuD
DvuDvuH
D0=15 D0=30 D0=80ringing
original
![Page 39: Chap 4-2. Frequency domain processing Jen-Chang Liu, 2006](https://reader035.vdocuments.net/reader035/viewer/2022062407/56649d415503460f94a1b20d/html5/thumbnails/39.jpg)
Butterworth high-pass filters
nvuDDvuH
20 )],(/[1
1),(
n=2, D0=15 D0=30 D0=80
![Page 40: Chap 4-2. Frequency domain processing Jen-Chang Liu, 2006](https://reader035.vdocuments.net/reader035/viewer/2022062407/56649d415503460f94a1b20d/html5/thumbnails/40.jpg)
Gaussian high-pass filters
20
2 2/),(1),( DvuDevuH
D0=15 D0=30 D0=80
![Page 41: Chap 4-2. Frequency domain processing Jen-Chang Liu, 2006](https://reader035.vdocuments.net/reader035/viewer/2022062407/56649d415503460f94a1b20d/html5/thumbnails/41.jpg)
Laplacian frequency-domain filters
Spatial-domain Laplacian (2nd derivative)
Fourier transform
2
2
2
22
y
f
x
ff
)()()(
uFjux
xf nn
n
),()(
),()(),()(),(),(
22
222
2
2
2
vuFvu
vuFjvvuFjuy
yxf
x
yxf
![Page 42: Chap 4-2. Frequency domain processing Jen-Chang Liu, 2006](https://reader035.vdocuments.net/reader035/viewer/2022062407/56649d415503460f94a1b20d/html5/thumbnails/42.jpg)
Laplacian frequency-domain filters
2
2
2
22
y
f
x
ff
Inputf(x,y)
Laplacian
F(u,v)F
F-(u2+v2)F(u,v)
-(u2+v2)
The Laplacian filter in the frequency domain isH(u,v) = -(u2+v2)
![Page 43: Chap 4-2. Frequency domain processing Jen-Chang Liu, 2006](https://reader035.vdocuments.net/reader035/viewer/2022062407/56649d415503460f94a1b20d/html5/thumbnails/43.jpg)
0
frequency
spatial
H(u,v) = -(u2+v2)
![Page 44: Chap 4-2. Frequency domain processing Jen-Chang Liu, 2006](https://reader035.vdocuments.net/reader035/viewer/2022062407/56649d415503460f94a1b20d/html5/thumbnails/44.jpg)
original Laplacian
ScaledLaplacian
original+Laplacian
![Page 45: Chap 4-2. Frequency domain processing Jen-Chang Liu, 2006](https://reader035.vdocuments.net/reader035/viewer/2022062407/56649d415503460f94a1b20d/html5/thumbnails/45.jpg)
Outline
Frequency Domain Operations Smoothing Frequency Domain Filters Sharpening Frequency Domain Filters Homomorphic Filtering
![Page 46: Chap 4-2. Frequency domain processing Jen-Chang Liu, 2006](https://reader035.vdocuments.net/reader035/viewer/2022062407/56649d415503460f94a1b20d/html5/thumbnails/46.jpg)
Image Formation Model
Illumination source
scene
reflection
eye
![Page 47: Chap 4-2. Frequency domain processing Jen-Chang Liu, 2006](https://reader035.vdocuments.net/reader035/viewer/2022062407/56649d415503460f94a1b20d/html5/thumbnails/47.jpg)
Homomorphic filtering
Image formation model f(x,y)=i(x,y) r(x,y)
illumination: reflectance:
Slow spatial variations vary abruptly, particularlyat the junctions of dissimilarobjects
![Page 48: Chap 4-2. Frequency domain processing Jen-Chang Liu, 2006](https://reader035.vdocuments.net/reader035/viewer/2022062407/56649d415503460f94a1b20d/html5/thumbnails/48.jpg)
Homomorphic filtering Product term
Log of product f(x,y)=i(x,y) r(x,y)=> ln f(x,y)=ln i(x,y)+ ln r(x,y)
)},({)},({)},(),({),( yxryxiyxryxiyxf
)},({ln)},({ln
)},(ln),({ln)},({ln
yxryxi
yxryxiyxf
Separation of signal source:
![Page 49: Chap 4-2. Frequency domain processing Jen-Chang Liu, 2006](https://reader035.vdocuments.net/reader035/viewer/2022062407/56649d415503460f94a1b20d/html5/thumbnails/49.jpg)
Homomorphic filtering approach
ln i(x,y)
ln r(x,y)
illumination
reflection
filtering
![Page 50: Chap 4-2. Frequency domain processing Jen-Chang Liu, 2006](https://reader035.vdocuments.net/reader035/viewer/2022062407/56649d415503460f94a1b20d/html5/thumbnails/50.jpg)
How to identify the illumination and reflection?
Illumination -> low frequency Reflection -> high frequency
Radius fromthe origin
Example filter: sharpening
illumination reflection
![Page 51: Chap 4-2. Frequency domain processing Jen-Chang Liu, 2006](https://reader035.vdocuments.net/reader035/viewer/2022062407/56649d415503460f94a1b20d/html5/thumbnails/51.jpg)
Homomophic filtering: example
original Homomorphic filtering