Fourier transform

of 56 /56
Fourier Transform (Chapter 4) CS474/674 Prof. Bebis

Embed Size (px)

Transcript of Fourier transform

Image Processing Fundamentals

Fourier Transform (Chapter 4)CS474/674 Prof. Bebis1Mathematical Background:Complex NumbersA complex number x is of the form: : real part, b: imaginary part

Addition:

Multiplication:

2Mathematical Background:Complex Numbers (contd)Magnitude-Phase (i.e.,vector) representation

Magnitude: Phase:

Magnitude-Phase notation:3Mathematical Background:Complex Numbers (contd)Multiplication using magnitude-phase representation

Complex conjugate

Properties

4Mathematical Background:Complex Numbers (contd)Eulers formula

Properties

j5Mathematical Background:Sine and Cosine FunctionsPeriodic functionsGeneral form of sine and cosine functions:

6Mathematical Background:Sine and Cosine Functions

Special case: A=1, b=0, =1/2/23/23/27Mathematical Background:Sine and Cosine Functions (contd)Note: cosine is a shifted sine function:

Shifting or translating the sine function by a const b

8Mathematical Background:Sine and Cosine Functions (contd)Changing the amplitude A

9Mathematical Background:Sine and Cosine Functions (contd)Changing the period T=2/|| consider A=1, b=0: y=cos(t)

period 2/4=/2 shorter period higher frequency(i.e., oscillates faster) =4Frequency is defined as f=1/TAlternative notation: cos(t)=cos(2t/T)=cos(2ft)

10Basis Functions Given a vector space of functions, S, then if any f(t) S can be expressed as

the set of functions k(t) are called the expansion set of S.

If the expansion is unique, the set k(t) is a basis.

Image TransformsMany times, image processing tasks are best performed in a domain other than the spatial domain.Key steps:(1) Transform the image(2) Carry the task(s) in the transformed domain.(3) Apply inverse transform to return to the spatial domain.

12Transformation KernelsForward Transformation

Inverse Transformation

inverse transformation kernelforward transformation kernel13Kernel PropertiesA kernel is said to be separable if:

A kernel is said to be symmetric if:

14NotationContinuous Fourier Transform (FT)

Discrete Fourier Transform (DFT)

Fast Fourier Transform (FFT)15Fourier Series TheoremAny periodic function f(t) can be expressed as a weighted sum (infinite) of sine and cosine functions of varying frequency:

is called the fundamental frequency16Fourier Series (contd)

12317Continuous Fourier Transform (FT)Transforms a signal (i.e., function) from the spatial (x) domain to the frequency (u) domain.

where18Why is FT Useful?Easier to remove undesirable frequencies.

Faster perform certain operations in the frequency domain than in the spatial domain.19Example: Removing undesirable frequencies

remove highfrequenciesreconstructedsignalfrequenciesnoisy signalTo remove certainfrequencies, set theircorresponding F(u)coefficients to zero!20How do frequencies show up in an image?Low frequencies correspond to slowly varying information (e.g., continuous surface).High frequencies correspond to quickly varying information (e.g., edges)

Original ImageLow-passed21Example of noise reduction using FT

Input imageOutput imageSpectrumBand-pass filter22Frequency Filtering Steps1. Take the FT of f(x):

2. Remove undesired frequencies:

3. Convert back to a signal:

Well talk more about these steps later .....23DefinitionsF(u) is a complex function:

Magnitude of FT (spectrum):

Phase of FT:

Magnitude-Phase representation:

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

24Example: rectangular pulserect(x) function sinc(x)=sin(x)/x

magnitude25Example: impulse or delta functionDefinition of delta function:

Properties:

26Example: impulse or delta function (contd)FT of delta function:

1ux27Example: spatial/frequency shifts

Special Cases:

28Example: sine and cosine functionsFT of the cosine function

cos(2u0x)1/2F(u)29Example: sine and cosine functions (contd)FT of the sine function

sin(2u0x)-jF(u)30Extending FT in 2DForward FT

Inverse FT

31Example: 2D rectangle function

FT of 2D rectangle function2D sinc()32Discrete Fourier Transform (DFT)

33Discrete Fourier Transform (DFT) (contd)Forward DFT

Inverse DFT

1/Nx34Example

35Extending DFT to 2DAssume that f(x,y) is M x N.

Forward DFT

Inverse DFT:

36Extending DFT to 2D (contd)Special case: f(x,y) is N x N.

Forward DFT

Inverse DFT

u,v = 0,1,2, , N-1x,y = 0,1,2, , N-137Extending DFT to 2D (contd)

2D cos/sin functions

Visualizing DFTTypically, we visualize |F(u,v)|The dynamic range of |F(u,v)| is typically very large

Apply streching: (c is const)

before stretchingafter stretchingoriginal image|F(u,v)||D(u,v)|39DFT Properties: (1) SeparabilityThe 2D DFT can be computed using 1D transforms only:

Forward DFT:

kernel isseparable:40DFT Properties: (1) Separability (contd)Rewrite F(u,v) as follows:

Lets set:

Then:

41How can we compute F(x,v)?

How can we compute F(u,v)?

DFT Properties: (1) Separability (contd)

)N x DFT of rows of f(x,y)DFT of cols of F(x,v)42DFT Properties: (1) Separability (contd)

43DFT Properties: (2) PeriodicityThe DFT and its inverse are periodic with period N

44Symmetry Properties

DFT Properties: (4) Translationf(x,y) F(u,v)

) N

Translation in spatial domain: Translation in frequency domain:46DFT Properties: (4) Translation (contd)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)|47DFT Properties: (4) Translation (contd)To move F(u,v) at (N/2, N/2), take

) N

) N48DFT Properties: (4) Translation (contd)

no translationafter translation49DFT Properties: (5) RotationRotating f(x,y) by rotates F(u,v) by

50DFT Properties: (6) Addition/Multiplication

but 51DFT Properties: (7) Scale

52DFT Properties: (8) Average value

So:Average:F(u,v) at u=0, v=0:53Magnitude and Phase of DFTWhat is more important?

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

magnitudephase54Magnitude and Phase of DFT (contd)

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

Reconstructed image using phase only(i.e., phase determinesthe phase of each component!)

55Magnitude and Phase of DFT (contd)

56