1 methods in image analysis – lecture 3 fourier u. pitt bioengineering 2630 cmu robotics institute...

38
1 Methods in Image Analysis – Lecture 3 Fourier U. Pitt Bioengineering 2630 CMU Robotics Institute 16-725 Spring Term, 2006 George Stetten, M.D., Ph.D.

Upload: polly-fleming

Post on 25-Dec-2015

214 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 1 Methods in Image Analysis – Lecture 3 Fourier U. Pitt Bioengineering 2630 CMU Robotics Institute 16-725 Spring Term, 2006 George Stetten, M.D., Ph.D

1

Methods in Image Analysis – Lecture 3

Fourier

U. Pitt Bioengineering 2630

CMU Robotics Institute 16-725

Spring Term, 2006

George Stetten, M.D., Ph.D.

Page 2: 1 Methods in Image Analysis – Lecture 3 Fourier U. Pitt Bioengineering 2630 CMU Robotics Institute 16-725 Spring Term, 2006 George Stetten, M.D., Ph.D

2

Frequency in time vs. space

• Classical “signals and systems” usually temporal signals.

• Image processing uses “spatial” frequency.• We will review the classic temporal description first,

and then move to 2D and 3D space.

Page 3: 1 Methods in Image Analysis – Lecture 3 Fourier U. Pitt Bioengineering 2630 CMU Robotics Institute 16-725 Spring Term, 2006 George Stetten, M.D., Ph.D

3

Phase vs. Frequency

• Phase, , is angle, usually represented in radians.• (circumference of unit circle)• Frequency, , is the rate of change for phase.

• In a discrete system, the sampling frequency, , is the amount of phase-change per sample.

θ

°=360 radians 2πω

t ωθ =sω

ns ωθ =

Page 4: 1 Methods in Image Analysis – Lecture 3 Fourier U. Pitt Bioengineering 2630 CMU Robotics Institute 16-725 Spring Term, 2006 George Stetten, M.D., Ph.D

4

Euler’s Identity

e jθ = cosθ + j sinθ

Page 5: 1 Methods in Image Analysis – Lecture 3 Fourier U. Pitt Bioengineering 2630 CMU Robotics Institute 16-725 Spring Term, 2006 George Stetten, M.D., Ph.D

5

Phasor = Complex Number

Page 6: 1 Methods in Image Analysis – Lecture 3 Fourier U. Pitt Bioengineering 2630 CMU Robotics Institute 16-725 Spring Term, 2006 George Stetten, M.D., Ph.D

6

multiplication = rotate and scale

( )( )( )( )

( )

.by scale and by rotate

21

21

21

21

2211

r

err

erer

jyxjyx

rejyxz

j

jj

j

θ

θθ

θθ

θ

+=

=

++

=+=

Page 7: 1 Methods in Image Analysis – Lecture 3 Fourier U. Pitt Bioengineering 2630 CMU Robotics Institute 16-725 Spring Term, 2006 George Stetten, M.D., Ph.D

7

Spinning phasor

f 2πω =

Page 8: 1 Methods in Image Analysis – Lecture 3 Fourier U. Pitt Bioengineering 2630 CMU Robotics Institute 16-725 Spring Term, 2006 George Stetten, M.D., Ph.D

8

Page 9: 1 Methods in Image Analysis – Lecture 3 Fourier U. Pitt Bioengineering 2630 CMU Robotics Institute 16-725 Spring Term, 2006 George Stetten, M.D., Ph.D

9

Page 10: 1 Methods in Image Analysis – Lecture 3 Fourier U. Pitt Bioengineering 2630 CMU Robotics Institute 16-725 Spring Term, 2006 George Stetten, M.D., Ph.D

10

Page 11: 1 Methods in Image Analysis – Lecture 3 Fourier U. Pitt Bioengineering 2630 CMU Robotics Institute 16-725 Spring Term, 2006 George Stetten, M.D., Ph.D

11

Continuous Fourier Series

( ) ∑+∞

−∞=

=k

tjkkeatx 0ω ( )∫ −=

0

0

0

1

T

tjkk dtetx

Ta ω

Synthesis Analysis

0ω is the Fundamental Frequency

Page 12: 1 Methods in Image Analysis – Lecture 3 Fourier U. Pitt Bioengineering 2630 CMU Robotics Institute 16-725 Spring Term, 2006 George Stetten, M.D., Ph.D

12

Selected properties of Fourier Series

( ) kFs atx ⏐ →← ( ) k

Fs bty ⏐ →←

( ) ( ) kkFs BbAatBytAx +⏐ →←+

*kk aa −= ( )txfor real

( )k

Fs ajkdt

tdx0ω⏐ →←

( )∫ ⏐ →← kFs a

jkdttx

0

1

ω

Page 13: 1 Methods in Image Analysis – Lecture 3 Fourier U. Pitt Bioengineering 2630 CMU Robotics Institute 16-725 Spring Term, 2006 George Stetten, M.D., Ph.D

13

Differentiation boosts high frequencies

Page 14: 1 Methods in Image Analysis – Lecture 3 Fourier U. Pitt Bioengineering 2630 CMU Robotics Institute 16-725 Spring Term, 2006 George Stetten, M.D., Ph.D

14

Integration boosts low frequencies

Page 15: 1 Methods in Image Analysis – Lecture 3 Fourier U. Pitt Bioengineering 2630 CMU Robotics Institute 16-725 Spring Term, 2006 George Stetten, M.D., Ph.D

15

Continuous Fourier Transform

Synthesis Analysis

( ) ( )ωXtx F⏐ →←

( ) ( )∫+∞

∞−

= ωωπ

ω deXtx tj

2

1 ( ) ( ) dtetxX tjωω −+∞

∞−∫=

Page 16: 1 Methods in Image Analysis – Lecture 3 Fourier U. Pitt Bioengineering 2630 CMU Robotics Institute 16-725 Spring Term, 2006 George Stetten, M.D., Ph.D

16

( ) ⎟⎠⎞

⎜⎝⎛⏐ →←αω

αα Xtx F 1

Selected properties of Fourier Transform

( ) ( ) ( ) ( )ωω YXtytx F⏐ →←∗

( ) ( )∫∫+∞

∞−

+∞

= ωωπ

dXdttx2

-

2

2

1

Page 17: 1 Methods in Image Analysis – Lecture 3 Fourier U. Pitt Bioengineering 2630 CMU Robotics Institute 16-725 Spring Term, 2006 George Stetten, M.D., Ph.D

17

Special Transform Pairs

• Impulse has all frequences

• Average value is at frequency = 0

• Aperture produces sync function

( ) ( ) ( )ωπω ∂=⏐ →←= 2 1 Xtx F

( ) ( ) ( ) 1 =⏐ →←∂= ωXttx F

( ) ( ) ( )ωωω 1

1

1 sin2

0

,1 TX

Tt

Tttx F =⏐ →←

⎩⎨⎧

>

<=

Page 18: 1 Methods in Image Analysis – Lecture 3 Fourier U. Pitt Bioengineering 2630 CMU Robotics Institute 16-725 Spring Term, 2006 George Stetten, M.D., Ph.D

18

Discrete signals introduce aliasing

Frequency is no longer the rate of phase change in time, but rather the amount of phase change per sample.

Page 19: 1 Methods in Image Analysis – Lecture 3 Fourier U. Pitt Bioengineering 2630 CMU Robotics Institute 16-725 Spring Term, 2006 George Stetten, M.D., Ph.D

19

Sampling > 2 samples per cycle

Page 20: 1 Methods in Image Analysis – Lecture 3 Fourier U. Pitt Bioengineering 2630 CMU Robotics Institute 16-725 Spring Term, 2006 George Stetten, M.D., Ph.D

20

Sampling < 2 samples per cycle

Page 21: 1 Methods in Image Analysis – Lecture 3 Fourier U. Pitt Bioengineering 2630 CMU Robotics Institute 16-725 Spring Term, 2006 George Stetten, M.D., Ph.D

21

Under-sampled sine

( ) stx ωat sampled For

frequency.Nyquist theis 2

Page 22: 1 Methods in Image Analysis – Lecture 3 Fourier U. Pitt Bioengineering 2630 CMU Robotics Institute 16-725 Spring Term, 2006 George Stetten, M.D., Ph.D

22

Discrete Time Fourier Series

[ ] [ ]Nnxnx +=

πωω 2 assume 0 == Ns

Sampling frequency is 1 cycle per second, and fundamental frequency is some multiple of that.

Nkk aa +=Synthesis Analysis

[ ] ∑=

=Nk

tjkkeanx 0ω [ ]∑

=

−=Nk

tjkk enx

Na 0

1 ω

Page 23: 1 Methods in Image Analysis – Lecture 3 Fourier U. Pitt Bioengineering 2630 CMU Robotics Institute 16-725 Spring Term, 2006 George Stetten, M.D., Ph.D

23

Matrix representation Nj

ewπ2

= 1=Nw

Page 24: 1 Methods in Image Analysis – Lecture 3 Fourier U. Pitt Bioengineering 2630 CMU Robotics Institute 16-725 Spring Term, 2006 George Stetten, M.D., Ph.D

24

Fast Fourier Transform

• N must be a power of 2• Makes use of the tremendous

symmetry within the F-1 matrix• O(N log N) rather than O(N2)

Page 25: 1 Methods in Image Analysis – Lecture 3 Fourier U. Pitt Bioengineering 2630 CMU Robotics Institute 16-725 Spring Term, 2006 George Stetten, M.D., Ph.D

25

Discrete Time Fourier Transform

[ ] ( )∫+

π

ωω ωπ

deeXnx njj 2

1

( ) ( )( )πωω 2+= jj eXeX

Synthesis Analysis

( ) [ ] nj

n

j enxeX ωω −+∞

−∞=∑=

πω 2 assume =s

Sampling frequency is still 1 cycle per second, but now any frequency are allowed because x[n] is not periodic.

Page 26: 1 Methods in Image Analysis – Lecture 3 Fourier U. Pitt Bioengineering 2630 CMU Robotics Institute 16-725 Spring Term, 2006 George Stetten, M.D., Ph.D

26

The Periodic Spectrum

Page 27: 1 Methods in Image Analysis – Lecture 3 Fourier U. Pitt Bioengineering 2630 CMU Robotics Institute 16-725 Spring Term, 2006 George Stetten, M.D., Ph.D

27

Aliasing Outside the Base Band

sω41

sin−Perceived as

Page 28: 1 Methods in Image Analysis – Lecture 3 Fourier U. Pitt Bioengineering 2630 CMU Robotics Institute 16-725 Spring Term, 2006 George Stetten, M.D., Ph.D

28

2D Fourier TransformAnalysis

Synthesis

or separating dimensions,

F u,v( ) = f x, y( ) e− j 2π ux +vy( )dx dy−∞

+∞

∫−∞

+∞

F u,v( ) = f x, y( ) e− j 2π uxdx −∞

+∞

∫ ⎡

⎣ ⎢

⎦ ⎥

−∞

+∞

∫ e− j 2π vydy

f x,y( ) = F u,v( ) e j 2π ux +vy( )du dv−∞

+∞

∫−∞

+∞

Page 29: 1 Methods in Image Analysis – Lecture 3 Fourier U. Pitt Bioengineering 2630 CMU Robotics Institute 16-725 Spring Term, 2006 George Stetten, M.D., Ph.D

29

Properties

• Most of the usual properties, such as linearity, etc.• Shift-invariant, rather than Time-invariant• Parsevals relation becomes Rayleigh’s Theorem• Also, Separability, Rotational Invariance, and

Projection (see below)

Page 30: 1 Methods in Image Analysis – Lecture 3 Fourier U. Pitt Bioengineering 2630 CMU Robotics Institute 16-725 Spring Term, 2006 George Stetten, M.D., Ph.D

30

Separability

( ) ( ) ( )( ) ( )

( ) ( ) ( ) ( ) ( )( ) ( )( ) ( )vFyf

uFxf

vuFvFuFyfxf

then

vuFyxf

yfxfyxf

F

F

F

F

22

11

2121

21

,

,,

,

if

⏐ →←

⏐ →←

=⏐ →←

⏐ →←

=

Page 31: 1 Methods in Image Analysis – Lecture 3 Fourier U. Pitt Bioengineering 2630 CMU Robotics Institute 16-725 Spring Term, 2006 George Stetten, M.D., Ph.D

31

Rotation Invariance

( )( )θθθθ

θθθθcossin ,sincos

cossin ,sincos

vuvuF

yxyxf F

+−+

⏐ →←+−+

⎥⎦

⎤⎢⎣

⎡⎥⎦

⎤⎢⎣

⎡−

=⎥⎦

⎤⎢⎣

⎡′′

y

x

y

x

θθ

θθ

cossin

sincos

Page 32: 1 Methods in Image Analysis – Lecture 3 Fourier U. Pitt Bioengineering 2630 CMU Robotics Institute 16-725 Spring Term, 2006 George Stetten, M.D., Ph.D

32

Projection

( ) ( )

( ) ( )0 ,

,

uFuP

dyyxfxp

=

= ∫+∞

∞−

Combine with rotation, have arbitrary projection.

Page 33: 1 Methods in Image Analysis – Lecture 3 Fourier U. Pitt Bioengineering 2630 CMU Robotics Institute 16-725 Spring Term, 2006 George Stetten, M.D., Ph.D

33

Gaussian

( )2

2

2

2

2

22

222 σσσ

yxyx

eee−−+−

=seperable

Since the Fourier Transform is also separable, the spectra of the 1D

Gaussians are, themselves, separable.

g x( ) F← → ⏐ G u( )

g1 x( )∗g2 x( ) = g3 x( )

G1 u( )G2 u( ) = G3 u( )

g3 x( ) F← → ⏐ G3 u( )

Page 34: 1 Methods in Image Analysis – Lecture 3 Fourier U. Pitt Bioengineering 2630 CMU Robotics Institute 16-725 Spring Term, 2006 George Stetten, M.D., Ph.D

34

Hankel TransformFor radially symmetrical functions

( ) ( )( ) ( )

( ) ( ) ( )

( ) ( )qFdrrderf

dydxeyxfvuF

vuqqFvuF

yxrrfyxf

rqrj

r

vyuxj

r

r

=⎥⎦

⎤⎢⎣

==

+==

+==

∫ ∫

∫ ∫∞

+−∞+

∞−

∞+

∞−

,,

,,

,,

0

2

0

cos2

2

222

222

θπ

θπ

π

Page 35: 1 Methods in Image Analysis – Lecture 3 Fourier U. Pitt Bioengineering 2630 CMU Robotics Institute 16-725 Spring Term, 2006 George Stetten, M.D., Ph.D

35

Elliptical Fourier Series for 2D Shape

( ) kFs atx ⏐ →←

( ) kFs bty ⏐ →←

Parametric function, usually with constant velocity.

( )00,center ba=

Truncate harmonics to smooth.

Page 36: 1 Methods in Image Analysis – Lecture 3 Fourier U. Pitt Bioengineering 2630 CMU Robotics Institute 16-725 Spring Term, 2006 George Stetten, M.D., Ph.D

36

Fourier shape in 3D

• Fourier surface of 3D shapes (parameterized on surface).

• Spherical Harmonics (parameterized in spherical coordinates).

• Both require coordinate system relative to the object. How to choose? Moments?

• Problem of poles: singularities cannot be avoided

Page 37: 1 Methods in Image Analysis – Lecture 3 Fourier U. Pitt Bioengineering 2630 CMU Robotics Institute 16-725 Spring Term, 2006 George Stetten, M.D., Ph.D

37

Quaternions – 3D phasors

4321 kajaiaaa +++=

1222 −==== ijkkji

4321* kajaiaaa −−−=

Product is defined such that rotation by arbitrary angles from arbitrary starting points become simple multiplication.

( )2

12

42

32

22

1 aaaaa +++=

( ) ( ) ( ) ( )44332211 bakbajbaibaba +++++++=+

Page 38: 1 Methods in Image Analysis – Lecture 3 Fourier U. Pitt Bioengineering 2630 CMU Robotics Institute 16-725 Spring Term, 2006 George Stetten, M.D., Ph.D

38

Summary

• Fourier useful for image “processing”, convolution becomes multiplication.

• Fourier less useful for shape.• Fourier is global, while shape is local.• Fourier requires object-specific coordinate system.