Upload
others
View
0
Download
0
Embed Size (px)
Citation preview
# 68 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
2.
Applying an Ideal Lowpass Filter
Filtering in the Frequency Domain
Input Image ⋅ (-1)x+y F(u,v)
# 69 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
2.
Applying an Ideal Lowpass Filter
Filtering in the Frequency Domain
F(u,v)
ideal lowpass filter
⋅ H(u,v)
# 70 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
2.
Applying an Ideal Lowpass Filter
Filtering in the Frequency Domain
F(u,v) G(u,v) = F(u,v) ⋅ H(u,v) ILPF
# 71 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
2.
G(u,v)
Applying an Ideal Lowpass Filter
Filtering in the Frequency Domain
f(x,y) Re[f(x,y)] ⋅ (-1)x+y
inverse DFT
# 72 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
2.
Ideal Lowpass Filter – "Ringing"
Filtering in the Frequency Domain
ideal lowpass filter (D0 = 15 px-1)
# 73 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
2.
Ideal Lowpass Filter – "Ringing"
Filtering in the Frequency Domain
ideal lowpass filter (D0 = 80 px-1)
# 74 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
2.
Convolution Theorem o establishes a fundamental relationship
between spatial and frequency domain
Link between Filtering in the Spatial Domain and the Frequency Domain? o to explain "ringing" effects o to better understand spatial filtering
Filtering in the Frequency Domain
# 75 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
2.
∫+∞
∞−
−=∗ ααα dxhfxhxf )()()()( Definition
o1D, continuous
» flip one function h about the origin » shift h with respect to f » compute the sum of products for each displacement x
Convolution
flip one function and slide it past the other
# 76 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
2.
Definition o1D, continuous
o2D, continuous
o2D, discrete
Convolution
∫+∞
∞−
−=∗ ααα dxhfxhxf )()()()(
βαβαβα ddyxhfyxhyxf ∫ ∫+∞
∞−
−−=∗ ),(),(),(),(
∑∑−
=
−
=
−−=∗1
0
1
0),(),(),(),(
M
m
N
nnymxhnmfyxhyxf
# 77 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
2.
∫+∞
∞−
−=∗ ααα dxhfxhxf )()()()( Definition
o1D, continuous
» flip one function h about the origin » shift h with respect to f » compute the sum of products for each displacement x
Convolution
# 78 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
2.
Derivation of the Convolution Theorem
Convolution Theorem – Derivation
∫+∞
∞−
⋅== dueuFuFxf uxjπ2)()]([)( 1-uF
∫+∞
∞−
⋅== dueuHuHxh uxjπ2)()]([)( 1-uF
# 79 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
2.
Derivation of the Convolution Theorem
Convolution Theorem – Derivation
( ) ( ) ( ') ( ') 'f x h x f x h x x dx+∞
−∞
∗ = −∫
∫+∞
∞−
⋅== dueuFuFxf uxjπ2)()]([)( 1-uF
∫+∞
∞−
⋅== dueuHuHxh uxjπ2)()]([)( 1-uF
# 80 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
2.
Derivation of the Convolution Theorem
Convolution Theorem – Derivation
( ) ( ) ( ') ( ') 'f x h x f x h x x dx+∞
−∞
∗ = −∫
∫+∞
∞−
⋅== dueuFuFxf uxjπ2)()]([)( 1-uF
∫+∞
∞−
⋅== dueuHuHxh uxjπ2)()]([)( 1-uF
replace h(x-x’) with the inverse FT of its Fourier transform
# 81 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
2.
Derivation of the Convolution Theorem
Convolution Theorem – Derivation
( ) ( ) ( ') ( ') 'f x h x f x h x x dx+∞
−∞
∗ = −∫
∫+∞
∞−
⋅== dueuFuFxf uxjπ2)()]([)( 1-uF
∫+∞
∞−
⋅== dueuHuHxh uxjπ2)()]([)( 1-uF
∫ ∫
∫∞+
∞−
∞+
∞−
−⋅
+∞
∞−
=
−=∗
')()'(
')'()'()()(
)'(2 dxdueuHxf
dxxxhxfxhxf
xxujπ
# 82 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
2.
Swap the order of integration ...
Convolution Theorem – Derivation
[ ])()()()(
')'()(
')()'(
')'()'()()(
12
2'2
)'(2
uHuFdueuFuH
duedxexfuH
dxdueuHxf
dxxxhxfxhxf
uxj
uxjuxj
xxuj
⋅==
=
=
−=∗
−∞+
∞−
⋅
∞+
∞−
⋅∞+
∞−
⋅−
∞+
∞−
∞+
∞−
−⋅
+∞
∞−
∫
∫ ∫
∫ ∫
∫
Fπ
ππ
π
replace h(x-x’) with its Fourier transform
identify F(u)
change integration order;
move the "x" part outside the dx'
integral
# 83 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
2.
Convolution Theorem
o convolution in the spatial domain equals
point-wise multiplication in the frequency domain and vice versa
owrap around problem needs to be considered ⇒ padding to the sum of the length of both functions f and h
Convolution Theorem
),(),(),(),( vuHvuFyxhyxf ⋅⇔∗
),(),(),(),( vuHvuFyxhyxf ∗⇔⋅
# 84 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
2.
Convolution Theorem – Wrap Around Problem o expected result?
Convolution Theorem
300 0
400
f(m)
200 0
400
h(m)
3
2
# 85 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
2.
Convolution Theorem – Wrap Around Problem o expected result?
Convolution Theorem
300 0
400
f(m)
-200 0
h(-m)
3
2
# 86 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
2.
Convolution Theorem – Wrap Around Problem o expected result
Convolution Theorem
200
0
400
f(m)
-200 0
3 h(-m)
0
f∗g
300
500 800
2
# 87 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
2.
Convolution Theorem – Wrap Around Problem o considering the implicit periodicity assumption
Convolution Theorem
200
0
400
f(m)
-200 0
h(-m)
0
f∗g
300
400
* range of Fourier transform computation
*
# 88 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
2.
Convolution Theorem – Wrap Around Problem o solution: padding
Convolution Theorem
300 0
400
f(m)
200 0
400
h(m)
3
2
800
800
# 89 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
2.
Convolution Theorem – Wrap Around Problem o expected result with padding
Convolution Theorem
300 0
400
f(m)
200 0 400
h(m) 3
2
800
800
f∗g * range of Fourier transform computation
*
# 90 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
2.
Convolution Theorem
onow we want to find a relation between h(x,y) and H(u,v) alone
Convolution Theorem
),(),(),(),( vuHvuFyxhyxf ⋅⇔∗
),(),(),(),( vuHvuFyxhyxf ∗⇔⋅
# 91 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
2.
Link between Filtering in the Spatial Domain and the Frequency Domain o impulse function δ
oparticularly
Relation Between Spatial and Frequency Filters
∑∑−
=
−
=
=−−1
0
1
00000 ),(),(),(
M
m
N
nyxfAyyxxAyxf δ
)0,0(),(),(1
0
1
0syxsyx
M
x
N
y∑∑
−
=
−
=
=δ
# 92 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
2.
Link Between Spatial and Frequency Domain o consider FT of the unit impulse function at (0,0)
» Fourier transform of an impulse at the origin
Relation Between Spatial and Frequency Filters
[ ]MN
eyxMN
yxM
x
N
y
MvyMuxj 1),(1),(1
0
1
0
)//(2∑∑−
=
−
=
+− == πδδF
# 93 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
2.
Link Between Spatial and Frequency Domain o consider FT of the unit impulse function at (0,0)
o convolution of the unit impulse function at (0,0)
» copies the convolution function h at x,y (up to the factor 1/M/N)
Relation Between Spatial and Frequency Filters
),(1
),(),(1),(),(1
0
1
0
yxhMN
nymxhnmMN
yxhyxM
m
N
n
=
−−=∗ ∑∑−
=
−
=
δδ
[ ]MN
eyxMN
yxM
x
N
y
MvyMuxj 1),(1),(1
0
1
0
)//(2∑∑−
=
−
=
+− == πδδF
# 94 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
2.
Link Between Spatial and Frequency Domain o from the last slide
Relation Between Spatial and Frequency Filters
[ ]MN
yx 1),( =δF ),(1),(),( yxhMN
yxhyx =∗δ
# 95 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
2.
Link Between Spatial and Frequency Domain o from the last slide
ousing the convolution theorem
Relation Between Spatial and Frequency Filters
),(),(),(),( vuHvuFyxhyxf ⋅⇔∗
[ ]MN
yx 1),( =δF ),(1),(),( yxhMN
yxhyx =∗δ
# 96 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
2.
Link Between Spatial and Frequency Domain o from the last slide
ousing the convolution theorem
Relation Between Spatial and Frequency Filters
[ ] ),(),(),(),( vuHvuyxhyx ⋅⇔∗ δδ F),(),( yxyxf δ=
[ ]MN
yx 1),( =δF ),(1),(),( yxhMN
yxhyx =∗δ
),(),(),(),( vuHvuFyxhyxf ⋅⇔∗
# 97 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
2.
Link Between Spatial and Frequency Domain o from the last slide
ousing the convolution theorem
Relation Between Spatial and Frequency Filters
[ ]MN
yx 1),( =δF ),(1),(),( yxhMN
yxhyx =∗δ
),(),(),(),( vuHvuFyxhyxf ⋅⇔∗
[ ] ),(),(),(),( vuHvuyxhyx ⋅⇔∗ δδ F),(),( yxyxf δ=
),(1),(1 vuHMN
yxhMN
⇔
# 98 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
2.
Link Between Spatial and Frequency Domain
o filters in the spatial and the frequency domain constitute a Fourier pair
o from a filter in the frequency domain, an equivalent filter in the spatial domain can be obtained (F -1[H(u,v)] )
o all involved filters are linear o all involved filters are of the size M×N
⇒ not necessarily faster to use the spatial filter
Relation Between Spatial and Frequency Filters
),(),( vuHyxh ⇔
# 99 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
2.
Gaussian Filters
Relation Between Spatial and Frequency Filters
22 2/)( σueAuH −=
# 100 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
2.
Gaussian Filters
o Fourier transform of a real Gaussian is a real Gaussian oH(u) and h(x) behave reciprocal in terms of width onarrow frequency domain filter
⇒ attenuate high frequencies ⇒ blurring of an image (after inverse Fourier transform) ⇒ implies a larger mask
Relation Between Spatial and Frequency Filters
22222)( xeAxh σπσπ −=⇔ 22 2/)( σueAuH −=
# 101 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
2.
Gaussian Filters
o Fourier transform of a real Gaussian is a real Gaussian oH(u) and h(x) behave reciprocal in terms of width onarrow frequency domain filter
⇒ attenuate high frequencies ⇒ blurring of an image (after inverse Fourier transform) ⇒ implies a larger mask
owhat happens if σ→∞ ?
Relation Between Spatial and Frequency Filters
22222)( xeAxh σπσπ −=⇔ 22 2/)( σueAuH −=
# 102 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
2.
Basic Steps
Filtering in the Frequency Domain
Input Image ⋅ (-1)x+y F(u,v)
center the transform DFT
⋅ H(u,v)
apply filter
f(x,y)
inverse DFT
Re[f(x,y)]
Output Image
⋅ (-1)x+y
# 103 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
2.
Basic Steps
Filtering in the Frequency Domain
f = imread('bubbles.tif'); imshow(f,[]);[M N] = size(f);
# 104 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
2.
Basic Steps
Filtering in the Frequency Domain
f = imread('bubbles.tif'); imshow(f,[]);[M N] = size(f); F = fft2(f); figure; imshow(log(1 + abs(fftshift(F))),[]);
# 105 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
2.
Basic Steps
Filtering in the Frequency Domain
f = imread('bubbles.tif'); imshow(f,[]);[M N] = size(f); F = fft2(f); figure; imshow(log(1 + abs(fftshift(F))),[]); sig = 10; H = lpfilter('gaussian', M, N, sig); figure; imshow(fftshift(H),[]);
# 106 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
2.
Basic Steps
Filtering in the Frequency Domain
f = imread('bubbles.tif'); imshow(f,[]);[M N] = size(f); F = fft2(f); figure; imshow(log(1 + abs(fftshift(F))),[]); sig = 10; H = lpfilter('gaussian', M, N, sig); figure; imshow(fftshift(H),[]); G = H.*F; g = real(ifft2(G)); figure; imshow(g,[]);
# 107 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
2.
Basic Steps
Filtering in the Frequency Domain
f = imread('bubbles.tif'); imshow(f,[]);[M N] = size(f); F = fft2(f); figure; imshow(log(1 + abs(fftshift(F))),[]); sig = 100; H = lpfilter('gaussian', M, N, sig); figure; imshow(fftshift(H),[]); G = H.*F; g = real(ifft2(G)); figure; imshow(g,[]);
# 108 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
2.
Basic Steps
Filtering in the Frequency Domain
f = imread('bubbles.tif'); imshow(f,[]);[M N] = size(f); F = fft2(f); figure; imshow(log(1 + abs(fftshift(F))),[]); sig = 10; H = lpfilter('gaussian', M, N, sig); figure; imshow(fftshift(H),[]); G = H.*F; g = real(ifft2(G)); figure; imshow(g,[]);
# 109 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
2.
Basic Steps
Filtering in the Frequency Domain
f = imread('bubbles.tif'); imshow(f,[]);[M N] = size(f); F = fft2(f); figure; imshow(log(1 + abs(fftshift(F))),[]); sig = 3; H = lpfilter('gaussian', M, N, sig); figure; imshow(fftshift(H),[]); G = H.*F; g = real(ifft2(G)); figure; imshow(g,[]);
# 110 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
2.
Ideal Lowpass Filter – "Ringing" (re-visited)
Relation Between Spatial and Frequency Filters
ideal lowpass filter
# 111 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
2.
Link Between Spatial and Frequency Domain
o filters in the spatial and the frequency domain constitute a Fourier pair
o from a filter in the frequency domain, an equivalent filter in the spatial domain can be obtained (F -1[H(u,v)] )
Relation Between Spatial and Frequency Filters
),(),( vuHyxh ⇔
# 112 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
2.
Ideal Lowpass Filter – "Ringing"
Relation Between Spatial and Frequency Filters
f = imread('bubbles.tif'); % only to get dimensions [M N] = size(f); D0 = 12; Hilp = lpfilter('ideal', M, N, D0); figure; imshow(fftshift(Hilp),[]);
# 113 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
2.
Ideal Lowpass Filter – "Ringing"
Relation Between Spatial and Frequency Filters
f = imread('bubbles.tif'); % only to get dimensions [M N] = size(f); D0 = 12; Hilp = lpfilter('ideal', M, N, D0); hilp = ifft2(Hilp); figure; imshow(ifftshift(abs(hilp)), []);
# 114 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
2.
Ideal Lowpass Filter – "Ringing"
Relation Between Spatial and Frequency Filters
f = imread('bubbles.tif'); % only to get dimensions [M N] = size(f); D0 = 12; Hilp = lpfilter('ideal', M, N, D0); hilp = ifft2(Hilp); figure; imshow(log(1 + ifftshift(abs(hilp))), []);
# 115 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
2.
Ideal Lowpass Filter – "Ringing"
Relation Between Spatial and Frequency Filters
),( vuH ILPF
→
),( yxhILPF
F -1
# 116 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
2.
Ideal Lowpass Filter – Avoid "Ringing"
Relation Between Spatial and Frequency Filters
# 118 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
2.
Gaussian Lowpass Filter
ono ringing
Relation Between Spatial and Frequency Filters
ideal lowpass filter Gaussian lowpass filter
# 127 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
2.
Highpass Filters o suppress low frequencies
⇒ edge enhancing o reverse of a lowpass filter
o ideal, Gaussian
Filtering in the Frequency Domain
),(1),( vuHvuH lphp −=
# 129 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
2.
Ideal Highpass Filter (IHPF)
o ideal highpass filter (also shows "ringing")
Filtering in the Frequency Domain
>⇔≤⇔=
0
0
),(1),(0),( DvuD
DvuDvuH
# 130 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
2.
Highpass Filters
Filtering in the Frequency Domain
# 131 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
2.
Highpass Filters – IHPF
Filtering in the Frequency Domain
# 132 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
2.
Highpass Filters – IHPF
Filtering in the Frequency Domain
# 134 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
2.
Gaussian Highpass Filter
o smoother and no "ringing"
Filtering in the Frequency Domain
20
2 2/),(1),( DvuDevuH −−=
# 135 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
2.
Derivatives and their Fourier Transform
Laplacian in the Fourier Domain
Relation Between Spatial and Frequency Filters
[ ])()()( xfujdx
xfd nn
n
FF =
)(),( 22 vuvuH Laplacian +−=⇒
),()()],([ 222 vuFvuyxf +−=∇F
# 136 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
2.
Derivatives and their Fourier Transform
Laplacian in the Fourier Domain
Relation Between Spatial and Frequency Filters
[ ])()()( xfujdx
xfd nn
n
FF =
( ) ( ) ( )vuFNvMuyxf ,22),(222
−+−−⇔∇
# 137 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
2.
Laplacian in the Fourier Domain
Relation Between Spatial and Frequency Filters
# 138 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
2.
Laplacian in the Spatial Domain
Laplacian in the Fourier Domain
( ) ( ) yxvuvu ++− −−+− 1]1)([ 221F
# 139 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
2.
General Idea o select a filter in the frequency domain o transform this filter to the spatial domain o try to specify a small filter mask
that captures the "essence" of the filter function
Deriving Spatial Filter Masks
# 140 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
2.
Other Filters obandpass
» allows frequencies in a band between the two frequencies D0 and D1
obandstop: » stops frequencies in a band
between the two frequencies D0 and D1
onon-symmetric filters: allow different frequencies in the u and v direction
Filtering in the Frequency Domain
# 141 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
Recovering Intrinsic Images, Homomorphic Filtering
3
# 142 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
3.
Reminder: Image Formation Model o illumination i(x,y) from a source o reflectivity r(x,y) = reflection / absorption in the scene f(x,y) = r(x,y) i(x,y)
Image Formation
# 143 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
3.
Intrinsic Images o "midlevel description" of scenes
» proposed by Barrow and Tenebaum [H.G. Barrow and J.M. Tenenbaum. Recovering Intrinsic Scene Characteristics from Images". In Computer Vision Systems. Academic Press, 1978]
» not a full 3D description of the scene » viewpoint dependent » physical causes of changes in illumination are not made explicit
Intrinsic Images
# 144 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
3.
Intrinsic Images o "midlevel description" of scenes
» proposed by Barrow and Tenebaum [H.G. Barrow and J.M. Tenenbaum. Recovering Intrinsic Scene Characteristics from Images". In Computer Vision Systems. Academic Press, 1978]
o "The observed image is a product of two images: an illumination image and a reflectance image."
Intrinsic Images
# 145 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
3.
Intrinsic Images o "midlevel description" of scenes o (input) image is decomposed into two images …
Intrinsic Images
from "Deriving Intrinsic Images From Image Sequences", Yair Weiss , Proc. ICCV 2001
# 146 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
3.
Intrinsic Images o "midlevel description" of scenes o (input) image is decomposed into two images …
» a reflectance image
Intrinsic Images
r(x,y)
from "Deriving Intrinsic Images From Image Sequences", Yair Weiss , Proc. ICCV 2001
# 147 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
3.
Intrinsic Images o "midlevel description" of scenes o (input) image is decomposed into two images …
» a reflectance image and » an illumination image
Intrinsic Images
r(x,y) i(x,y)
from "Deriving Intrinsic Images From Image Sequences", Yair Weiss , Proc. ICCV 2001
# 148 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
3.
Intrinsic Images o "midlevel description" of scenes o "The observed image is a product of two images: an illumination
image and a reflectance image." » segmentation on the intrinsic reflectance should be much simpler than on
the original image » 3D information can be obtained from the illumination picture
Intrinsic Images
r(x,y) i(x,y)
from "Deriving Intrinsic Images From Image Sequences", Yair Weiss , Proc. ICCV 2001
# 149 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
3.
Intrinsic Images o "midlevel description" of scenes o (input) image is decomposed into two images …
» a reflectance image and » an illumination image
o but: decomposition is an ill-posed problem » number of unknowns is twice as high as the number of equations
(for example: set i(x,y) = 1 r(x,y) = f(x,y))
Intrinsic Images
),(),(),( yxryxiyxf =
# 150 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
3.
Idea: Separate Illumination and Reflectance
onot separable directly …
o… but the logarithm is separable
Homomorphic Filtering
),(),(),( yxryxiyxf =
)],([)],([)],([ yxryxiyxf FFF ≠
[ ]),(ln),( yxfyxz ≡
[ ][ ] [ ][ ]),(),(),(),(ln),(ln)],([
vuFvuFvuZyxryxiyxz
ri +==+= FFF
# 151 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
3.
Frequency Domain Approximation to Homomorphic Filtering – Assumption o illumination component varies slowly o reflectance component
tends to vary abruptly ⇒ use filter that affects
low- and high-frequency components in a different way (decreases influence of illumination, increases influence of reflectance)
Homomorphic Filtering
),(),(),( yxryxiyxf =
γL<1
γH >1
# 153 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
3.
Idea: Separate Illumination and Reflectance
Homomorphic Filtering
[ ][ ] [ ][ ]),(ln),(ln),(),(),( yxryxivuFvuFvuZ ri FF +=+=
),(),(),(),(),(),(),( vuFvuHvuFvuHvuZvuHvuS ri +==
[ ] [ ] [ ]),('),('
),(),(),(),(),(),( 111
yxryxivuFvuHvuFvuHvuSyxs ri
+=+== −−− FFF
),('),('),(),( zxrzxiyxs eeeyxg ==
# 154 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
3.
Example o consider non-uniform illumination
Homomorphic Filtering
disturbance pattern
# 155 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
3.
Example o histogram equalization does not perform well
Homomorphic Filtering
histogram equalization
# 156 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
3.
Example o homomorphic filtering
Homomorphic Filtering
homomorphic filtering
# 157 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
3.
Example o homomorphic filtering
Homomorphic Filtering
homomorphic filtering, then histogram equalization
# 160 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
3.
Recovering Intrinsic Images from a Single Image ["Recovering Intrinsic Images from a Single Image", Marshall F. Tappen, William T Freeman, Edward H Adelson, MIT AI Memo, 2002, http://hdl.handle.net/1721.1/6703]
o use colour information
Remarks
# 161 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
3.
Recovering Intrinsic Images from a Single Image ["Recovering Intrinsic Images from a Single Image", Marshall F. Tappen, William T Freeman, Edward H Adelson, MIT AI Memo, 2002, http://hdl.handle.net/1721.1/6703]
o use colour information » find chromaticity changes by classifying image derivatives by thresholding
scalar product of normalized RGB vector neighbours
Remarks
# 162 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
3.
Recovering Intrinsic Images from a Single Image ["Recovering Intrinsic Images from a Single Image", Marshall F. Tappen, William T Freeman, Edward H Adelson, MIT AI Memo, 2002, http://hdl.handle.net/1721.1/6703]
o use colour information » find chromaticity changes by classifying image derivatives by thresholding
scalar product of normalized RGB vector neighbours
Remarks
# 163 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
3.
Recovering Intrinsic Images from a Single Image ["Recovering Intrinsic Images from a Single Image", Marshall F. Tappen, William T Freeman, Edward H Adelson, MIT AI Memo, 2002, http://hdl.handle.net/1721.1/6703]
o use colour information o learn appearance models of shading patterns
» classify gray-scale image
Remarks
# 164 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
3.
Recovering Intrinsic Images from a Single Image ["Recovering Intrinsic Images from a Single Image", Marshall F. Tappen, William T Freeman, Edward H Adelson, MIT AI Memo, 2002, http://hdl.handle.net/1721.1/6703]
o use colour information o learn appearance models of shading patterns
» classify gray-scale image
Remarks
# 165 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
3.
Recovering Intrinsic Images from a Single Image ["Recovering Intrinsic Images from a Single Image", Marshall F. Tappen, William T Freeman, Edward H Adelson, MIT AI Memo, 2002, http://hdl.handle.net/1721.1/6703]
o use colour information o learn appearance models of shading patterns
» classify gray-scale image
Remarks
# 166 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
3.
Recovering Intrinsic Images from a Single Image ["Recovering Intrinsic Images from a Single Image", Marshall F. Tappen, William T Freeman, Edward H Adelson, MIT AI Memo, 2002, http://hdl.handle.net/1721.1/6703]
o use colour information o learn appearance models of shading patterns
» classify gray-scale image o propagate evidence (MRF model with learned parameters)
Remarks
# 167 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
3.
Recovering Intrinsic Images from a Single Image ["Recovering Intrinsic Images from a Single Image", Marshall F. Tappen, William T Freeman, Edward H Adelson, MIT AI Memo, 2002, http://hdl.handle.net/1721.1/6703]
o use colour information + o learn appearance models of shading patterns + o propagate evidence (MRF model with learned parameters)
Remarks
# 168 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
3.
Recovering Intrinsic Images from a Single Image ["Recovering Intrinsic Images from a Single Image", Marshall F. Tappen, William T Freeman, Edward H Adelson, MIT AI Memo, 2002, http://hdl.handle.net/1721.1/6703]
o use colour information + o learn appearance models of shading patterns + o propagate evidence (MRF model with learned parameters)
Remarks
# 169 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
3.
Recovering Intrinsic Images from a Single Image ["Recovering Intrinsic Images from a Single Image", Marshall F. Tappen, William T Freeman, Edward H Adelson, MIT AI Memo, 2002, http://hdl.handle.net/1721.1/6703]
o use colour information + o learn appearance models of shading patterns + o propagate evidence (MRF model with learned parameters)
Remarks
# 170 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
3.
Recovering Intrinsic Images from a Single Image ["Recovering Intrinsic Images from a Single Image", Marshall F. Tappen, William T Freeman, Edward H Adelson, MIT AI Memo, 2002, http://hdl.handle.net/1721.1/6703]
Remarks
# 171 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
3.
Recovering Intrinsic Images from a Single Image ["Recovering Intrinsic Images from a Single Image", Marshall F. Tappen, William T Freeman, Edward H Adelson, MIT AI Memo, 2002, http://hdl.handle.net/1721.1/6703]
Remarks
# 172 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
3.
Recovering Intrinsic Images from a Single Image ["Recovering Intrinsic Images from a Single Image", Marshall F. Tappen, William T Freeman, Edward H Adelson, MIT AI Memo, 2002, http://hdl.handle.net/1721.1/6703]
Remarks
# 173 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
Properties of the Fourier Transform
4
# 175 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
4.
Translation
Properties of the Fourier Transform
a shift in f(x,y) does not affect |F(u,v)|
)//(200
00),(),( NyvMxujevuFyyxxf +−⇔−− π
# 176 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
4.
Translation o a shift in f(x,y)
does not affect the spectrum |F(u,v)|
Properties of the Fourier Transform
# 177 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
4.
Distributive Over Addition
Not Distributive Over Multiplication
Scaling
Rotation
Properties of the Fourier Transform
)],([)],([)],(),([ 2121 yxfyxfyxfyxf FFF +=+
)],([)],([)],(),([ 2121 yxfyxfyxfyxf FFF ≠
),(),( vuaFyxaf ⇔ )/,/(1),( bvauFab
byaxf ⇔
),(),( 00 θϕωθθ +⇔+ Frf
# 178 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
4.
Rotation
Properties of the Fourier Transform
rotating f(x,y) rotates F(u,v) by the same angle
F(u,v)
f(x,y)
# 179 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
4.
),(),(),(),( NvMuFNvuFvMuFvuF ++=+=+=
),(),(),(),( NyMxfNyxfyMxfyxf ++=+=+=
),(),( * vuFvuF −−= ),(),( * vuFvuF −−=⇒
Periodicity
o the discrete Fourier transform is periodic o also the inverse of the discrete Fourier transform is periodic
Conjugate Symmetry
o the spectrum is symmetric about the origin
Properties of the Fourier Transform
# 180 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
4.
Separability
o F(x,v) is the Fourier transform along one row o F(u,v) can be obtained by two successive applications of
the simple 1D Fourier transform instead of by one application of the more complex 2D Fourier transform
Properties of the Fourier Transform
[ ][ ]),(),(1
),(11
),(1),(
1
0
/2
1
0
/21
0
/2
1
0
1
0
)//(2
yxfvxFeM
eyxfN
eM
eyxfMN
vuF
vu
M
x
Muxj
N
y
NvyjM
x
Muxj
M
x
N
y
NvyMuxj
FF==
==
==
∑
∑∑
∑∑
−
=
−
−
=
−−
=
−
−
=
−
=
+−
π
ππ
π
# 182 DIP'14 © A. J. Lilienthal (Dec 4, 2014)
4.
Fourier Transform
Properties of the Fourier Transform
from "Computer Vision – A Modern Approach", Forsyth and Ponce, Prentice Hall, 2002
( )1 ,box x ysin sinu v
u v( )( ),u vF f a b
ab