106
1

Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

  • Upload
    vuminh

  • View
    218

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

1

Page 2: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

2

Homeworks

• Problem set 1 returned today. Mean: 85. Std dev: 15• Problem set 1 solutions posted (with password

protection) by Tuesday• Note revisions to problem set 2 matlab assignment

– To clarify the problems and make them work out cleaner for you.

– Modifying an existing solution to the revised version will be very simple.

Page 3: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

3

Shape from shading

Page 4: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

4

A shape-from-shading algorithm( ) ( ) ( ) ( )( )2

,1,2

,,12

,1,2

,,1, 41

jijijijijijijijiji qqqqpppps −+−+−+−= ++++

local surface smoothness( )( )2, ijijsijij qpREr −= local fidelity to image data

( )∑∑ +=i j

ijij rse λ global function to minimize

( ) ( )( )

( ) ( )( )qRqpREqq

qe

pRqpREpp

pe

sklklsklklkl

kl

sklklsklklkl

kl

∂∂

−−−=∂∂

∂∂

−−−=∂∂

,22

,22

λ

λ

derivative w.r.t. surface parameters

( )( )

( )( )qRqpREqq

pRqpREpp

sklklsklklkl

sklklsklklkl

∂∂

−+=

∂∂

−+=

,

,

λ

λ

set derivatives equal to zero.

Iterative algorithm

( )( )

( )( )qRqpREqq

pRqpREpp

snkl

nklskl

nkl

nkl

snkl

nklskl

nkl

nkl

∂∂

−+=

∂∂

−+=

+

+

,

,

1

1

λ

λ

Page 5: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

5

• Show fig. 11-10, 11-11.

Horn, 1986

Results using this approach

Page 6: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

6

2-d animation

Copyrighted … yada yada yada

Page 7: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

7

3-d animation

Page 8: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

8

Image filtering

• Reading: – Chapter 7, F&P

• Recommended Reading: – Chapter 7, 8 Horn

Oct. 3, 2002MIT 6.801/6.866Profs. Freeman and Darrell

Page 9: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

9

Take 6.341, discrete-time signal processing

• If you want to process pixels, you need to understand signal processing well, so – Take 6.341

• Fantastic set of teachers:– Al Oppenheim – Greg Wornell– Jae Lim

• Web page: http://web.mit.edu/6.341/www/

Page 10: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

10

What is image filtering?

• Modify the pixels in an image based on some function of a local neighborhood of the pixels.

5 141 71

5 310

Local image data

7

Modified image data

Some function

Page 11: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

11

Linear functions• Simplest: linear filtering.

– Replace each pixel by a linear combination of its neighbors.

• The prescription for the linear combination is called the “convolution kernel”.

5 141 71

5 310

0.50.5 0010

0 00

Local image data kernel

7

Modified image data

Page 12: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

12

Convolution

∑ −−=⊗=lk

lkglnkmIgInmf,

],[],[],[

Page 13: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

13

Linear filtering (warm-up slide)

?0

Pixel offset

coef

ficie

nt1.0

original

Page 14: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

14

Linear filtering (warm-up slide)

0Pixel offset

coef

ficie

nt1.0

original Filtered(no change)

Page 15: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

15

Linear filtering

0Pixel offset

coef

ficie

nt

1.0

?original

Page 16: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

16

shift

0Pixel offset

coef

ficie

nt

1.0

original shifted

Page 17: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

17

Linear filtering

0Pixel offset

coef

ficie

nt0.3 ?

original

Page 18: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

18

Blurring

0Pixel offset

coef

ficie

nt0.3

original Blurred (filterapplied in both dimensions).

Page 19: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

19

Blur examples2.4

0Pixel offset

coef

ficie

nt

0.3

original

8

impulse

filtered

Page 20: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

20

Blur examples2.4

0Pixel offset

coef

ficie

nt

0.3impulse

original

8

filtered

8

0Pixel offset

coef

ficie

nt

0.3

8

original filtered

4edge 4

Page 21: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

21

Linear filtering (warm-up slide)

2.0

original

1.0

?0 0

Page 22: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

22

Linear filtering (no change)

2.0

original

1.0

0 0

Filtered(no change)

Page 23: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

23

Linear filtering

2.0

original

?0

0.33

0

Page 24: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

24

(remember blurring)

0Pixel offset

coef

ficie

nt0.3

original Blurred (filterapplied in both dimensions).

Page 25: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

25

Sharpening

2.0

original

0

0.33

0

Sharpened original

Page 26: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

26

Sharpening example

coef

ficie

nt

-0.3

1.7

original

811.2

8

-0.25Sharpened

(differences areaccentuated; constant

areas are left untouched).

Page 27: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

27

Sharpening

before after

Page 28: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

28

Oriented filters

Page 29: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

29

Gabor filters at differentscales and spatial frequencies

top row shows anti-symmetric (or odd) filters, bottom row thesymmetric (or even) filters.

Page 30: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

30

Linear image transformations

• In analyzing images, it’s often useful to make a change of basis.

Fourier transform, orWavelet transform, or

Steerable pyramid transform

fUFrr

=transformed image

Vectorized image

Page 31: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

31

Self-inverting transforms

FU

FUfr

r

+

=

=

1r

Same basis functions are used for the inverse transform

U transpose and complex conjugate

Page 32: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

32

An example of such a transform: the Fourier transform

discrete domain

∑∑−

=

=

+−

=1

0

1

0

ln

],[],[M

k

N

l

NMkmi

elkfnmFπ

Forward transform

∑∑−

=

=

++

=1

0

1

0

ln

],[1],[M

k

N

l

NMkmi

enmFMN

lkfπ

Inverse transform

Page 33: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

33

To get some sense of what basis elements look like, we plot a basis element --- or rather, its real part ---as a function of x,y for some fixed u, v. We get a function that is constant when (ux+vy) is constant. The magnitude of the vector (u, v) gives a frequency, and its direction gives an orientation. The function is a sinusoid with this frequency along the direction, and constant perpendicular to the direction.

Page 34: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

34

Here u and v are larger than in the previous slide.

Page 35: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

35

And larger still...

Page 36: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

36

Phase and Magnitude• Fourier transform of a real

function is complex– difficult to plot, visualize– instead, we can think of the

phase and magnitude of the transform

• Phase is the phase of the complex transform

• Magnitude is the magnitude of the complex transform

• Curious fact– all natural images have

about the same magnitude transform

– hence, phase seems to matter, but magnitude largely doesn’t

• Demonstration– Take two pictures, swap the

phase transforms, compute the inverse - what does the result look like?

Page 37: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

37

Page 38: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

38

This is the magnitude transform of the cheetah pic

Page 39: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

39

This is the phase transform of the cheetah pic

Page 40: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

40

Page 41: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

41

This is the magnitude transform of the zebrapic

Page 42: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

42

This is the phase transform of the zebrapic

Page 43: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

43

Reconstruction with zebra phase, cheetah magnitude

Page 44: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

44

Reconstruction with cheetah phase, zebra magnitude

Page 45: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

45

Example image synthesis with fourier basis.

• 16 images

Page 46: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

46

2

Page 47: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

47

6

Page 48: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

48

18

Page 49: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

49

50

Page 50: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

50

82

Page 51: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

51

136

Page 52: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

52

282

Page 53: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

53

538

Page 54: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

54

1088

Page 55: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

55

2094

Page 56: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

56

4052.4052

Page 57: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

57

8056.

Page 58: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

58

15366

Page 59: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

59

28743

Page 60: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

60

49190.

Page 61: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

61

65536.

Page 62: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

62

Fourier transform magnitude

Page 63: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

63

Masking out the fundamental and harmonics from periodic pillars

Page 64: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

64

Name as many functions as you can that retain that same

functional form in the transform domain

Page 65: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

65Forsyth&Ponce

Page 66: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

66

Discrete-time, continuous frequency Fourier transform

Oppenheim, Schafer and Buck,Discrete-time signal processing,Prentice Hall, 1999

Page 67: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

67

Discrete-time, continuous frequency Fourier transform pairs

Oppenheim, Schafer and Buck,Discrete-time signal processing,Prentice Hall, 1999

Page 68: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

68

Bracewell’s pictorial dictionary of Fourier transform pairs

Bracewell, The Fourier Transform and its Applications, McGraw Hill 1978

Page 69: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

69

Why is the Fourier domain particularly useful?

• It tells us the effect of linear convolutions.

Page 70: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

70

Fourier transform of convolution

Consider a (circular) convolution of g and h

hgf ⊗=

Page 71: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

71

hgf ⊗=Fourier transform of convolution

Take DFT of both sides

( )hgDFTnmF ⊗=],[

Page 72: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

72

hgf ⊗=( )hgDFTnmF ⊗=],[

Fourier transform of convolution

Write the DFT and convolution explicitly

[ ] ∑∑∑−

=

=

+−

−−=1

0

1

0 ,

],[],[,M

u

N

v

Nvn

Mumi

lk

elkhlvkugnmFπ

Page 73: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

73

hgf ⊗=( )hgDFTnmF ⊗=],[

Fourier transform of convolution

[ ] ∑∑∑−

=

=

+−

−−=1

0

1

0 ,],[],[,

M

u

N

v

Nvn

Mumi

lkelkhlvkugnmF

π

Move the exponent in

∑∑∑−

=

=

+−

−−=1

0

1

0 ,

],[],[M

u

N

v lk

Nvn

Mumi

lkhelvkugπ

Page 74: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

74

hgf ⊗=( )hgDFTnmF ⊗=],[

Fourier transform of convolution

[ ] ∑∑∑−

=

=

+−

−−=1

0

1

0 ,],[],[,

M

u

N

v

Nvn

Mumi

lkelkhlvkugnmF

π

∑∑∑−

=

=

+−

−−=1

0

1

0 ,],[],[

M

u

N

v lk

Nvn

Mumi

lkhelvkugπ

Change variables in the sum( ) ( )

∑ ∑ ∑−−

−=

−−

−=

+

++

−=

1 1

,

],[],[kM

k

lN

l lk

Nnl

Mmki

lkhegµ υ

υµπυµ

Page 75: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

75

hgf ⊗=( )hgDFTnmF ⊗=],[

Fourier transform of convolution

[ ] ∑∑∑−

=

=

+−

−−=1

0

1

0 ,],[],[,

M

u

N

v

Nvn

Mumi

lkelkhlvkugnmF

π

∑∑∑−

=

=

+−

−−=1

0

1

0 ,],[],[

M

u

N

v lk

Nvn

Mumi

lkhelvkugπ

( ) ( )

∑ ∑ ∑−−

−=

−−

−=

+

++

−=

1 1

,],[],[

kM

k

lN

l lk

Nnl

Mmki

lkhegµ υ

υµπυµ

Perform the DFT (circular boundary conditions)

[ ]∑

+−

=lk

NMkmi

lkhenmG,

ln

],[,π

Page 76: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

76

hgf ⊗=( )hgDFTnmF ⊗=],[

Fourier transform of convolution

[ ] ∑∑∑−

=

=

+−

−−=1

0

1

0 ,],[],[,

M

u

N

v

Nvn

Mumi

lkelkhlvkugnmF

π

∑∑∑−

=

=

+−

−−=1

0

1

0 ,],[],[

M

u

N

v lk

Nvn

Mumi

lkhelvkugπ

( ) ( )

∑ ∑ ∑−−

−=

−−

−=

+

++

−=

1 1

,],[],[

kM

k

lN

l lk

Nnl

Mmki

lkhegµ υ

υµπυµ

[ ]∑

+−

=lk

NMkmi

lkhenmG,

ln

],[,π

Perform the other DFT (circular boundary conditions)

[ ] [ ]nmHnmG ,,=

Page 77: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

77

Analysis of our simple filters

Page 78: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

78

Analysis of our simple filters

0Pixel offsetco

effic

ient

1.0

original Filtered(no change)

1

],[],[1

0

1

0

ln

=

= ∑∑−

=

=

+−M

k

N

l

NMkmi

elkfnmFπ

0

1.0 constant

Page 79: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

79

Analysis of our simple filters

0Pixel offsetco

effic

ient

original

1.0

shifted

Mmi

M

k

N

l

NMkmi

e

elkfnmF

δπ

πδ

=

=

+−

=

−= ∑∑

],[],[1

0

1

0

ln

0

1.0

Constant magnitude, linearly shifted phase

Page 80: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

80

Analysis of our simple filters

0Pixel offsetco

effic

ient

original

0.3

blurred

+=

= ∑∑−

=

=

+−

Mm

elkfnmFM

k

N

l

NMkmi

π

π

cos2131

],[],[1

0

1

0

ln

Low-pass filter

0

1.0

Page 81: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

81

Analysis of our simple filters2.0

original0

0.33

0sharpened

+−=

= ∑∑−

=

=

+−

Mm

elkfnmFM

k

N

l

NMkmi

π

π

cos21312

],[],[1

0

1

0

ln

high-pass filter

0

1.0

2.3

Page 82: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

82

Sampling and aliasing

Page 83: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

83

Sampling in 1D takes a continuous function and replaces it with a vector of values, consisting of the function’s values at a set of sample points. We’ll assume that these sample points are on a regular grid, and can place one at each integer for convenience.

Page 84: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

84

Sampling in 2D does the same thing, only in 2D. We’ll assume that these sample points are on a regular grid, and can place one at each integer point for convenience.

Page 85: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

85

A continuous model for a sampled function

• We want to be able to approximate integrals sensibly

• Leads to– the delta function– model on right

Sample2D f (x,y)( )= f (x, y)δ (x − i, y − j)i=−∞

∑i=−∞

= f (x,y) δ (x − i, y − j)i=−∞

∑i=−∞

Page 86: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

86

The Fourier transform of a sampled signal

F Sample2D f (x,y)( )( )= F f (x, y) δ(x − i,y − j)i=−∞

∑i=−∞

= F f (x,y)( )**F δ(x − i, y − j)i=−∞

∑i=−∞

= F u − i,v − j( )j=−∞

∑i=−∞

Page 87: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

87

Page 88: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

88

Page 89: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

89

Aliasing

• Can’t shrink an image by taking every second pixel

• If we do, characteristic errors appear – In the next few slides– Typically, small phenomena look bigger; fast

phenomena can look slower– Common phenomenon

• Wagon wheels rolling the wrong way in movies• Checkerboards misrepresented in ray tracing• Striped shirts look funny on colour television

Page 90: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

90

Resample the checkerboard by taking one sample at each circle. In the case of the top left board, new representation is reasonable. Top right also yields a reasonable representation. Bottom left is all black (dubious) and bottom right has checks that are too big.

Page 91: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

91

Constructing a pyramid by taking every second pixel leads to layers that badly misrepresent the top layer

Page 92: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

92

Smoothing as low-pass filtering

• A filter whose FT is a box is bad, because the filter kernel has infinite support

• Common solution: use a Gaussian– multiplying FT by

Gaussian is equivalent to convolving image with Gaussian.

• The message of the FT is that high frequencies lead to trouble with sampling.

• Solution: suppress high frequencies before sampling– multiply the FT of the

signal with something that suppresses high frequencies

– or convolve with a low-pass filter

Page 93: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

93

Sampling without smoothing. Top row shows the images,sampled at every second pixel to get the next; bottom row shows the magnitude spectrum of these images.

Page 94: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

94

Sampling with smoothing. Top row shows the images. Weget the next image by smoothing the image with a Gaussian with sigma 1 pixel,then sampling at every second pixel to get the next; bottom row shows the magnitude spectrum of these images.

Page 95: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

95

Sampling with smoothing. Top row shows the images. Weget the next image by smoothing the image with a Gaussian with sigma 1.4 pixels,then sampling at every second pixel to get the next; bottom row shows the magnitude spectrum of these images.

Page 96: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

96

Thought problemAnalyze

crossed gratings

Page 97: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

97

What is a good representation for image analysis?

• Fourier transform domain tells you “what” (textural properties), but not “where”.

• Pixel domain representation tells you “where” (pixel location), but not “what”.

• Want an image representation that gives you a local description of image events—what is happening where.

Page 98: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

98

Image pyramids

Page 99: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

99

The Gaussian pyramid

• Smooth with gaussians, because– a gaussian*gaussian=another gaussian

• Synthesis – smooth and sample

• Analysis– take the top image

• Gaussians are low pass filters, so repn is redundant

Page 100: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

100

Page 101: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

101

The Laplacian Pyramid

• Synthesis– preserve difference between upsampled

Gaussian pyramid level and Gaussian pyramid level

– band pass filter - each level represents spatial frequencies (largely) unrepresented at other levels

• Analysis– reconstruct Gaussian pyramid, take top layer

Page 102: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

102

Page 103: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

103

Page 104: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

104

Page 105: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

105

Oriented pyramids

• Laplacian pyramid is orientation independent

• Apply an oriented filter to determine orientations at each layer– by clever filter design, we can simplify

synthesis– this represents image information at a particular

scale and orientation

Page 106: Homeworks - MIT CSAIL · Homeworks • Problem set 1 returned today. ... 39. This is the phase transform ... u N vlk N vn M um i. g u k v l e h k l

106

Reprinted from “Shiftable MultiScale Transforms,” by Simoncelli et al., IEEE Transactionson Information Theory, 1992, copyright 1992, IEEE