62
Trasformata di Fourier Michele Nappi, Ph.D Università degli Studi di Salerno [email protected] biplab.unisa.it 089-963334

Trasformata di Fourier - UNISA · Example of LSIS Defocused image ( g ) is a processed version of the focused image ( f ) g f Ideal lens is a LSIS f x g x LSIS Linearity: Brightness

Embed Size (px)

Citation preview

Page 1: Trasformata di Fourier - UNISA · Example of LSIS Defocused image ( g ) is a processed version of the focused image ( f ) g f Ideal lens is a LSIS f x g x LSIS Linearity: Brightness

Trasformata di Fourier

Michele Nappi, Ph.D

Università degli Studi di Salerno

[email protected]

biplab.unisa.it

089-963334

Page 2: Trasformata di Fourier - UNISA · Example of LSIS Defocused image ( g ) is a processed version of the focused image ( f ) g f Ideal lens is a LSIS f x g x LSIS Linearity: Brightness

30/03/2016 Michele Nappi 2

IndexLinear Systems

• Definitions & Properties

• Shift Invariant Linear Systems

• Linear Systems and Convolutions

• Linear Systems and sinusoids

• Complex Numbers and Complex Exponentials

• Linear Systems - Frequency Response

Page 3: Trasformata di Fourier - UNISA · Example of LSIS Defocused image ( g ) is a processed version of the focused image ( f ) g f Ideal lens is a LSIS f x g x LSIS Linearity: Brightness

30/03/2016 Michele Nappi 3

Linear System

Page 4: Trasformata di Fourier - UNISA · Example of LSIS Defocused image ( g ) is a processed version of the focused image ( f ) g f Ideal lens is a LSIS f x g x LSIS Linearity: Brightness

30/03/2016 Michele Nappi 4

Linear System Properties

Page 5: Trasformata di Fourier - UNISA · Example of LSIS Defocused image ( g ) is a processed version of the focused image ( f ) g f Ideal lens is a LSIS f x g x LSIS Linearity: Brightness

Linear Shift Invariant Systems (LSIS)

Linearity:

1f 1g 2f 2g

21 ff 21 gg

Shift invariance:

axf axg

a a

Page 6: Trasformata di Fourier - UNISA · Example of LSIS Defocused image ( g ) is a processed version of the focused image ( f ) g f Ideal lens is a LSIS f x g x LSIS Linearity: Brightness

Example of LSIS

Defocused image ( g ) is a

processed version of the

focused image ( f )

g f

Ideal lens is a LSIS xf xgLSIS

Linearity: Brightness variation

Shift invariance: Scene movement

(not valid for lenses with non-linear distortions)

Page 7: Trasformata di Fourier - UNISA · Example of LSIS Defocused image ( g ) is a processed version of the focused image ( f ) g f Ideal lens is a LSIS f x g x LSIS Linearity: Brightness

30/03/2016 Michele Nappi 7

Shift Invariant Linear System (cont.)

Page 8: Trasformata di Fourier - UNISA · Example of LSIS Defocused image ( g ) is a processed version of the focused image ( f ) g f Ideal lens is a LSIS f x g x LSIS Linearity: Brightness

30/03/2016 Michele Nappi 8

Convolution in Continous Case

Page 9: Trasformata di Fourier - UNISA · Example of LSIS Defocused image ( g ) is a processed version of the focused image ( f ) g f Ideal lens is a LSIS f x g x LSIS Linearity: Brightness

1 2-1-2

xc

-1 1

1

xb

-1 1

1 xa

bac

1

Convolution - Example

Page 10: Trasformata di Fourier - UNISA · Example of LSIS Defocused image ( g ) is a processed version of the focused image ( f ) g f Ideal lens is a LSIS f x g x LSIS Linearity: Brightness

Convolution Kernel – Impulse Response

f gh hfg

• What h will give us g = f ?

Dirac Delta Function (Unit Impulse)

x

21

0

Page 11: Trasformata di Fourier - UNISA · Example of LSIS Defocused image ( g ) is a processed version of the focused image ( f ) g f Ideal lens is a LSIS f x g x LSIS Linearity: Brightness

30/03/2016 Michele Nappi 11

Impulse Sequence

Page 12: Trasformata di Fourier - UNISA · Example of LSIS Defocused image ( g ) is a processed version of the focused image ( f ) g f Ideal lens is a LSIS f x g x LSIS Linearity: Brightness

30/03/2016 Michele Nappi 12

Shift-Invariant Linear

System and Convolution

Page 13: Trasformata di Fourier - UNISA · Example of LSIS Defocused image ( g ) is a processed version of the focused image ( f ) g f Ideal lens is a LSIS f x g x LSIS Linearity: Brightness

30/03/2016 Michele Nappi 13

Complex Number

Page 14: Trasformata di Fourier - UNISA · Example of LSIS Defocused image ( g ) is a processed version of the focused image ( f ) g f Ideal lens is a LSIS f x g x LSIS Linearity: Brightness

30/03/2016 Michele Nappi 14

Complex Number (cont.)

Page 15: Trasformata di Fourier - UNISA · Example of LSIS Defocused image ( g ) is a processed version of the focused image ( f ) g f Ideal lens is a LSIS f x g x LSIS Linearity: Brightness

30/03/2016 Michele Nappi 15

Complex Number (cont.)

Page 16: Trasformata di Fourier - UNISA · Example of LSIS Defocused image ( g ) is a processed version of the focused image ( f ) g f Ideal lens is a LSIS f x g x LSIS Linearity: Brightness

30/03/2016 Michele Nappi 16

The (Co-)Sinusoid

Page 17: Trasformata di Fourier - UNISA · Example of LSIS Defocused image ( g ) is a processed version of the focused image ( f ) g f Ideal lens is a LSIS f x g x LSIS Linearity: Brightness

30/03/2016 Michele Nappi 17

The (Co-)Sinusoid (cont.)

• The wavelength of

sin(2πωx) is 1/ω .

• The frequency is ω .

Page 18: Trasformata di Fourier - UNISA · Example of LSIS Defocused image ( g ) is a processed version of the focused image ( f ) g f Ideal lens is a LSIS f x g x LSIS Linearity: Brightness

30/03/2016 Michele Nappi 18

The (Co-)Sinusoid (cont.)

Page 19: Trasformata di Fourier - UNISA · Example of LSIS Defocused image ( g ) is a processed version of the focused image ( f ) g f Ideal lens is a LSIS f x g x LSIS Linearity: Brightness

30/03/2016 Michele Nappi 19

The (Co-)Sinusoid (cont.)

• If we add a Sine wave

to a Cosine wave with

the same frequency

we get a scaled and

shifted (Co-)Sine

wave with the same

frequency

Page 20: Trasformata di Fourier - UNISA · Example of LSIS Defocused image ( g ) is a processed version of the focused image ( f ) g f Ideal lens is a LSIS f x g x LSIS Linearity: Brightness

30/03/2016 Michele Nappi 20

The (Co-)Sinusoid (cont.)

Phase tg

Amplitude R

sin cossinsincos

:obtain we(1) from Thus

sin and cos

:such that exists There

1

Since

(1) cossinbcosasin

:Proof

1-

22

2222

2222

2

22

2

22

2222

22

a

b

ba

xbaxxba

ba

b

ba

a

ba

b

ba

a

xba

bx

ba

abaxx

Page 21: Trasformata di Fourier - UNISA · Example of LSIS Defocused image ( g ) is a processed version of the focused image ( f ) g f Ideal lens is a LSIS f x g x LSIS Linearity: Brightness

30/03/2016 Michele Nappi 21

The response of Shift-Invariant

Linear System to a Sine wave

• The response of a

shift-invariant linear

system to a sine wave

is a shifted and

scaled sine wave with

the same frequency.

Page 22: Trasformata di Fourier - UNISA · Example of LSIS Defocused image ( g ) is a processed version of the focused image ( f ) g f Ideal lens is a LSIS f x g x LSIS Linearity: Brightness

30/03/2016 Michele Nappi 22

The response of Shift-Invariant

Linear System to a Sine wave (cont.)

Page 23: Trasformata di Fourier - UNISA · Example of LSIS Defocused image ( g ) is a processed version of the focused image ( f ) g f Ideal lens is a LSIS f x g x LSIS Linearity: Brightness

Jean Baptiste Joseph Fourier (1768-1830)

• Had crazy idea (1807):

• Any periodic 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 true!

– called Fourier Series

– Possibly the greatest tool

used in Engineering

Page 24: Trasformata di Fourier - UNISA · Example of LSIS Defocused image ( g ) is a processed version of the focused image ( f ) g f Ideal lens is a LSIS f x g x LSIS Linearity: Brightness

30/03/2016 Michele Nappi 24

The Fourier Transform (cont.)

Page 25: Trasformata di Fourier - UNISA · Example of LSIS Defocused image ( g ) is a processed version of the focused image ( f ) g f Ideal lens is a LSIS f x g x LSIS Linearity: Brightness

Time and Frequency

• example : g(t) = sin(2pf t) + (1/3)sin(2p(3f) t)

Page 26: Trasformata di Fourier - UNISA · Example of LSIS Defocused image ( g ) is a processed version of the focused image ( f ) g f Ideal lens is a LSIS f x g x LSIS Linearity: Brightness

Time and Frequency

• example : g(t) = sin(2pf t) + (1/3)sin(2p(3f) t)

= +

Page 27: Trasformata di Fourier - UNISA · Example of LSIS Defocused image ( g ) is a processed version of the focused image ( f ) g f Ideal lens is a LSIS f x g x LSIS Linearity: Brightness

Frequency Spectra

• example : g(t) = sin(2pf t) + (1/3)sin(2p(3f) t)

= +

Page 28: Trasformata di Fourier - UNISA · Example of LSIS Defocused image ( g ) is a processed version of the focused image ( f ) g f Ideal lens is a LSIS f x g x LSIS Linearity: Brightness

Frequency Spectra

• Usually, frequency is more interesting than the phase

Page 29: Trasformata di Fourier - UNISA · Example of LSIS Defocused image ( g ) is a processed version of the focused image ( f ) g f Ideal lens is a LSIS f x g x LSIS Linearity: Brightness

= +

=

Frequency Spectra

Page 30: Trasformata di Fourier - UNISA · Example of LSIS Defocused image ( g ) is a processed version of the focused image ( f ) g f Ideal lens is a LSIS f x g x LSIS Linearity: Brightness

= +

=

Frequency Spectra

Page 31: Trasformata di Fourier - UNISA · Example of LSIS Defocused image ( g ) is a processed version of the focused image ( f ) g f Ideal lens is a LSIS f x g x LSIS Linearity: Brightness

= +

=

Frequency Spectra

Page 32: Trasformata di Fourier - UNISA · Example of LSIS Defocused image ( g ) is a processed version of the focused image ( f ) g f Ideal lens is a LSIS f x g x LSIS Linearity: Brightness

= +

=

Frequency Spectra

Page 33: Trasformata di Fourier - UNISA · Example of LSIS Defocused image ( g ) is a processed version of the focused image ( f ) g f Ideal lens is a LSIS f x g x LSIS Linearity: Brightness

= +

=

Frequency Spectra

Page 34: Trasformata di Fourier - UNISA · Example of LSIS Defocused image ( g ) is a processed version of the focused image ( f ) g f Ideal lens is a LSIS f x g x LSIS Linearity: Brightness

= 1

1sin(2 )

k

A ktk

Frequency Spectra

Page 35: Trasformata di Fourier - UNISA · Example of LSIS Defocused image ( g ) is a processed version of the focused image ( f ) g f Ideal lens is a LSIS f x g x LSIS Linearity: Brightness

Frequency Spectra

Page 36: Trasformata di Fourier - UNISA · Example of LSIS Defocused image ( g ) is a processed version of the focused image ( f ) g f Ideal lens is a LSIS f x g x LSIS Linearity: Brightness

30/03/2016 Michele Nappi 36

Frequency Analysis

Page 37: Trasformata di Fourier - UNISA · Example of LSIS Defocused image ( g ) is a processed version of the focused image ( f ) g f Ideal lens is a LSIS f x g x LSIS Linearity: Brightness

30/03/2016 Michele Nappi 37

The Fourier Transform

Page 38: Trasformata di Fourier - UNISA · Example of LSIS Defocused image ( g ) is a processed version of the focused image ( f ) g f Ideal lens is a LSIS f x g x LSIS Linearity: Brightness

30/03/2016 Michele Nappi 38

The Fourier Transform (cont.)

Page 39: Trasformata di Fourier - UNISA · Example of LSIS Defocused image ( g ) is a processed version of the focused image ( f ) g f Ideal lens is a LSIS f x g x LSIS Linearity: Brightness

30/03/2016 Michele Nappi 39

The Fourier Transform (cont.)

Page 40: Trasformata di Fourier - UNISA · Example of LSIS Defocused image ( g ) is a processed version of the focused image ( f ) g f Ideal lens is a LSIS f x g x LSIS Linearity: Brightness

30/03/2016 Michele Nappi 40

The Fourier Transform (cont.)

Page 41: Trasformata di Fourier - UNISA · Example of LSIS Defocused image ( g ) is a processed version of the focused image ( f ) g f Ideal lens is a LSIS f x g x LSIS Linearity: Brightness

Frequency Domain

Filtering

Page 42: Trasformata di Fourier - UNISA · Example of LSIS Defocused image ( g ) is a processed version of the focused image ( f ) g f Ideal lens is a LSIS f x g x LSIS Linearity: Brightness

30/03/2016 Michele Nappi 42

2D Fourier Transform

Page 43: Trasformata di Fourier - UNISA · Example of LSIS Defocused image ( g ) is a processed version of the focused image ( f ) g f Ideal lens is a LSIS f x g x LSIS Linearity: Brightness

30/03/2016 Michele Nappi 43

Discrete Fourier Transform

Page 44: Trasformata di Fourier - UNISA · Example of LSIS Defocused image ( g ) is a processed version of the focused image ( f ) g f Ideal lens is a LSIS f x g x LSIS Linearity: Brightness

30/03/2016 Michele Nappi 44

Discrete Fourier Transform (cont.)

Page 45: Trasformata di Fourier - UNISA · Example of LSIS Defocused image ( g ) is a processed version of the focused image ( f ) g f Ideal lens is a LSIS f x g x LSIS Linearity: Brightness

30/03/2016 Michele Nappi 45

Discrete Fourier Transform (cont.)

Page 46: Trasformata di Fourier - UNISA · Example of LSIS Defocused image ( g ) is a processed version of the focused image ( f ) g f Ideal lens is a LSIS f x g x LSIS Linearity: Brightness

30/03/2016 Michele Nappi 46

Discrete Fourier Transform (cont.)

Page 47: Trasformata di Fourier - UNISA · Example of LSIS Defocused image ( g ) is a processed version of the focused image ( f ) g f Ideal lens is a LSIS f x g x LSIS Linearity: Brightness

30/03/2016 Michele Nappi 47

Discrete Fourier Transform (cont.)

Page 48: Trasformata di Fourier - UNISA · Example of LSIS Defocused image ( g ) is a processed version of the focused image ( f ) g f Ideal lens is a LSIS f x g x LSIS Linearity: Brightness

30/03/2016 Michele Nappi 48

Discrete Fourier Transform (cont.)

Page 49: Trasformata di Fourier - UNISA · Example of LSIS Defocused image ( g ) is a processed version of the focused image ( f ) g f Ideal lens is a LSIS f x g x LSIS Linearity: Brightness

30/03/2016 Michele Nappi 49

Discrete Fourier Transform (cont.)

Page 50: Trasformata di Fourier - UNISA · Example of LSIS Defocused image ( g ) is a processed version of the focused image ( f ) g f Ideal lens is a LSIS f x g x LSIS Linearity: Brightness

30/03/2016 Michele Nappi 50

Discrete Fourier Transform (cont.)

Page 51: Trasformata di Fourier - UNISA · Example of LSIS Defocused image ( g ) is a processed version of the focused image ( f ) g f Ideal lens is a LSIS f x g x LSIS Linearity: Brightness

30/03/2016 Michele Nappi 51

Spatial vs Frequency Domain

Page 52: Trasformata di Fourier - UNISA · Example of LSIS Defocused image ( g ) is a processed version of the focused image ( f ) g f Ideal lens is a LSIS f x g x LSIS Linearity: Brightness

30/03/2016 Michele Nappi 52

Spatial vs Frequency Domain (cont.)

Page 53: Trasformata di Fourier - UNISA · Example of LSIS Defocused image ( g ) is a processed version of the focused image ( f ) g f Ideal lens is a LSIS f x g x LSIS Linearity: Brightness

30/03/2016 Michele Nappi 53

Spatial vs Frequency Domain (cont.)

Page 54: Trasformata di Fourier - UNISA · Example of LSIS Defocused image ( g ) is a processed version of the focused image ( f ) g f Ideal lens is a LSIS f x g x LSIS Linearity: Brightness

30/03/2016 Michele Nappi 54

Low Pass Filter

Page 55: Trasformata di Fourier - UNISA · Example of LSIS Defocused image ( g ) is a processed version of the focused image ( f ) g f Ideal lens is a LSIS f x g x LSIS Linearity: Brightness

30/03/2016 Michele Nappi 55

Sharpening (High Pass) Filter

Page 56: Trasformata di Fourier - UNISA · Example of LSIS Defocused image ( g ) is a processed version of the focused image ( f ) g f Ideal lens is a LSIS f x g x LSIS Linearity: Brightness

30/03/2016 Michele Nappi 56

Band Pass Filter

Page 57: Trasformata di Fourier - UNISA · Example of LSIS Defocused image ( g ) is a processed version of the focused image ( f ) g f Ideal lens is a LSIS f x g x LSIS Linearity: Brightness

30/03/2016 Michele Nappi 57

Filtering Example (cont.)

Page 58: Trasformata di Fourier - UNISA · Example of LSIS Defocused image ( g ) is a processed version of the focused image ( f ) g f Ideal lens is a LSIS f x g x LSIS Linearity: Brightness

30/03/2016 Michele Nappi 58

Filtering Example

Page 59: Trasformata di Fourier - UNISA · Example of LSIS Defocused image ( g ) is a processed version of the focused image ( f ) g f Ideal lens is a LSIS f x g x LSIS Linearity: Brightness

30/03/2016 Michele Nappi 59

Filtering Example (cont.)

Page 60: Trasformata di Fourier - UNISA · Example of LSIS Defocused image ( g ) is a processed version of the focused image ( f ) g f Ideal lens is a LSIS f x g x LSIS Linearity: Brightness

30/03/2016 Michele Nappi 60

Filtering Example (cont.)

Page 61: Trasformata di Fourier - UNISA · Example of LSIS Defocused image ( g ) is a processed version of the focused image ( f ) g f Ideal lens is a LSIS f x g x LSIS Linearity: Brightness

30/03/2016 Michele Nappi 61

Frequency Bands

• Percentage of image

power enclosed in

circles (small to

large):

90, 95, 98, 99, 99.5, 99.9

Page 62: Trasformata di Fourier - UNISA · Example of LSIS Defocused image ( g ) is a processed version of the focused image ( f ) g f Ideal lens is a LSIS f x g x LSIS Linearity: Brightness

30/03/2016 Michele Nappi 62

Fourier Transform

• Computing Time

– O(n2)

• Fast Fourier Transform (FFT)

– O(nlogn)