Transform ácie obrazu

62
Transformácie obrazu Gonzales, Woods: Digital Image Processing kapitola: Image transforms

description

Transform ácie obrazu. Gonzales, Woods: Digital Image Processing k apitola : Image transforms. Fourierova transformácia. Jean Baptiste Joseph Fourier (1768-1830) Akákoľvek funkcia f(x) môže byť vyjadrená ako vážený súčet sínusov a kosínusov. Suma s í nusov a kos ínusov. - PowerPoint PPT Presentation

Transcript of Transform ácie obrazu

Page 1: Transform ácie obrazu

Transformácie obrazu

Gonzales, Woods: Digital Image Processingkapitola: Image transforms

Page 2: Transform ácie obrazu

Fourierova transformácia

Jean Baptiste Joseph Fourier (1768-1830)

Akákoľvek funkcia f(x) môže byť vyjadrená ako vážený súčet sínusov a kosínusov

Page 3: Transform ácie obrazu

Suma sínusov a kosínusov

A sin(ωx+φ)

Page 4: Transform ácie obrazu

Time and Frequency

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

Page 5: Transform ácie obrazu

Time and Frequency

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

= +

Page 6: Transform ácie obrazu

Frequency Spectra

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

= +

Page 7: Transform ácie obrazu

Frequency Spectra

Page 8: Transform ácie obrazu

= +

=

Frequency Spectra

Page 9: Transform ácie obrazu

= +

=

Frequency Spectra

Page 10: Transform ácie obrazu

= +

=

Frequency Spectra

Page 11: Transform ácie obrazu

= +

=

Frequency Spectra

Page 12: Transform ácie obrazu

= +

=

Frequency Spectra

Page 13: Transform ácie obrazu

= 1

1sin(2 )

k

A ktk

Frequency Spectra

Page 14: Transform ácie obrazu

Frequency Spectra

Page 15: Transform ácie obrazu

FT: Just a change of basis

.

.

.

* =

M * f(x) = F(w)

Page 16: Transform ácie obrazu

IFT: Just a change of basis

.

.

.

* =

M-1 * F(w) = f(x)

Page 17: Transform ácie obrazu
Page 18: Transform ácie obrazu

Fourierova transformáciaAk f(x) je spojitá funkcia s reálnou premenou x,potom Fourierovou transformáciou F(x) je

Inverznou Fourierovou transformáciou nazývame

pár Fourierovej transformácie

Page 19: Transform ácie obrazu

Fourier Transform

uxAsin(

f(x) F(u)Fourier Transform

F(u) f(x)Inverse Fourier Transform

Pre každé u od 0 po inf, F(u) obsahuje amplitudu A and fázu f odpovedajúceho sinusu

22 )()( uIuRA )(

)(tan 1

uR

uI

Page 20: Transform ácie obrazu

Definitions F(u) sú komplexne čísla:

Magnitúda FT (spektrum):

Fázový uhol FT:

Reprezentácia pomocou magnitúdy a fázy:

Power of f(x): P(u)=|F(u)|2=

Page 21: Transform ácie obrazu

FT – je periodická s periódou N, to znamená, že na jej určenie stačí jedna perióda vo frekvenčnej oblasti.

Page 22: Transform ácie obrazu

2D Fourierova transformácia

Fourierova transformáci je ľahko rozšíriteľná do 2D

Page 23: Transform ácie obrazu

Príklad 2D funkcie

Page 24: Transform ácie obrazu
Page 25: Transform ácie obrazu
Page 26: Transform ácie obrazu
Page 27: Transform ácie obrazu
Page 28: Transform ácie obrazu
Page 29: Transform ácie obrazu
Page 30: Transform ácie obrazu
Page 31: Transform ácie obrazu
Page 32: Transform ácie obrazu
Page 33: Transform ácie obrazu

Sinusoidne vzory sa zobrazia vo frekvenčnom spektre ako body.

Page 34: Transform ácie obrazu

Nízke frekvencie sú pri strede a vysoké na okrajoch

Page 35: Transform ácie obrazu
Page 36: Transform ácie obrazu
Page 37: Transform ácie obrazu
Page 38: Transform ácie obrazu

Sampling Theorem

Continuous signal:

Shah function (Impulse train):

xf

x

Sampled function:

n

s nxxxfxsxfxf 0

xs

x0x

n

nxxxs 0

Page 39: Transform ácie obrazu

Sampling

Page 40: Transform ácie obrazu

Sampling and the Nyquist rate

Pri vzorkovaní spojitej funkcie môže vzniknút aliasing ak vzorkovacia frekvencia nie je dostatočne vyskoká

Vzorkovacia frekvencia musí byť taky vyskoká aby zachytila aj tie najvyžšie frekvencie obrazu

Page 41: Transform ácie obrazu

Predísť aliasingu: Vzorkovacia frekvencia > 2 * max

frekvencia v obraze Treba viac ako 2 vzorky na periodu Minimálna vzorkovacia frekvencia

sa nazýva Nyquist rate

Sampling and the Nyquist rate

Page 42: Transform ácie obrazu

Diskrétna Fourierova transformácia

Page 43: Transform ácie obrazu

Rozšírenie DFT do 2D

Predpokladajme že f(x,y) je M x N.

DFT

Inverzná DFT:

Page 44: Transform ácie obrazu

Filtre

Page 45: Transform ácie obrazu

Visualizing DFT Typically, we visualize |F(u,v)| The dynamic range of |F(u,v)| is typically

very large

Apply streching:(c is

const)

before scaling after scalingoriginal image

Page 46: Transform ácie obrazu

DFT Properties: (1) Separability

The 2D DFT can be computed using 1D transforms only:

Forward DFT:

Inverse DFT:

2 ( ) 2 ( ) 2 ( )ux vy ux vy

j j jN N Ne e e

kernel isseparable:

Page 47: Transform ácie obrazu

DFT Properties: (1) Separability

Rewrite F(u,v) as follows:

Let’s set:

Then:

Page 48: Transform ácie obrazu

How can we compute F(x,v)?

How can we compute F(u,v)?

DFT Properties: (1) Separability

)

N x DFT of rows of f(x,y)

DFT of cols of F(x,v)

Page 49: Transform ácie obrazu

DFT Properties: (1) Separability

Page 50: Transform ácie obrazu

DFT Properties: (2) Periodicity

The DFT and its inverse are periodic with period N

Page 51: Transform ácie obrazu

DFT Properties: (3) Symmetry

• If f(x,y) is real, then

Page 52: Transform ácie obrazu

DFT Properties: (4) Translation

f(x,y) F(u,v)

) N

• Translation is spatial domain:

• Translation is frequency domain:

Page 53: Transform ácie obrazu

DFT Properties: (4) Translation

Warning: to show a full period, we need to translate the origin of the transform at u=N/2 (or at (N/2,N/2) in 2D)

|F(u-N/2)|

|F(u)|

Page 54: Transform ácie obrazu

DFT Properties: (4) Translation

To move F(u,v) at (N/2, N/2), take

Using ) N

Page 55: Transform ácie obrazu

DFT Properties: (4) Translation

no translation after translation

Page 56: Transform ácie obrazu

DFT Properties: (5) Rotation

Otočením f(x,y) o uhol θ, sa otočí F(u,v) o ten istý uhol θ v opačnom smere

Page 57: Transform ácie obrazu

DFT Properties: (6) Addition/Multiplication

but …

Page 58: Transform ácie obrazu

DFT Properties: (7) Scale

Page 59: Transform ácie obrazu

DFT Properties: (8) Average value

So:

Average:

F(u,v) at u=0, v=0:

Page 60: Transform ácie obrazu

Magnitude and Phase of DFT

What is more important?

Hint: use inverse DFT to reconstruct the image using magnitude or phase only information

magnitude phase

Page 61: Transform ácie obrazu

Magnitude and Phase of DFT

Reconstructed image using magnitude only(i.e., magnitude determines the contribution of each component!)

Reconstructed image using phase only(i.e., phase determineswhich components are present!)

Page 62: Transform ácie obrazu

Magnitude and Phase of DFT