The Fourier Transform

Similar documents
Digital Image Processing. Image Enhancement: Filtering in the Frequency Domain

Digital Image Processing

Frequency Domain Enhancement

Transforms and Frequency Filtering

Digital Image Processing. Filtering in the Frequency Domain (Application)

Midterm Review. Image Processing CSE 166 Lecture 10

TDI2131 Digital Image Processing

LAB MANUAL SUBJECT: IMAGE PROCESSING BE (COMPUTER) SEM VII

Lecture 12: Image Processing and 2D Transforms

USE OF FT IN IMAGE PROCESSING IMAGE PROCESSING (RRY025)

CoE4TN4 Image Processing. Chapter 4 Filtering in the Frequency Domain

Lecture #10. EECS490: Digital Image Processing

Discrete Fourier Transform (DFT)

DIGITAL IMAGE PROCESSING (COM-3371) Week 2 - January 14, 2002

The Discrete Fourier Transform. Claudia Feregrino-Uribe, Alicia Morales-Reyes Original material: Dr. René Cumplido

Fourier Transforms and the Frequency Domain

06: Thinking in Frequencies. CS 5840: Computer Vision Instructor: Jonathan Ventura

Fourier analysis of images

1.Discuss the frequency domain techniques of image enhancement in detail.

Computer Vision, Lecture 3

Midterm is on Thursday!

IMAGE ENHANCEMENT IN SPATIAL DOMAIN

2D Discrete Fourier Transform

Digital Image Processing. Frequency Domain Filtering

(i) Understanding of the characteristics of linear-phase finite impulse response (FIR) filters

Image acquisition. Midterm Review. Digitization, line of image. Digitization, whole image. Geometric transformations. Interpolation 10/26/2016

Image Filtering. Median Filtering

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

DIGITAL IMAGE PROCESSING UNIT III

IMAGE PROCESSING: AREA OPERATIONS (FILTERING)

Fourier Transform. Any signal can be expressed as a linear combination of a bunch of sine gratings of different frequency Amplitude Phase

(i) Understanding of the characteristics of linear-phase finite impulse response (FIR) filters

Design of FIR Filters

Prof. Feng Liu. Fall /04/2018

ECEGR Lab #8: Introduction to Simulink

Digital Filters IIR (& Their Corresponding Analog Filters) Week Date Lecture Title

Image analysis. CS/CME/BIOPHYS/BMI 279 Fall 2015 Ron Dror

Understanding Digital Signal Processing

Digital Image Processing. Digital Image Fundamentals II 12 th June, 2017

CoE4TN4 Image Processing. Chapter 3: Intensity Transformation and Spatial Filtering

System analysis and signal processing

Non Linear Image Enhancement

Digital Image Processing

LABORATORY - FREQUENCY ANALYSIS OF DISCRETE-TIME SIGNALS

Digital Image Processing 3/e

Multiple Input Multiple Output (MIMO) Operation Principles

Electrical & Computer Engineering Technology

Image Enhancement. DD2423 Image Analysis and Computer Vision. Computational Vision and Active Perception School of Computer Science and Communication

Sampling and Reconstruction of Analog Signals

DFT: Discrete Fourier Transform & Linear Signal Processing

Digital Image Processing. Lecture 5 (Enhancement) Bu-Ali Sina University Computer Engineering Dep. Fall 2009

Sharpening Spatial Filters ( high pass)

Lecture 3 Complex Exponential Signals

International Journal of Digital Application & Contemporary research Website: (Volume 1, Issue 7, February 2013)

Laboratory Assignment 4. Fourier Sound Synthesis

Image analysis. CS/CME/BioE/Biophys/BMI 279 Oct. 31 and Nov. 2, 2017 Ron Dror

קורס גרפיקה ממוחשבת 2008 סמסטר ב' Image Processing 1 חלק מהשקפים מעובדים משקפים של פרדו דוראנד, טומס פנקהאוסר ודניאל כהן-אור

ESE 150 Lab 04: The Discrete Fourier Transform (DFT)

Biomedical Signals. Signals and Images in Medicine Dr Nabeel Anwar

Exercise Problems: Information Theory and Coding

Digital Image Processing

Image Enhancement in the Spatial Domain (Part 1)

Image Smoothening and Sharpening using Frequency Domain Filtering Technique

Image restoration and color image processing

Practical Image and Video Processing Using MATLAB

Digital Image Processing COSC 6380/4393

Image Processing. What is an image? קורס גרפיקה ממוחשבת 2008 סמסטר ב' Converting to digital form. Sampling and Reconstruction.

IMAGE PROCESSING (RRY025) THE CONTINUOUS 2D FOURIER TRANSFORM

The Scientist and Engineer's Guide to Digital Signal Processing By Steven W. Smith, Ph.D.

ESE 150 Lab 04: The Discrete Fourier Transform (DFT)

Fourier Signal Analysis

EE 215 Semester Project SPECTRAL ANALYSIS USING FOURIER TRANSFORM

OPTICAL IMAGE FORMATION

Neurophysiology. The action potential. Why should we care? AP is the elemental until of nervous system communication

(i) Understanding the basic concepts of signal modeling, correlation, maximum likelihood estimation, least squares and iterative numerical methods

Digital Imaging Systems for Historical Documents

Chapter 3. Study and Analysis of Different Noise Reduction Filters

Lecture 3: Linear Filters

DIGITAL FILTERS. !! Finite Impulse Response (FIR) !! Infinite Impulse Response (IIR) !! Background. !! Matlab functions AGC DSP AGC DSP

DISCRETE FOURIER TRANSFORM AND FILTER DESIGN

Introduction to Wavelet Transform. Chapter 7 Instructor: Hossein Pourghassem

EEL 6562 Image Processing and Computer Vision Image Restoration

Digital Filters FIR and IIR Systems

Image analysis. CS/CME/BioE/Biophys/BMI 279 Oct. 31 and Nov. 2, 2017 Ron Dror

Applications of Linear Algebra in Signal Sampling and Modeling

Automatic processing to restore data of MODIS band 6

TDI2131 Digital Image Processing

G(f ) = g(t) dt. e i2πft. = cos(2πf t) + i sin(2πf t)

EE 791 EEG-5 Measures of EEG Dynamic Properties

Multirate Digital Signal Processing

MATLAB 6.5 Image Processing Toolbox Tutorial

Lecture 3, Multirate Signal Processing

Part 2: Fourier transforms. Key to understanding NMR, X-ray crystallography, and all forms of microscopy

A.V.C. COLLEGE OF ENGINEERING DEPARTEMENT OF CSE CP7004- IMAGE PROCESSING AND ANALYSIS UNIT 1- QUESTION BANK

McGraw-Hill Irwin DIGITAL SIGNAL PROCESSING. A Computer-Based Approach. Second Edition. Sanjit K. Mitra

Signals and Systems Using MATLAB

Kate Allstadt s final project for ESS522 June 10, The Hilbert transform is the convolution of the function f(t) with the kernel (- πt) - 1.

Harmonic Analysis. Purpose of Time Series Analysis. What Does Each Harmonic Mean? Part 3: Time Series I

BIOMEDICAL SIGNAL PROCESSING (BMSP) TOOLS

Brief Introduction to Signals & Systems. Phani Chavali

Transcription:

The Fourier Transform Introduction to Digital Signal Processing (886457) 6 1 / 56

Contents Introduction Fourier Transforms One-dimensional DFT Two-dimensional DFT Fourier Transforms Function in Octave Filtering in the Frequency Domain Ideal filtering Gaussian filtering 2 / 56

Introduction A transform represents the pixel values in some other, but equivalent form. Transforms allow for some very efficient and powerful algorithms. 3 / 56

Introduction The Fourier Transform is of fundamental importance to image processing. It allows us to perform tasks which would be impossible to perform any other way; its efficiency allows us to perform other tasks more quickly. 4 / 56

The Fourier Transform The Fourier Transform provides, among other things, a powerful alternative to linear spatial filtering; it is more efficient to use the Fourier transform than a spatial filter for a large filter. The Fourier Transform also allows us to isolate and process particular image frequencies, and so perform low-pass and high-pass filtering with a great degree of precision. 5 / 56

Background: Fourier Series Fourier series: Any periodic signals can be viewed as weighted sum of sinusoidal signals with different frequencies Frequency Domain: view frequency as an independent variable 6 / 56 (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2 nd Edition.

The Fourier Transform Our starting place is the observation that a periodic function may be written as the sum of sines and cosines of varying amplitudes and frequencies. For example, in figure 4.1 we plot a function, and its decomposition in to sine functions. 7 / 56

8 / 56

Fourier Tr. and Frequency Domain DFT = Discrete Fourier Transform Time, spatial Domain Signals DFT Inverse DFT Frequency Domain Signals 9 / 56

The One-Dimensional DFT Since we only have to obtain a finite number of values, we only need a finite number of functions to do it. Consider for example the discrete sequence 1, 1, 1, 1, -1, -1, -1, -1, This can be expressed as the sum of only two sine functions; this is shown in figure 4.3. 10 / 56

11 / 56

Definition of the one dimensional DFT Suppose f = f 0, f 1, f(2),, f(n 1), is a sequence of length N. We define its discrete Fourier transform to be the sequencef = F 0, F 1, F(2),, F(N 1), F(u) = N 1 x=0 exp 2πi xu N f(x) The formula for the inverse DFT is very similar to the forward transform: N 1 f(x) = 1 N u=0 exp 2πi xu N F(u) 12 / 56

Periodicity of 1D DFT From DFT: F(u) = N 1 x=0 exp 2πi xu N f(x) -N 0 N 2N We display only in this range DFT repeats itself every N points (Period = N) but we usually display it for n = 0,, N-1 13 / 56

Conventional Display for 1D DFT f(x) DFT F(u) 0 N-1 0 N-1 Time Domain Signal Low frequency area High frequency area The graph F(u) is not easy to understand! 14 / 56

Conventional Display for DFT : FFT Shift F(u) FFT Shift: Shift center of the graph F(u) to 0 to get better Display which is easier to understand. 0 N-1 F(u) Low frequency area High frequency area -N/2 0 N/2-1 15 / 56

The Two-Dimensional DFT In two dimensions, the DFT takes a matrix as input, and returns another matrix, of the same size, as output. If the original matrix values are f(x, y), where x and y are the indices, then the output matrix values are F(u, v). We call the matrix F the Fourier transform. Given that an image may be considered as a twodimensional function f(x, y), it seems reasonable to assume that f can be expressed as sums of corrugation functions 16 / 56

corrugation 17 / 56

The Two-Dimensional DFT The forward and inverse transforms for an M N matrix, where for notational convenience we assume that the x indices are from 0 to M 1 and the y indices are from 0 to N 1 are: F(u, v) = M 1 x=0 N 1 y=0 exp 2πi xu M + yv N f(x, y) f(x, y) = 1 M 1 MN u=0 N 1 y=0 exp 2πi xu M + yv N F(u, v) 18 / 56

The Two-Dimensional DFT Notice that the Fourier transform filter elements can be expressed as products: exp 2πi xu M + yv N = exp 2πi xu M exp 2πi yv N We can break down our formulas above to simpler formulas that work on single rows or columns. 19 / 56

The Two-Dimensional DFT 20 / 56

Periodicity of 2D DFT 2D DFT: M 1 N 1 F(u, v) = exp 2πi x=0 y=0 xu M + yv N f(x, y) g(x,y) -M 0 For an image of size NxM pixels, its 2-D DFT repeats itself every N points in x- direction and every M points in y-direction. M 2M We display only in this range -N 0 N 2N 21 / 56 (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2 nd Edition.

Conventional Display for 2D DFT F(u,v) has low frequency areas at corners of the image while high frequency areas are at the center of the image which is inconvenient to interpret. Low frequency area High frequency area (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2 nd Edition. 22 / 56

2D FFT Shift : Better Display of 2D DFT 2D FFT Shift is a Octave function: Shift the zero frequency of F(u,v) to the center of an image. FFTSHIFT (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2 nd Edition. Low frequency area High frequency 23 / 56 area

2D FFT Shift (cont.) : How it works -M 0 M Display of 2D DFT After FFT Shift -N 0 N 2N 2M Original display of 2D DFT (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2 nd Edition. 24 / 56

Example of 2-D DFT Notice that the longer the time domain signal, The shorter its Fourier transform 25 / 56 (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2 nd Edition.

Example of 2-D DFT Notice that direction of an object in spatial image and Its Fourier transform are orthogonal to each other. (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2 nd Edition. 26 / 56

Example of 2-D DFT 2D DFT Original image 2D FFT Shift 27 / 56

Example of 2-D DFT 2D DFT Original image 2D FFT Shift 28 / 56

Fourier Transforms in Octave The relevant Octave functions for us are: fft which takes the DFT of a vector, ifft which takes the inverse DFT of a vector, fft2 which takes the DFT of a matrix, ifft2 which takes the inverse DFT of a matrix, fftshift which shifts a transform 29 / 56

Complex Image Display Function 30 / 56

Example 1 Now we ll create a box, and then its Fourier transform: 31 / 56

Example 2 The cameraman image and its DFT 32 / 56

Filtering in Frequency Domain Ideal filtering Low pass filtering High pass filtering Gaussian filtering Low pass filtering High pass filtering 33 / 56

Basic Concept of Filtering in the Frequency Domain From Fourier Transform Property: g( x, y) f ( x, y) h( x, y) F( u, v) H( u, v) G( u, v) We cam perform filtering process by using Multiplication in the frequency domain is easier than convolution in the spatial Domain. (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2 nd Edition. 34 / 56

Filtering in the Frequency Domain with FFT shift F(u,v) H(u,v) (User defined) g(x,y) FFT shift X 2D IFFT 2D FFT FFT shift f(x,y) G(u,v) In this case, F(u,v) and H(u,v) must have the same size and have the zero frequency at the center. 35 / 56

Ideal filtering Low pass filtering ต วกรองความถ ต าผ านแบบอ ดมคต เป นการกรอง ความถ ท จะยอมให ส ญญาณความถ ต าผ านไปได แต จะ ท าการลดขนาดส ญญาณความถ ส งออกไป โดยจะยอมให ความถ ต งแต 0 Hz จนถ ง Cutoff ผ าน ไปย งผลล พธ 36 / 56

Ideal Lowpass Filter H( u, v) 1 0 D( u, v) D( u, v) D D 0 0 Surface Plot 1 0.8 Ideal Lowpass Filter with D 0 = 5 0.6 0.4 0.2 0 Abrupt change in the amplitude 20 0-20 -20 0 20 37 / 56

Ideal Lowpass Filter 127 38 / 56

Example: Ideal Lowpass Filter 39 / 56

Example: Ideal Lowpass Filter 40 / 56

Ideal filtering High pass filtering ต วกรองความถ ส งผ านแบบอ ดมคต เป นการกรอง ความถ ท ยอมให ความถ ส งกว า cutoff ผ านไปย ง ผลล พธ และความถ ต งแต 0 Hz ถ ง cutoff จะไม ให ผ านออกไป จะลดทอนความถ ภายในวงกลม และจะไม ลดทอน ความถ ท งหมดท อย ภายนอกวงกลมน 41 / 56

42 / 56 (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2 nd Edition. Ideal Highpass Filters 0 0 ), ( 1 ), ( 0 ), ( D v u D D v u D v u H where D(u,v) = Distance from (u,v) to the center of the mask. Ideal LPF Filter Transfer function

Example: Ideal Highpass Filters 43 / 56

Example: Ideal Highpass Filters 44 / 56

Example: Ideal Highpass Filters 45 / 56

Example: Ideal Highpass Filters 46 / 56

Gaussian filtering Low pass filtering Gaussian filters may be considered to be the most smooth of all the filters we have discussed so far, with ideal filters the least smooth 47 / 56

Gaussian Lowpass Filter Transfer function H( u, v) Where D 0 = spread factor. e D 2 ( u, v)/2d 2 0 (Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2 nd Edition. Note: the Gaussian filter is the only filter that has no ripple and hence no ringing effect. 48 / 56

Gaussian Lowpass Filter We can create Gaussian filters using the fspecial function, and apply them to our transform. Note the use of the mat2gray function. The fspecial function on its own produces a low pass Gaussian filter with a very small maximum: 49 / 56

Example: Gaussian Lowpass Filter In each case, the final parameter of the fspecial function is the standard deviation; it controls the width of the filter. Clearly, the larger the standard deviation, the wider the function, and so the greater amount of the transform is preserved. 50 / 56

Example: Gaussian Lowpass Filter 51 / 56

Example: Gaussian Lowpass Filter 52 / 56

Gaussian Highpass Filters High pass filtering We can apply a high pass Gaussian filter easily; we create a high pass filter by subtracting a low pass filter from 1. 2 2 D ( u, v)/2d0 H( u, v) 1 e Where D 0 = spread factor. 53 / 56

Example: Gaussian Highpass Filters 54 / 56

Example: Gaussian Highpass Filters 55 / 56

References Dr. Nawapak Eua-Anant, Image Enhancement in the Frequency Domain, https://gear.kku.ac.th/~nawapak/178353/chapter04.ppt Gonzalez & Woods, Digital Image Processing (2002) Alasdair McAndrew, An Introduction to Digital Image Processing with Matlab (2004) 56 / 56