44

Computer Vision - cs.brown.edu

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Computer Vision - cs.brown.edu
Page 2: Computer Vision - cs.brown.edu
Page 3: Computer Vision - cs.brown.edu
Page 4: Computer Vision - cs.brown.edu

Capture Frequency - Rolling `Shutter’

James Hays

Page 5: Computer Vision - cs.brown.edu

I understand frequency as in waves…

…but how does this relate to the complex

signals we see in natural images?

…to image frequency?

Page 6: Computer Vision - cs.brown.edu

FOURIER SERIES & FOURIER TRANSFORMS

Another way of thinking about frequency

Page 7: Computer Vision - cs.brown.edu

Fourier series

A bold idea (1807):Any univariate function can be rewritten as a weighted sum of sines and cosines of different frequencies.

Hays

Jean Baptiste Joseph Fourier (1768-1830)

Page 8: Computer Vision - cs.brown.edu

Our building block:

Add enough of them to get any signal g(t) you want!

)cos(sin( tBtA

Hays

A bold idea (1807):Any univariate function can be rewritten as a weighted sum of sines and cosines of different frequencies.

Fourier series

Page 9: Computer Vision - cs.brown.edu

g(t) = sin(2πf t) + (1/3)sin(2π(3f) t)

= +

Slides: Efros

Co

effic

ien

t

t = [0,2], f = 1

t

g

Page 10: Computer Vision - cs.brown.edu

Square wave spectra

Page 11: Computer Vision - cs.brown.edu

= +

=

Square wave spectra

Page 12: Computer Vision - cs.brown.edu

= +

=

Square wave spectra

Page 13: Computer Vision - cs.brown.edu

= +

=

Square wave spectra

Page 14: Computer Vision - cs.brown.edu

= +

=

Square wave spectra

Page 15: Computer Vision - cs.brown.edu

= +

=

Square wave spectra

Page 16: Computer Vision - cs.brown.edu

=

Square wave spectra

Co

effic

ien

t𝐴

𝑓=1

∞1

𝑓sin(2𝜋𝑓𝑡)

Page 17: Computer Vision - cs.brown.edu

Jean Baptiste Joseph Fourier (1768-1830)

A bold idea (1807):Any univariate function can be rewritten as a weighted sum of sines and cosines of different frequencies.

Don’t believe it? – Neither did Lagrange,

Laplace, Poisson and other big wigs

– Not translated into English until 1878!

But it’s (mostly) true!– Called Fourier Series

– There are some subtle restrictions

...the manner in which the author arrives atthese equations is not exempt of difficultiesand...his analysis to integrate them stillleaves something to be desired on the scoreof generality and even rigour.

Laplace

LagrangeLegendre

Hays

Page 18: Computer Vision - cs.brown.edu

Wikipedia – Fourier transform

Page 19: Computer Vision - cs.brown.edu

Sine/cosine and circle

Wikipedia – Unit Circle

sin t

cos t

Page 20: Computer Vision - cs.brown.edu

Square wave (approx.)

Mehmet E. Yavuz

Page 21: Computer Vision - cs.brown.edu

Sawtooth wave (approx.)

Mehmet E. Yavuz

Page 22: Computer Vision - cs.brown.edu

Example: Music

• We think of music in terms of frequencies at different magnitudes

Slide: Hoiem

Page 23: Computer Vision - cs.brown.edu

Spatial

domain

Frequency

domainFrequency

Coeffic

ient

Page 24: Computer Vision - cs.brown.edu

Fourier analysis in imagesSpatial domain images

Fourier decomposition frequency amplitude images

http://sharp.bu.edu/~slehar/fourier/fourier.html#filtering More: http://www.cs.unm.edu/~brayer/vision/fourier.html

Page 25: Computer Vision - cs.brown.edu

Signals can be composed

+ =

http://sharp.bu.edu/~slehar/fourier/fourier.html#filtering More: http://www.cs.unm.edu/~brayer/vision/fourier.html

Spatial domain images

Fourier decomposition frequency amplitude images

Page 26: Computer Vision - cs.brown.edu

Natural image

What does it mean to be at pixel x,y?

What does it mean to be more or less bright in the Fourier decomposition

image?

Natural image

Fourier decomposition

Frequency coefficients (amplitude)

Page 27: Computer Vision - cs.brown.edu

Brian Pauw demo

• Live Fourier decomposition images

– Using FFT2 function

• I hacked it a bit for MATLAB

• http://www.lookingatnothing.com/index.php/archives/991

Page 28: Computer Vision - cs.brown.edu

Think-Pair-Share

Match the spatial domain image to the Fourier magnitude image

1 54

A

32

C

B

D

E

Hoiem

Page 29: Computer Vision - cs.brown.edu

Fourier Bases

This change of basis is the Fourier Transform

Teases away ‘fast vs. slow’ changes in the image.

Blue = sine

Green = cosine

Hays

Page 30: Computer Vision - cs.brown.edu

Basis reconstruction

Danny Alexander

Page 31: Computer Vision - cs.brown.edu

Fourier Transform

• Stores the amplitude and phase at each frequency:– For mathematical convenience, this is often notated in terms of real

and complex numbers

– Related by Euler’s formula

Hays

Page 32: Computer Vision - cs.brown.edu

Fourier Transform

• Stores the amplitude and phase at each frequency:– For mathematical convenience, this is often notated in terms of real

and complex numbers

– Related by Euler’s formula

Hays

Page 33: Computer Vision - cs.brown.edu

Fourier Transform

• Stores the amplitude and phase at each frequency:– For mathematical convenience, this is often notated in terms of real

and complex numbers

– Related by Euler’s formula

22 )Im()Re( A

)Re(

)Im(tan 1

Hays

Phase encodes spatial information

(indirectly):

Amplitude encodes how much signal

there is at a particular frequency:

Page 34: Computer Vision - cs.brown.edu

Amplitude / Phase

• Amplitude tells you “how much”

• Phase tells you “where”

• Translate the image? – Amplitude unchanged

– Adds a constant to the phase.

Morse

Page 35: Computer Vision - cs.brown.edu

What about phase?

Efros

Page 36: Computer Vision - cs.brown.edu

What about phase?

Amplitude Phase

Efros

Page 37: Computer Vision - cs.brown.edu

What about phase?

Efros

Page 38: Computer Vision - cs.brown.edu

What about phase?

Amplitude Phase

Efros

Page 39: Computer Vision - cs.brown.edu

John Brayer, Uni. New Mexico

• “We generally do not display PHASE images because most people who see them shortly thereafter succumb to hallucinogenics or end up in a Tibetan monastery.”

• https://www.cs.unm.edu/~brayer/vision/fourier.html

Page 40: Computer Vision - cs.brown.edu

Think-Pair-Share

• In Fourier space, where is more of the information that we see in the visual world?

– Amplitude

– Phase

Page 41: Computer Vision - cs.brown.edu

Cheebra

Zebra phase, cheetah amplitude Cheetah phase, zebra amplitude

Efros

Page 42: Computer Vision - cs.brown.edu

• The frequency amplitude of natural images are quite similar

– Heavy in low frequencies, falling off in high frequencies

– Will any image be like that, or is it a property of the world we live in?

• Most information in the image is carried in the phase, not the amplitude

– Not quite clear why

Efros

Page 43: Computer Vision - cs.brown.edu

What is the relationship to phase in audio?

• In audio perception, frequency is important but phase is not.

• In visual perception, both are important.

• ??? : (

Page 44: Computer Vision - cs.brown.edu

• Proj 0 & 1 written due today 9pm

• Juniors in the room who want to take the class

– No promises, but come to front