#1 Lecture 5: Frequency Domain Transformations Saad J Bedros sbedros@umn.edu
From Last Lecture Spatial Domain Transformation Point Processing for Enhancement Area/Mask Processing Transformations Image Filter for Blurring, Enhancement Geometric Transformations Image Warping or Operations on the image axes Frame Processing Transformations Operations on multiple images #2
Frequency Domain Transformations TODAY s LECTURE #3 New Form of Image Representation Different Representation of an image Fourier Transform Frequency Domain Filtering
Efficient Data Representation #4
Different Form of Image Representation #5 Goal is represent the image using transformation for better analysis and interpretation
Change of Basis #6
Image Transform: Change of Basis #7
Standard Basis Functions 1D #8
Hadamard Basis Functions 1D #9
Finding the Transform Coefficients #10
Reconstructing the Image #11
Transforms: Change of Basis 2D #12
Finding the Transform Coefficients #13
Change of Basis #14
Hadamard Basis Functions #15
Complex Numbers A complex number x is of the form: α: real part, b: imaginary part Addition: Multiplication:
Complex Numbers Magnitude-Phase (i.e.,vector) representation Magnitude: φ Phase: Magnitude-Phase notation:
Complex Numbers Multiplication using magnitude-phase representation Complex conjugate Properties
Euler s formula Complex Numbers Properties j
Sine and Cosine Functions Periodic functions General form of sine and cosine functions:
Sine and Cosine Functions Special case: A=1, b=0, α=1 π/2 π 3π/2 π/2 π 3π/2
Sine and Cosine Functions Shifting or translating the sine function by a const b Note: cosine is a shifted sine function: cos( t) sin( t ) 2
Sine and Cosine Functions Changing the amplitude A
Sine and Cosine Functions Changing the period T=2π/ α consider A=1, b=0: y=cos(αt) α =4 period 2π/4=π/2 shorter period higher frequency (i.e., oscillates faster) Frequency is defined as f=1/t Alternative notation: cos(αt)=cos(2πt/t)=cos(2πft)
Amplitude and Phase #25
Basis Functions Given a vector space of functions, S, then if any f(t) ϵ S can be expressed as f () t ak k() t the set of functions φ k (t) are called the expansion set of S. k If the expansion is unique, the set φ k (t) is a basis.
Image Transforms Many 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.
Transformation Kernels Forward Transformation Inverse Transformation 1 0 1 0 1 0,1,..., 1, 0,1,..., ),,, ( ), ( ), ( M x N y N v M u v u y x r y x f v u T 1 0 1 0 1 0,1,..., 1, 0,1,..., ),,, ( ), ( ), ( M u N v N y M x v u y x s v u T y x f inverse transformation kernel forward transformation kernel
Kernel Properties A kernel is said to be separable if: A kernel is said to be symmetric if: ), ( ), ( ),,, ( 2 1 v y r u x r v u y x r ), ( ), ( ),,, ( 1 1 v y r u x r v u y x r
Notation Continuous Fourier Transform (FT) Discrete Fourier Transform (DFT) Fast Fourier Transform (FFT) Faster Method to Compute DFT for 2 N points, where N is an integer
Fourier Series Theorem Any periodic function f(t) can be expressed as a weighted sum (infinite) of sine and cosine functions of varying frequency: is called the fundamental frequency
Every Function equals a sum of sines/cosines #32
Fourier Series Example α 1 α 2 α 3
Continuous Fourier Transform (FT) Transforms a signal (i.e., function) from the spatial (x) domain to the frequency (u) domain. where
Definitions F(u) is a complex function: Magnitude of FT (spectrum): Phase of FT: Magnitude-Phase representation: Power of f(x): P(u)= F(u) 2 =
Example: rectangular pulse magnitude rect(x) function sinc(x)=sin(x)/x
Example: impulse or delta function Definition of delta function: Properties:
Example: impulse or delta function (cont d) FT of delta function: 1 x u
The Frequency Domain #39
Interpretation #40
Interpretation #41
Example: spatial/frequency shifts ) ( ) ( (2) ) ( ) ( (1) ), ( ) ( 0 2 2 0 0 0 u u F e x f u F e x x f then u F x f x u j ux j Special Cases: 0 2 0 ) ( ux j e x x ) ( 0 2 0 u u e x u j
Example: sine and cosine functions FT of the cosine function cos(2πu 0 x) F(u) 1/2
Example: sine and cosine functions (cont d) FT of the sine function sin(2πu 0 x) -jf(u)
Examples #45
The constant Function #46
A Basis Function #47
The Cosine Wave #48
The Sine Wave #49
The Gaussian #50
Why Representation in Frequency Domain #51
Forward DFT Discrete Fourier Transform (DFT) Inverse DFT 1/NΔx
Discrete Fourier Transform (DFT)
Example
Discrete Fourier Transform (DFT) DFT Computation The spectrum of the sampled signal is Periodic in the frequency domain
Extending FT in 2D Forward FT Inverse FT
Example: 2D rectangle function FT of 2D rectangle function 2D sinc()
Extending DFT to 2D Assume that f(x,y) is M x N. Forward DFT Inverse DFT:
Extending DFT to 2D (cont d) Special case: f(x,y) is N x N. Forward DFT Inverse DFT u,v = 0,1,2,, N-1 x,y = 0,1,2,, N-1
Extending DFT to 2D (cont d) 2D cos/sin functions
Visualizing DFT Typically, we visualize F(u,v) The dynamic range of F(u,v) is typically very large Apply streching: (c is const) F(u,v) D(u,v) original image before stretching after stretching
Why is DFT Useful? Easier to remove undesirable frequencies. Fasterperformance for certain operations in the frequency domain than in the spatial domain.
Example: Removing undesirable frequencies noisy signal frequencies To remove certain frequencies, set their corresponding F(u) coefficients to zero! remove high frequencies reconstructed signal
How 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 Image Low-passed
Example of noise reduction using FT Input image Spectrum Band-pass filter Output image
Magnitude and Phase of DFT Question: What is more important? We can use the inverse DFT to reconstruct the input image using magnitude or phase only information magnitude phase
Magnitude and Phase of DFT Reconstructed image using magnitude only (i.e., magnitude determines the strength of each component!) Reconstructed image using phase only (i.e., phase determines the phase of each component!)
Magnitude and Phase of DFT (cont d)
The Convolution Theorem #69
The Convolution Theorem #70
Convolution Theorem - Example #71
How can we do Frequency Filtering 1. Take the FT of f(x): 2. Remove undesired frequencies: 3. Convert back to a signal: Typically the converted signal is Real without an Imaginary Content
Convolution Example 2D #73
The Fourier Transform of the Dirac Function #74
Frequency Enhancement #75
Frequency Bands #76
Blurring Ideal Low Pass Filter #77
Low Pass Filter #78
H(u,v) Ideal Low Pass Filter #79
The Ringing Problem #80
H(u,v) Butterworth Filter #81
H(u,v) Gaussian Filter #82
Low Pass Filters - Comparison #83
Image Sharpening High Pass Filter #84
H(u,v) Butterworth Filter #85
H(u,v) Gaussian Filter #86
High Pass Filtering #87
High Pass Filters - Comparison #88
High Frequency Emphasis #89
High Frequency Emphasis - Example #90
High Pass Filtering - Examples #91
Band Pass Filtering #92
Band Rejection Filtering #93
Local Frequency Filtering #94
Additive Noise Filtering #95
Local Reject Filter - Example #96
Local Reject Filter - Example #97
DFT Properties: Periodicity The DFT and its inverse are periodic with period N
Symmetry Properties
DFT Properties: Separability The 2D DFT can be computed using 1D transforms only: Forward DFT: kernel is separable: 2 ( ux j vy ) j2 ( ux ) j2 ( vy ) N N N e e e
DFT Properties: Separability Rewrite F(u,v) as follows: Let s set: Then:
DFT Properties: Separability How can we compute F(x,v)? ) N x DFT of rows of f(x,y) How can we compute F(u,v)? DFT of cols of F(x,v)
DFT Properties: Separability
DFT Properties: Translation f(x,y) F(u,v) Translation in spatial domain: Translation in frequency domain: N )
DFT Properties: 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) F(u-N/2)
DFT Properties: Translation N ) To move F(u,v) at (N/2, N/2), take N )
Example-Translation #107
DFT Properties: Translation no translation after translation
DFT Properties: Rotation Rotating f(x,y) by θ rotates F(u,v) by θ
DFT Properties: Addition/Multiplication but we saw this before
DFT Properties: Scale
DFT Properties: Average value Average: F(u,v) at u=0, v=0: So:
Review Image Representation Introduced the concept of different image representation Fourier Transform Opportunity of manipulate, process and analyze the image in a different domain Frequency Domain Filtering Can be more efficient in certain cases #113