18
October 29, 2013 Computer Vision Lecture 13: Fourier 1 The Fourier Transform In the previous lecture, we discussed the Hough transform. There is another, much more common and fundamental type of transform: the Fourier transform. The Fourier transform maps a function onto its representation in the frequency domain.

October 29, 2013Computer Vision Lecture 13: Fourier Transform II 1 The Fourier Transform In the previous lecture, we discussed the Hough transform. There

Embed Size (px)

Citation preview

Page 1: October 29, 2013Computer Vision Lecture 13: Fourier Transform II 1 The Fourier Transform In the previous lecture, we discussed the Hough transform. There

October 29, 2013 Computer Vision Lecture 13: Fourier Transform II

1

The Fourier Transform

In the previous lecture, we discussed the Hough transform.

There is another, much more common and fundamental type of transform: the Fourier transform.

The Fourier transform maps a function onto its representation in the frequency domain.

Page 2: October 29, 2013Computer Vision Lecture 13: Fourier Transform II 1 The Fourier Transform In the previous lecture, we discussed the Hough transform. There

October 29, 2013 Computer Vision Lecture 13: Fourier Transform II

2

The Fourier Transform

Jean Baptiste Joseph Fourier (and his Fourier-transformed image)

Page 3: October 29, 2013Computer Vision Lecture 13: Fourier Transform II 1 The Fourier Transform In the previous lecture, we discussed the Hough transform. There

October 29, 2013 Computer Vision Lecture 13: Fourier Transform II

3

The Fourier Transform

Let us first look at one-dimensional functions.Later, we will move on to two-dimensional functions, such as images I(x, y).

The Fourier transform assumes that the input function is periodic, i.e., repetitive, and defined for all real numbersIt transforms this function into a weighted sum of sinusoidal terms.

Page 4: October 29, 2013Computer Vision Lecture 13: Fourier Transform II 1 The Fourier Transform In the previous lecture, we discussed the Hough transform. There

October 29, 2013 Computer Vision Lecture 13: Fourier Transform II

4

=

3 sin(x) A

+ 1 sin(3x) B A+B

+ 0.8 sin(5x) CA+B+C

+ 0.4 sin(7x) DA+B+C+D

sin(x) A

Adding Sine Waves

Page 5: October 29, 2013Computer Vision Lecture 13: Fourier Transform II 1 The Fourier Transform In the previous lecture, we discussed the Hough transform. There

October 29, 2013 Computer Vision Lecture 13: Fourier Transform II

5

The Fourier Transform

By adding a number of sine waves of different frequencies and amplitudes, we can approximate any given periodic function.However, if we limit ourselves to only sine waves with no offset, i.e., difference in phase at x = 0, we cannot perfectly reconstruct every function. For instance, the output of our function at x = 0 must always be 0.We could add a phase to each sine wave, but as Monsieur Fourier found out, it is sufficient to use both sine and cosine waves (which describe the same wave, but with a 90 phase difference) and keep all phases at 0.

Page 6: October 29, 2013Computer Vision Lecture 13: Fourier Transform II 1 The Fourier Transform In the previous lecture, we discussed the Hough transform. There

October 29, 2013 Computer Vision Lecture 13: Fourier Transform II

6

The Fourier TransformSo for any given function f, we could define a function Fs that assigns to any frequency an amplitude (i.e., weight) that the sine wave of that frequency will receive in our sum of sine waves.

Similarly, we could define a function Fc that does the same for the cosine waves. In other words, these functions describe the contribution of different frequencies to the overall signal, our function f.While f describes our function in the spatial domain (i.e., what value does it have in what position x), Fs and Fc describe the same function in the frequency domain (i.e., the extent to which different frequencies are included in the function).

Page 7: October 29, 2013Computer Vision Lecture 13: Fourier Transform II 1 The Fourier Transform In the previous lecture, we discussed the Hough transform. There

October 29, 2013 Computer Vision Lecture 13: Fourier Transform II

7

The Two-Dimensional Fourier Transform

)(2e ),(f),F( dxdyyxvu vyuxi

)(2e ),F(),( dudvvuyxf vyuxi

amplitude basis functionsand phase of required basis functions

Two-Dimensional Fourier Transform:

Note: F(u,v) is complex, while f(x, y) is real.

Two-Dimensional Inverse Fourier Transform:

Page 8: October 29, 2013Computer Vision Lecture 13: Fourier Transform II 1 The Fourier Transform In the previous lecture, we discussed the Hough transform. There

October 29, 2013 Computer Vision Lecture 13: Fourier Transform II

8

Refresher: Complex NumbersAs you certainly remember, complex numbers consist of a real and an imaginary part, which we will use to represent the contribution of cosine and sine waves, respectively, to a given function. For example, 5 + 3i means Re = 5 and Im = 3.Importantly, the exponentialfunction represents a rotation in the 2D spacespanned by the real andimaginary axes:

ei = cos + isin

cos

1

0

Im

Re0

sin

Page 9: October 29, 2013Computer Vision Lecture 13: Fourier Transform II 1 The Fourier Transform In the previous lecture, we discussed the Hough transform. There

October 29, 2013 Computer Vision Lecture 13: Fourier Transform II

9

2D Discrete Fourier Transform

1

0

1

0

)(2),(

11),( N

x

M

y

M

vy

N

uxi

eyxfMN

vuF

(u = 0,..., N-1; v = 0,…,M-1)

1

0

1

0

)(2),(),( N

u

M

v

M

vy

N

uxi

evuFyxf

(x = 0,..., N-1; y = 0,…,M-1)

Page 10: October 29, 2013Computer Vision Lecture 13: Fourier Transform II 1 The Fourier Transform In the previous lecture, we discussed the Hough transform. There

October 29, 2013 Computer Vision Lecture 13: Fourier Transform II

10

2D Discrete Fourier TransformWhat do these equations mean?Well, if you look at the inverse transform, you see that each F(u, v) is multiplied by an exponential term for each pixel, and in sum they give us the original image.In other words, each exponential function represents one particular wave, and the sum of these waves, weighted by F, is our original image f.In the exponential term, you see an expression such as (ux + vy). This means that the variables u and v determine the “speed” with which the term increases when x and y, respectively, grow.Since this term determines the current angle of a wave, u and v determine the frequency of the waves in horizontal and vertical direction, respectively.

Page 11: October 29, 2013Computer Vision Lecture 13: Fourier Transform II 1 The Fourier Transform In the previous lecture, we discussed the Hough transform. There

October 29, 2013 Computer Vision Lecture 13: Fourier Transform II

11

The 2D Basis Functions )(2 vyuxie

u=0, v=0 u=1, v=0 u=2, v=0u=-2, v=0 u=-1, v=0

u=0, v=1 u=1, v=1 u=2, v=1u=-2, v=1 u=-1, v=1

u=0, v=2 u=1, v=2 u=2, v=2u=-2, v=2 u=-1, v=2

u=0, v=-1 u=1, v=-1 u=2, v=-1u=-2, v=-1 u=-1, v=-1

u=0, v=-2 u=1, v=-2 u=2, v=-2u=-2, v=-2 u=-1, v=-2

U

V

Page 12: October 29, 2013Computer Vision Lecture 13: Fourier Transform II 1 The Fourier Transform In the previous lecture, we discussed the Hough transform. There

October 29, 2013 Computer Vision Lecture 13: Fourier Transform II

12

Fourier Transform Example 1

Two-dimensional rectangle function as an image

d) Magnitude of Fourier spectrum of the 2-D rectangle

Page 13: October 29, 2013Computer Vision Lecture 13: Fourier Transform II 1 The Fourier Transform In the previous lecture, we discussed the Hough transform. There

October 29, 2013 Computer Vision Lecture 13: Fourier Transform II

13

Fourier Transform Example 1

cross section isometric display

Page 14: October 29, 2013Computer Vision Lecture 13: Fourier Transform II 1 The Fourier Transform In the previous lecture, we discussed the Hough transform. There

October 29, 2013 Computer Vision Lecture 13: Fourier Transform II

14

Fourier Transform Example 2:

Cheetah Zebra

Page 15: October 29, 2013Computer Vision Lecture 13: Fourier Transform II 1 The Fourier Transform In the previous lecture, we discussed the Hough transform. There

October 29, 2013 Computer Vision Lecture 13: Fourier Transform II

15

Fourier Transform of Cheetah Image

magnitude of cheetah phase of cheetah

Page 16: October 29, 2013Computer Vision Lecture 13: Fourier Transform II 1 The Fourier Transform In the previous lecture, we discussed the Hough transform. There

October 29, 2013 Computer Vision Lecture 13: Fourier Transform II

16

Fourier Transform of Zebra Image

magnitude of zebra phase of zebra

Page 17: October 29, 2013Computer Vision Lecture 13: Fourier Transform II 1 The Fourier Transform In the previous lecture, we discussed the Hough transform. There

October 29, 2013 Computer Vision Lecture 13: Fourier Transform II

17

Reconstruction with Zebra Phaseand Cheetah Magnitude

Page 18: October 29, 2013Computer Vision Lecture 13: Fourier Transform II 1 The Fourier Transform In the previous lecture, we discussed the Hough transform. There

October 29, 2013 Computer Vision Lecture 13: Fourier Transform II

18

Reconstruction with Cheetah Phaseand Zebra Magnitude