Fourier Transform and Frequency Domain

Similar documents
Fourier Transform and Frequency Domain

Image pyramids and frequency domain

Slow mo guys Saccades.

Recap of Monday. Linear filtering. Be aware of details for filter size, extrapolation, cropping

Thinking in Frequency

Why does a lower resolution image still make sense to us? What do we lose? Image:

CEE598 - Visual Sensing for Civil Infrastructure Eng. & Mgmt.

Frequency Filtering CSC 767

Subsampling and image pyramids

CSCI 1290: Comp Photo

The Frequency Domain, without tears. Many slides borrowed from Steve Seitz

The Frequency Domain : Computational Photography Alexei Efros, CMU, Fall Many slides borrowed from Steve Seitz

The Frequency Domain. Many slides borrowed from Steve Seitz

Intelligent Visual Prosthesis

Filtering, Frequency, and Edges

Lecture 5. The Digital Fourier Transform. (Based, in part, on The Scientist and Engineer's Guide to Digital Signal Processing by Steven Smith)

Signals and Systems Lecture (S2) Orthogonal Functions and Fourier Series March 17, 2008

CS 4495 Computer Vision. Frequency and Fourier Transforms. Aaron Bobick School of Interactive Computing. Frequency and Fourier Transform

Today s lecture. The Fourier transform. Sampling, aliasing, interpolation The Fast Fourier Transform (FFT) algorithm

Spatial Vision: Primary Visual Cortex (Chapter 3, part 1)

Lecture 4 Filtering in the Frequency Domain. Lin ZHANG, PhD School of Software Engineering Tongji University Spring 2016

ECG782: Multidimensional Digital Signal Processing

Image Processing 2. Hakan Bilen University of Edinburgh. Computer Graphics Fall 2017

6.869 Advances in Computer Vision. Bill Freeman, Antonio Torralba and Phillip Isola MIT Oct. 3, 2018

ECE Digital Image Processing and Introduction to Computer Vision. Outline

Linear Operators and Fourier Transform

Announcements. Filtering. Image Filtering. Linear Filters. Example: Smoothing by Averaging. Homework 2 is due Apr 26, 11:59 PM Reading:

Computer Vision. Filtering in the Frequency Domain

Templates, Image Pyramids, and Filter Banks

I Chen Lin, Assistant Professor Dept. of CS, National Chiao Tung University. Computer Vision: 4. Filtering

Gradient-domain image processing

Frequency2: Sampling and Aliasing

3 rd class Mech. Eng. Dept. hamdiahmed.weebly.com Fourier Series

Math 56 Homework 5 Michael Downs

Information and Communications Security: Encryption and Information Hiding

Continuous-time Fourier Methods

Images have structure at various scales

Today s lecture. Local neighbourhood processing. The convolution. Removing uncorrelated noise from an image The Fourier transform

SEISMIC WAVE PROPAGATION. Lecture 2: Fourier Analysis

The Discrete Fourier Transform

Image Filtering, Edges and Image Representation

Signal Processing COS 323

Computational Data Analysis!

FILTERING IN THE FREQUENCY DOMAIN

Image Processing /6.865 Frédo Durand A bunch of slides by Bill Freeman (MIT) & Alyosha Efros (CMU)

Lecture 3: Linear Filters

Module 3 : Sampling and Reconstruction Lecture 22 : Sampling and Reconstruction of Band-Limited Signals

Index. p, lip, 78 8 function, 107 v, 7-8 w, 7-8 i,7-8 sine, 43 Bo,94-96

Analysis II: Fourier Series

Computer Vision Lecture 3


Syllabus for IMGS-616 Fourier Methods in Imaging (RIT #11857) Week 1: 8/26, 8/28 Week 2: 9/2, 9/4

3. Lecture. Fourier Transformation Sampling

Lecture 3: Linear Filters

MITOCW MITRES_6-007S11lec09_300k.mp4

Lecture 04 Image Filtering

Department of Electrical and Telecommunications Engineering Technology TEL (718) FAX: (718) Courses Description:

Reference Text: The evolution of Applied harmonics analysis by Elena Prestini

Communication Signals (Haykin Sec. 2.4 and Ziemer Sec Sec. 2.4) KECE321 Communication Systems I

Wavelets in Image Compression

Discrete Fourier Transform

Additional Pointers. Introduction to Computer Vision. Convolution. Area operations: Linear filtering

CS 179: GPU Programming. Lecture 9 / Homework 3

CITS 4402 Computer Vision

Lecture # 06. Image Processing in Frequency Domain

The Fourier series are applicable to periodic signals. They were discovered by the

Differential Equations with Boundary Value Problems

Fourier Series and Transforms

EENG580 Game 2: Verbal Representation of Course Content

Fourier Transform in Image Processing. CS/BIOEN 6640 U of Utah Guido Gerig (slides modified from Marcel Prastawa 2012)

There and back again A short trip to Fourier Space. Janet Vonck 23 April 2014

CS 179: GPU Programming. Lecture 9 / Homework 3

7 PDES, FOURIER SERIES AND TRANSFORMS Last Updated: July 16, 2012

Filtering in the Frequency Domain

PSY 310: Sensory and Perceptual Processes 1

Simon Fraser University School of Engineering Science ENSC Linear Systems Spring Instructor Jim Cavers ASB

Theory and Problems of Signals and Systems

Review of Linear System Theory

Correlation, discrete Fourier transforms and the power spectral density

Discrete Fourier Transform

Fourier Analysis PSY 310 Greg Francis. Lecture 08. Representation of information

CS711008Z Algorithm Design and Analysis

Theory of signals and images I. Dr. Victor Castaneda

MITOCW watch?v=rf5sefhttwo

E2.5 Signals & Linear Systems. Tutorial Sheet 1 Introduction to Signals & Systems (Lectures 1 & 2)

Kernel-based density. Nuno Vasconcelos ECE Department, UCSD

Convolution Spatial Aliasing Frequency domain filtering fundamentals Applications Image smoothing Image sharpening

PHYS 391 Fourier Transform Primer Eric Torrence with modifications by Dean Livelybrooks, March 2014

19. The Fourier Transform in optics

IMAGE ENHANCEMENT: FILTERING IN THE FREQUENCY DOMAIN. Francesca Pizzorni Ferrarese

ECE Digital Image Processing and Introduction to Computer Vision

Fourier Transform for Continuous Functions

f (t) K(t, u) d t. f (t) K 1 (t, u) d u. Integral Transform Inverse Fourier Transform

LECTURE 12 Sections Introduction to the Fourier series of periodic signals

Review of Analog Signal Analysis

26. The Fourier Transform in optics

Tutorial Sheet #2 discrete vs. continuous functions, periodicity, sampling

In case (1) 1 = 0. Then using and from the previous lecture,

Lab Fourier Analysis Do prelab before lab starts. PHSX 262 Spring 2011 Lecture 5 Page 1. Based with permission on lectures by John Getty

Introduction to Computer Vision. 2D Linear Systems

Transcription:

Fourier Transform and Frequency Domain http://graphics.cs.cmu.edu/courses/15-463 15-463, 15-663, 15-862 Computational Photography Fall 2017, Lecture 6

Course announcements Last call for responses to Doodle about rescheduling the September 27 th lecture! - Link available on Piazza. - Currently 17 responses. I ll pick a date on Tuesday evening. Homework 1 is being graded. - Grades with comments will be uploaded on Canvas hopefully by Wednesday. - How was it? Homework 2 has been posted. - Much larger than homework 1. - Start early! Experiments take a long time to run. - How many have read/started/finished it?

Overview of today s lecture Some history. Fourier series. Frequency domain. Fourier transform. Frequency-domain filtering. Revisiting sampling.

Slide credits Most of these slides were adapted from: Kris Kitani (15-463, Fall 2016). Some slides were inspired or taken from: Fredo Durand (MIT). James Hays (Georgia Tech).

Some history

Who is this guy?

Jean Baptiste Joseph Fourier (1768-1830) What is he famous for?

What is he famous for? The Fourier series claim (1807): Any univariate function can be rewritten as a weighted sum of sines and cosines of different frequencies. Jean Baptiste Joseph Fourier (1768-1830)

What is he famous for? The Fourier series claim (1807): Any univariate function can be rewritten as a weighted sum of sines and cosines of different frequencies. Jean Baptiste Joseph Fourier (1768-1830) and apparently also for the discovery of the greenhouse effect

Is this claim true? The Fourier series claim (1807): Any univariate function can be rewritten as a weighted sum of sines and cosines of different frequencies. Jean Baptiste Joseph Fourier (1768-1830)

Is this claim true? The Fourier series claim (1807): Any univariate function can be rewritten as a weighted sum of sines and cosines of different frequencies. Well, almost. The theorem requires additional conditions. Close enough to be named after him. Very surprising result at the time. Jean Baptiste Joseph Fourier (1768-1830)

Is this claim true? The Fourier series claim (1807): Any univariate function can be rewritten as a weighted sum of sines and cosines of different frequencies. Well, almost. The theorem requires additional conditions. Close enough to be named after him. Very surprising result at the time. Jean Baptiste Joseph Fourier (1768-1830) Malus Lagrange Legendre Laplace The committee examining his paper had expressed skepticism, in part due to not so rigorous proofs

Amusing aside Only known portrait of Adrien-Marie Legendre 1820 watercolor caricatures of French mathematicians Adrien- Marie Legendre (left) and Joseph Fourier (right) by French artist Julien-Leopold Boilly For two hundred years, people were misidentifying this portrait as him Louis Legendre (same last name, different person)

Fourier series

Basic building block Fourier s claim: Add enough of these to get any periodic signal you want!

Basic building block amplitude variable phase sinusoid angular frequency Fourier s claim: Add enough of these to get any periodic signal you want!

Examples How would you generate this function? =? +?

Examples How would you generate this function? =? +?

Examples How would you generate this function? =? +?

How would you generate this function? Examples =? +? square wave

How would you generate this function? Examples? +? square wave =

How would you generate this function? Examples? +? square wave =

How would you generate this function? Examples? +? square wave =

How would you generate this function? Examples? +? square wave =

How would you generate this function? Examples? +? square wave = How would you express this mathematically?

Examples = square wave infinite sum of sine waves How would could you visualize this in the frequency domain?

Examples = square wave infinite sum of sine waves magnitude frequency

Frequency domain

Visualizing the frequency spectrum amplitude frequency

Visualizing the frequency spectrum Recall the temporal domain visualization amplitude = + frequency

Visualizing the frequency spectrum Recall the temporal domain visualization amplitude = + How do we plot... frequency

Visualizing the frequency spectrum Recall the temporal domain visualization amplitude = + frequency

Visualizing the frequency spectrum Recall the temporal domain visualization amplitude = + frequency

Visualizing the frequency spectrum Recall the temporal domain visualization amplitude = + not visualizing the symmetric negative part frequency What is at zero frequency? Need to understand this to understand the 2D version!

Visualizing the frequency spectrum Recall the temporal domain visualization amplitude = + not visualizing the symmetric negative part frequency signal average (zero for a sine wave with no offset) Need to understand this to understand the 2D version!

Examples Spatial domain visualization Frequency domain visualization 1D 2D?

Examples Spatial domain visualization Frequency domain visualization 1D 2D What do the three dots correspond to?

Examples Spatial domain visualization Frequency domain visualization?

Examples Spatial domain visualization Frequency domain visualization

Examples How would you generate this image with sine waves?

Examples How would you generate this image with sine waves? Has both an x and y components

Examples + =?

Examples + =?

Examples + =

Basic building block amplitude variable phase sinusoid angular frequency What about nonperiodic signals? Fourier s claim: Add enough of these to get any periodic signal you want!

Fourier transform

Recalling some basics Complex numbers have two parts: rectangular coordinates what s this? what s this?

Recalling some basics Complex numbers have two parts: rectangular coordinates real imaginary

Recalling some basics Complex numbers have two parts: rectangular coordinates real imaginary Alternative reparameterization: polar coordinates how do we compute these? polar transform

Recalling some basics Complex numbers have two parts: rectangular coordinates real imaginary Alternative reparameterization: polar coordinates polar transform polar transform

Recalling some basics Complex numbers have two parts: rectangular coordinates real imaginary Alternative reparameterization: polar coordinates polar transform polar transform How do you write these in exponential form?

Recalling some basics Complex numbers have two parts: rectangular coordinates real imaginary Alternative reparameterization: polar coordinates polar transform or equivalently how did we get this? exponential form

Recalling some basics Complex numbers have two parts: rectangular coordinates real imaginary Alternative reparameterization: polar coordinates polar transform or equivalently Euler s formula exponential form This will help us understand the Fourier transform equations

discrete continuous Fourier transform Fourier transform inverse Fourier transform Where is the connection to the summation of sine waves idea?

discrete continuous Fourier transform Fourier transform inverse Fourier transform Where is the connection to the summation of sine waves idea?

Fourier transform Where is the connection to the summation of sine waves idea? Euler s formula sum over frequencies scaling parameter wave components

Fourier transform pairs spatial domain frequency domain Note the symmetry: duality property of Fourier transform

Computing the discrete Fourier transform (DFT)

Computing the discrete Fourier transform (DFT) is just a matrix multiplication: In practice this is implemented using the fast Fourier transform (FFT) algorithm.

Another way to compute the Fourier transform Use a lens! An ideal thin lens is an optical Fourier transform engine.

Fourier transforms of natural images original amplitude phase

Fourier transforms of natural images Image phase matters! cheetah phase with zebra amplitude zebra phase with cheetah amplitude

Frequency-domain filtering

Why do we care about all this?

The convolution theorem The Fourier transform of the convolution of two functions is the product of their Fourier transforms: The inverse Fourier transform of the product of two Fourier transforms is the convolution of the two inverse Fourier transforms: Convolution in spatial domain is equivalent to multiplication in frequency domain!

What do we use convolution for?

Convolution for 1D continuous signals Definition of linear shift-invariant filtering as convolution: filtered signal filter input signal Using the convolution theorem, we can interpret and implement all types of linear shift-invariant filtering as multiplication in frequency domain. Why implement convolution in frequency domain?

Frequency-domain filtering in Matlab Filtering with fft: im = double(imread( '))/255; im = rgb2gray(im); % im should be a gray-scale floating point image [imh, imw] = size(im); hs = 50; % filter half-size fil = fspecial('gaussian', hs*2+1, 10); fftsize = 1024; % should be order of 2 (for speed) and include padding im_fft = fft2(im, fftsize, fftsize); % 1) fft im with padding fil_fft = fft2(fil, fftsize, fftsize); % 2) fft fil, pad to same size as image im_fil_fft = im_fft.* fil_fft; % 3) multiply fft images im_fil = ifft2(im_fil_fft); % 4) inverse fft2 im_fil = im_fil(1+hs:size(im,1)+hs, 1+hs:size(im, 2)+hs); % 5) remove padding Displaying with fft: figure(1), imagesc(log(abs(fftshift(im_fft)))), axis image, colormap jet

Spatial domain filtering filter kernel = Fourier transform inverse Fourier transform = Frequency domain filtering

Revisiting blurring Why does the Gaussian give a nice smooth image, but the square filter give edgy artifacts? Gaussian filter Box filter

Gaussian blur

Box blur

A lens kernel is its aperture This is (one of the reasons) why we try to make lens apertures as circular as possible. circular aperture (Airy disk) An ideal thin lens is an optical Fourier transform engine. rectangular aperture

More filtering examples? filters shown in frequencydomain?

More filtering examples low-pass band-pass filters shown in frequencydomain

More filtering examples high-pass?

More filtering examples high-pass

More filtering examples original image low-pass filter? frequency magnitude

More filtering examples original image low-pass filter frequency magnitude

More filtering examples original image high-pass filter? frequency magnitude

More filtering examples original image high-pass filter frequency magnitude

More filtering examples original image band-pass filter frequency magnitude

More filtering examples original image band-pass filter frequency magnitude

More filtering examples original image band-pass filter frequency magnitude

More filtering examples original image band-pass filter frequency magnitude

Revisiting sampling

The Nyquist-Shannon sampling theorem A continuous signal can be perfectly reconstructed from its discrete version if sampling occurred with frequency: This is called the Nyquist frequency Equivalent reformulation: When downsampling, aliasing does not occur if samples are taken at the Nyquist frequency or higher.

The Nyquist-Shannon sampling theorem A continuous signal can be perfectly reconstructed from its discrete version if sampling occurred with frequency: This is called the Nyquist frequency

Gaussian pyramid How does the Nyquist-Shannon theorem relate to the Gaussian pyramid?

Gaussian pyramid How does the Nyquist-Shannon theorem relate to the Gaussian pyramid? Gaussian blurring is low-pass filtering. By blurring we try to sufficiently decrease the Nyquist frequency to avoid aliasing. How large should the Gauss blur we use be?

Frequency-domain filtering in human vision Gala Contemplating the Mediterranean Sea Which at Twenty Meters Becomes the Portrait of Abraham Lincoln (Homage to Rothko) Salvador Dali, 1976

Frequency-domain filtering in human vision Low-pass filtered version

Frequency-domain filtering in human vision High-pass filtered version

contrast Variable frequency sensitivity Experiment: Where do you see the stripes? frequency

contrast Variable frequency sensitivity Campbell-Robson contrast sensitivity curve Our eyes are sensitive to mid-range frequencies Early processing in humans filters for various orientations and scales of frequency Perceptual cues in the mid frequencies dominate perception frequency

References Basic reading: Szeliski textbook, Sections 3.4. Additional reading: Goodman, Introduction to Fourier Optics, W.H.Freeman Publishing 2004. the standard reference on Fourier optics Hubel and Wiesel, Receptive fields, binocular interaction and functional architecture in the cat's visual cortex, The Journal of Physiology 1962 a foundational paper describing information processing in the visual system, including the different types of filtering it performs; Hubel and Wiesel won the Nobel Prize in Medicine in 1981 for the discoveries described in this paper