Fourier Transform 2D Discrete Fourier Transform - 2D

Slides:



Advertisements
Similar presentations
Digital Kommunikationselektronik TNE027 Lecture 5 1 Fourier Transforms Discrete Fourier Transform (DFT) Algorithms Fast Fourier Transform (FFT) Algorithms.
Advertisements

Symmetry and the DTFT If we know a few things about the symmetry properties of the DTFT, it can make life simpler. First, for a real-valued sequence x(n),
Fourier Transform (Chapter 4)
Digital Image Processing
S. Mandayam/ ECOMMS/ECE Dept./Rowan University Electrical Communications Systems Spring 2005 Shreekanth Mandayam ECE Department Rowan University.
Reminder Fourier Basis: t  [0,1] nZnZ Fourier Series: Fourier Coefficient:
Chapter 4 Image Enhancement in the Frequency Domain.
MSP15 The Fourier Transform (cont’) Lim, MSP16 The Fourier Series Expansion Suppose g(t) is a transient function that is zero outside the interval.
Digital Image Processing Chapter 4: Image Enhancement in the Frequency Domain.
Image Enhancement in the Frequency Domain Part I Image Enhancement in the Frequency Domain Part I Dr. Samir H. Abdul-Jauwad Electrical Engineering Department.
S. Mandayam/ ECOMMS/ECE Dept./Rowan University Electrical Communications Systems ECE Spring 2007 Shreekanth Mandayam ECE Department Rowan University.
Some Properties of the 2-D Fourier Transform Translation Distributivity and Scaling Rotation Periodicity and Conjugate Symmetry Separability Convolution.
S. Mandayam/ ECOMMS/ECE Dept./Rowan University Electrical Communications Systems ECE Spring 2007 Shreekanth Mandayam ECE Department Rowan University.
Fourier Theory and its Application to Vision
Chapter 4 Image Enhancement in the Frequency Domain.
Transforms: Basis to Basis Normal Basis Hadamard Basis Basis functions Method to find coefficients (“Transform”) Inverse Transform.
DREAM PLAN IDEA IMPLEMENTATION Introduction to Image Processing Dr. Kourosh Kiani
Input image Output image Transform equation All pixels Transform equation.
Digital Image Processing, 2nd ed. © 2002 R. C. Gonzalez & R. E. Woods Chapter 4 Image Enhancement in the Frequency Domain Chapter.
CHAPTER 8 Fourier Filters IMAGE ANALYSIS A. Dermanis.
G52IIP, School of Computer Science, University of Nottingham 1 Image Transforms Fourier Transform Basic idea.
Topic 7 - Fourier Transforms DIGITAL IMAGE PROCESSING Course 3624 Department of Physics and Astronomy Professor Bob Warwick.
Integral Transform Dongsup Kim Department of Biosystems, KAIST Fall, 2004.
Discrete-Time and System (A Review)
University of Ioannina - Department of Computer Science Filtering in the Frequency Domain (Fundamentals) Digital Image Processing Christophoros Nikou
1 Chapter 8 The Discrete Fourier Transform 2 Introduction  In Chapters 2 and 3 we discussed the representation of sequences and LTI systems in terms.
2D Image Fourier Spectrum.
Image Processing Fourier Transform 1D Efficient Data Representation Discrete Fourier Transform - 1D Continuous Fourier Transform - 1D Examples.
CSC589 Introduction to Computer Vision Lecture 8
1 Chapter 4: Frequency Domain Processing Image Transformations IUST.
The Discrete Fourier Transform. The Fourier Transform “The Fourier transform is a mathematical operation with many applications in physics and engineering.
Transforms. 5*sin (2  4t) Amplitude = 5 Frequency = 4 Hz seconds A sine wave.
Image Processing © 2002 R. C. Gonzalez & R. E. Woods Lecture 4 Image Enhancement in the Frequency Domain Lecture 4 Image Enhancement.
Digital Image Processing Homework II Fast Fourier Transform 2012/03/28 Chih-Hung Lu ( 呂志宏 ) Visual Communications Laboratory Department of Communication.
1 Chapter 5 Image Transforms. 2 Image Processing for Pattern Recognition Feature Extraction Acquisition Preprocessing Classification Post Processing Scaling.
Part I: Image Transforms DIGITAL IMAGE PROCESSING.
09/19/2002 (C) University of Wisconsin 2002, CS 559 Last Time Color Quantization Dithering.
1 © 2010 Cengage Learning Engineering. All Rights Reserved. 1 Introduction to Digital Image Processing with MATLAB ® Asia Edition McAndrew ‧ Wang ‧ Tseng.
Digital Image Processing Chapter 4 Image Enhancement in the Frequency Domain Part I.
Lecture 7: Sampling Review of 2D Fourier Theory We view f(x,y) as a linear combination of complex exponentials that represent plane waves. F(u,v) describes.
Digital Signal Processing Chapter 3 Discrete transforms.
7- 1 Chapter 7: Fourier Analysis Fourier analysis = Series + Transform ◎ Fourier Series -- A periodic (T) function f(x) can be written as the sum of sines.
Dr. Scott Umbaugh, SIUE Discrete Transforms.
Frequency Domain Processing Lecture: 3. In image processing, linear systems are at the heart of many filtering operations, and they provide the basis.
Lecture 7 Transformations in frequency domain 1.Basic steps in frequency domain transformation 2.Fourier transformation theory in 1-D.
2D Sampling Goal: Represent a 2D function by a finite set of points.
Fourier Transform.
IMAGE SAMPLING AND IMAGE QUANTIZATION 1. Introduction
CS 376b Introduction to Computer Vision 03 / 17 / 2008 Instructor: Michael Eckmann.
Image hole-filling. Agenda Project 2: Will be up tomorrow Due in 2 weeks Fourier – finish up Hole-filling (texture synthesis) Image blending.
2D Fourier Transform.
BYST Xform-1 DIP - WS2002: Fourier Transform Digital Image Processing Bundit Thipakorn, Ph.D. Computer Engineering Department Fourier Transform and Image.
Fourier transform.
Fourier Transform (Chapter 4) CS474/674 – Prof. Bebis.
Digital Image Processing Lecture 8: Fourier Transform Prof. Charlene Tsai.
Digital Image Processing Chapter - 4
Digital Image Processing , 2008
Chapter 4 Discrete-Time Signals and transform
Jean Baptiste Joseph Fourier
Image Enhancement and Restoration
DIGITAL SIGNAL PROCESSING ELECTRONICS
Linear Filters and Edges Chapters 7 and 8
The Fourier Transform Jean Baptiste Joseph Fourier.
Image Enhancement in the
4.1 DFT In practice the Fourier components of data are obtained by digital computation rather than by analog processing. The analog values have to be.
Chapter 8 The Discrete Fourier Transform
Fourier Transforms.
Digital Image Procesing Unitary Transforms Discrete Fourier Trasform (DFT) in Image Processing DR TANIA STATHAKI READER (ASSOCIATE PROFFESOR) IN SIGNAL.
Chapter 3 Sampling.
Lecture 4 Image Enhancement in Frequency Domain
Presentation transcript:

Fourier Transform 2D Discrete Fourier Transform - 2D Image Processing Fourier Transform 2D Discrete Fourier Transform - 2D Continues Fourier Transform - 2D Fourier Properties Convolution Theorem

The 2D Discrete Fourier Transform For an image f(x,y) x=0..N-1, y=0..M-1, there are two-indices basis functions Bu.v(x,y): u=0..N-1, M=0..M-1 The inner product of 2 functions (in 2D) is defined similarly to the 1D case :

V U Note, buv and b-u,-v have similar frequencies but inverted shifts

The 2D Discrete Fourier Transform The 2D Discrete Fourier Transform (DFT) is defined as: The Inverse Discrete Fourier Transform (IDFT) is defined as: u = 0, 1, 2, ..., N-1 v = 0, 1, 2, ..., M-1 Matlab: F=fft2(f); y = 0, 1, 2, ..., N-1 x = 0, 1, 2, ..., M-1 Matlab: F=ifft2(f);

Placing the coefficients u -v

Visualizing the Fourier Transform Image using Matlab Routines F(u,v) is a Fourier transform of f(x,y) and it has complex entries. F = fft2(f); In order to display the Fourier Spectrum |F(u,v)| Reduce dynamic range of |F(u,v)| by displaying the log: D = log(1+abs(F)); Cyclically rotate the image so that F(0,0) is in the center: D = fftshift(D); Example: |F(u)| = 100 4 2 1 0 0 1 2 4 Display in Range([0..10]): log(1+|F(u)|) = 4.62 1.61 1.01 0.69 0 0 0.69 1.01 1.61 log(1+|F(u)|)/0.0462 = 10 4 2 1 0 0 1 2 4 fftshift(log(1+|F(u)|) = 0 1 2 4 10 4 2 1 0

Visualizing the Fourier Image - Example Original |F(u,v)| log(1 + |F(u,v)|) fftshift(log(1 + |F(u,v)|))

Fourier Image = |F(u,v)| Original Fourier Image = |F(u,v)| Shifted Fourier Image Shifted Log Fourier Image = log(1+ |F(u,v)|)

Phase and Magnitude Curious fact Demonstration all natural images have about the same magnitude transform hence, phase seems to matter, but magnitude largely doesn’t Demonstration Take two pictures, swap the phase transforms, compute the inverse - what does the result look like? Slide: Freeman & Durand

Slide: Freeman & Durand

This is the magnitude transform of the cheetah pic Slide: Freeman & Durand

This is the phase transform of the cheetah pic Slide: Freeman & Durand

Slide: Freeman & Durand

This is the magnitude transform of the zebra pic Slide: Freeman & Durand

This is the phase transform of the zebra pic Slide: Freeman & Durand

Reconstruction with zebra phase, cheetah magnitude Slide: Freeman & Durand

Reconstruction with cheetah phase, zebra magnitude Slide: Freeman & Durand

Properties of the 2D Fourier Transform

Symmetry of the Fourier Transform for real signals For real signals/images:

Properties: Cont. Separability Thus, performing a 2D Fourier Transform is equivalent to performing 2 1D transforms: 1. Perform 1D transform on EACH column of image f(x,y), obtaining F(x,v). 2. Perform 1D transform on EACH row of F(x,v), obtaining F(u,v). Higher Dimensions: Fourier in any dimension can be performed by applying 1D transform on each dimension.

Example 2D Image Fourier Spectrum

Properties: 2D Transformations Translation: The Fourier Spectrum remains unchanged under translation: Rotation: Rotation of f(x,y) by   rotation of F(u,v) by  Scaling:

Example - Rotation 2D Image 2D Image - Rotated Fourier Spectrum

Fourier Transform Examples Image Domain Frequency Domain

Fourier Transform Examples Image Domain Frequency Domain

Fourier Transform Examples Image Domain Frequency Domain

Fourier Transform Examples Image Domain Frequency Domain

Fourier Transform Examples Image Domain Frequency Domain

Why do we need representation in the frequency domain? Relatively easy solution Problem in Frequency Space Solution in Frequency Space Inverse Fourier Transform Fourier Transform Difficult solution Solution of Original Problem Original Problem

The Convolution Theorem Convolution in one domain is multiplication in the other and vice versa

The Convolution Theorem and likewise

The Convolution Theorem A convolution can be represented as a matrix multiplication: y=Ax where A is a circulant matrix. Let F be a matrix composed of the Fourier bases: FTy=FTAFFTx Fourier bases are the eigenvectors of circulant matrices, thus: Y=DX where X and Y are the Fourier pairs of x and y, resp. and D is a diagonal matrix. The Convolution theorem is nothing than diagonalizing the system.

Convolution Theorem - Example f(x) g(x) f * g (x) 1 1 1 0.8 0.8 0.8 0.6 0.6 0.6 0.4 0.4 0.4 0.2 0.2 0.2 50 100 50 100 50 100 F(u) G(u) F(u)G(u) F-1[F(u) G(u)] 50 100 2 4 6 8 10 0.2 0.4 0.6 0.8 1

Convolution Theorem - 2D Example f(x,y) g(x,y) f * g (x,y) F(u,v) G(u,v) F(u,v) G(u,v) F-1[F(u,v) ׳ G(u,v)]

* . h(x) = H() = = Example: What is the Fourier Transform of: h(x) x -1 1 f(x) f(x) h(x) = * -0.5 0.5 -0.5 0.5 F() F() . H() = F() =

Example: What is the Fourier Transform of the Dirac Function? Proof : Consider any function f(x) = *

Example: What is the Fourier Transform of a constant function? Proof : Consider any function g(x) = 

Sampling The Image Sampling a function f(x) with impulse train of cycle T produces replicas in the frequency domain with cycle 1/T: f(x) |F()| ^ F x  * f(x) |F()| ^ F  x T 1/T f(x) |F()| ^ F  x -1/2T 1/2T

Cyclic and symmetry of discrete signals 1 cycle -N/2 N/2 N-1 Due to replicas: F(k)=F(N+k) Due to symmetry: F(k)=F*(-k)=F*(N-k) In 2D:

Undersampling and Aliasing x f(x)  |F()| F ^ x f(x) F ^ |F()|  T 1/T * f(x) |F()| ^ F  x -1/2T 1/2T |F()| f(x) ^ F  x T’ 1/T’ f(x) |F()| ^ F  x -1/2T’ 1/2T’

Critical Sampling If the maximal frequency of f(x) is max , it is clear from the above replicas that max should be smaller that 1/2T. Alternatively: Nyquist Theorem: If the maximal frequency of f(x) is max the sampling rate should be larger than 2max in order to fully reconstruct f(x) from its samples. 2max is called the Nyquist frequency. If the sampling rate is smaller than 2max overlapping replicas produce aliasing. |F()|  -1/2T 1/2T

Critical Sampling Input Reconstructed Demo: B. Freeman

Aliasing Input Reconstructed Demo: B. Freeman

Aliasing

Aliasing in Color Images Image demosaicing may produce aliasing in color planes. How can we reduce aliasing in digital cameras?

Sampling the Transform Sampling a function F() with impulse train of cycle S produces replicas in the image domain with cycle 1/S: f(x) |F()| ^ F-1 x  * ^ F-1 x  S 1/S ^ |F()| f(x) F-1 x 

Sampling Image & Transform Sampling both f(x) with impulse train of cycle T and F() with impulse train of cycle S: f(x) |F()| ^ F x  * ^ F  x T 1/T ^ F  x -1/2T 1/2T ^ F-1  ... ... S 1/T 1/S

Number of Samples Question: Assuming f(x) was samples with N samples. What is the minimal number of samples in F() in order to fully reconstruct f(x) ? Answer: If we sample f(x) with N samples of cycle T, the support of f(x) is NT. The support of F() is 1/T in the frequency domain. If we sample F() with M samples, the sample cycle is 1/MT. The replicas in the spatial domain are each MT. In order to avoid replicas overlap, MT should be equal or bigger than NT (the function support).

Optimal Interpolation If sampling rate is above Nyquist - it is possible to fully reconstruct f(x) from its samples: f(x) |F()| ^ F-1  x -1/2T 1/2T * f(x) |F()| ^ F-1 1  x -1/2T 1/2T f(x) |F()| ^ F-1  x -1/2T 1/2T

Image Scaling How is it possible to scale a digitized image? f(x) ^ F  x T -1/2T 1/2T |F()| f(x) ^ F  x T/2 -1/T 1/T

Image Scaling: Example

Fast Fourier Transform - FFT u = 0, 1, 2, ..., N-1 O(n2) operations even x odd x Fourier Transform of of N/2 even points Fourier Transform of of N/2 odd points 0 1 2 3 4 5 6 7 0 2 4 6 1 3 5 7 All sampling points Odd sampling points Even The Fourier transform of N inputs, can be performed as 2 Fourier Transforms of N/2 inputs each + one complex multiplication and addition for each value. Thus, if F(N) is the computation complexity of FFT: F(N)=F(N/2)+F(N/2)+O(N)  F(N)=N logN

FFT of NxN Image: O(N2 log(N)) operations F(0) F(1) F(2) F(3) F(4) F(5) F(6) F(7) F(0) F(2) F(4) F(6) F(1) F(3) F(5) F(7) F(0) F(4) F(2) F(6) F(1) F(5) F(3) F(7) F(0) F(1) F(2) F(3) F(4) F(5) F(6) F(7) 2-point transform 4-point transform FFT FFT : O(N log(N)) operations FFT of NxN Image: O(N2 log(N)) operations Reference: James W. Cooley and John W. Tukey, "An algorithm for the machine calculation of complex Fourier series," Math. Comput. 19, 297–301 (1965).