99
# 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)

Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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)

Page 2: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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)

Page 3: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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

Page 4: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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

Page 5: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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)

Page 6: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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)

Page 7: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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

Page 8: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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

Page 9: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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

Page 10: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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

Page 11: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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

Page 12: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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

Page 13: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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

Page 14: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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π

Page 15: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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

⋅==

=

=

−=∗

−∞+

∞−

∞+

∞−

⋅∞+

∞−

⋅−

∞+

∞−

∞+

∞−

−⋅

+∞

∞−

∫ ∫

∫ ∫

ππ

π

replace h(x-x’) with its Fourier transform

identify F(u)

change integration order;

move the "x" part outside the dx'

integral

Page 16: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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 ∗⇔⋅

Page 17: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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

Page 18: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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

Page 19: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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

Page 20: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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

*

Page 21: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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

Page 22: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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

*

Page 23: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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 ∗⇔⋅

Page 24: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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∑∑

=

=

Page 25: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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

Page 26: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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

Page 27: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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 =∗δ

Page 28: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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 =∗δ

Page 29: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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 ⋅⇔∗

Page 30: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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

Page 31: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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 ⇔

Page 32: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 99 DIP'14 © A. J. Lilienthal (Dec 4, 2014)

2.

Gaussian Filters

Relation Between Spatial and Frequency Filters

22 2/)( σueAuH −=

Page 33: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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 −=

Page 34: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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 −=

Page 35: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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

Page 36: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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);

Page 37: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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))),[]);

Page 38: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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),[]);

Page 39: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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,[]);

Page 40: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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,[]);

Page 41: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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,[]);

Page 42: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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,[]);

Page 43: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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

Page 44: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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 ⇔

Page 45: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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),[]);

Page 46: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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)), []);

Page 47: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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))), []);

Page 48: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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

Page 49: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 116 DIP'14 © A. J. Lilienthal (Dec 4, 2014)

2.

Ideal Lowpass Filter – Avoid "Ringing"

Relation Between Spatial and Frequency Filters

Page 50: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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

Page 51: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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 −=

Page 52: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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

Page 53: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 130 DIP'14 © A. J. Lilienthal (Dec 4, 2014)

2.

Highpass Filters

Filtering in the Frequency Domain

Page 54: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 131 DIP'14 © A. J. Lilienthal (Dec 4, 2014)

2.

Highpass Filters – IHPF

Filtering in the Frequency Domain

Page 55: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 132 DIP'14 © A. J. Lilienthal (Dec 4, 2014)

2.

Highpass Filters – IHPF

Filtering in the Frequency Domain

Page 56: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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 −−=

Page 57: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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

Page 58: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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

−+−−⇔∇

Page 59: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 137 DIP'14 © A. J. Lilienthal (Dec 4, 2014)

2.

Laplacian in the Fourier Domain

Relation Between Spatial and Frequency Filters

Page 60: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 138 DIP'14 © A. J. Lilienthal (Dec 4, 2014)

2.

Laplacian in the Spatial Domain

Laplacian in the Fourier Domain

( ) ( ) yxvuvu ++− −−+− 1]1)([ 221F

Page 61: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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

Page 62: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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

Page 63: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 141 DIP'14 © A. J. Lilienthal (Dec 4, 2014)

Recovering Intrinsic Images, Homomorphic Filtering

3

Page 64: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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

Page 65: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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

Page 66: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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

Page 67: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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

Page 68: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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

Page 69: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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

Page 70: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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

Page 71: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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 =

Page 72: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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

Page 73: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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

Page 74: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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 ==

Page 75: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 154 DIP'14 © A. J. Lilienthal (Dec 4, 2014)

3.

Example o consider non-uniform illumination

Homomorphic Filtering

disturbance pattern

Page 76: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 155 DIP'14 © A. J. Lilienthal (Dec 4, 2014)

3.

Example o histogram equalization does not perform well

Homomorphic Filtering

histogram equalization

Page 77: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 156 DIP'14 © A. J. Lilienthal (Dec 4, 2014)

3.

Example o homomorphic filtering

Homomorphic Filtering

homomorphic filtering

Page 78: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 157 DIP'14 © A. J. Lilienthal (Dec 4, 2014)

3.

Example o homomorphic filtering

Homomorphic Filtering

homomorphic filtering, then histogram equalization

Page 79: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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

Page 80: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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

Page 81: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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

Page 82: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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

Page 83: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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

Page 84: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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

Page 85: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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

Page 86: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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

Page 87: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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

Page 88: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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

Page 89: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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

Page 90: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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

Page 91: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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

Page 92: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 173 DIP'14 © A. J. Lilienthal (Dec 4, 2014)

Properties of the Fourier Transform

4

Page 93: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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 +−⇔−− π

Page 94: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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

Page 95: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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

Page 96: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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)

Page 97: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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

Page 98: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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==

==

==

∑∑

∑∑

=

=

−−

=

=

=

+−

π

ππ

π

Page 99: Applying an Ideal Lowpass Filter130.243.105.49/Research/Learning/courses/dip/2014/... · DIP'14 © A. J. Lilienthal (Dec 4, 2014) # 69. 2. Applying an Ideal Lowpass Filter . Filtering

# 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