1.22k likes | 1.43k Views
Learn about Fourier Transform, Frequency Domain filtering, Homomorphic Filtering, and Implementation in image enhancement. Explore methods for Magnitude and Phase of frequencies. Develop insights into Weight Calculation and Deal with Phase in the frequency domain. Understand Filtering techniques including Smoothing and Sharpening filters. Enhance your knowledge with practical examples and improve image quality using Frequency Domain operations.
E N D
Image Enhancement in the Frequency Domain Spring 2005, Jen-Chang Liu
Outline • Introduction to the Fourier Transform and Frequency Domain • Magnitude of frequencies • Phase of frequencies • Fourier transform and DFT • Filtering in the frequency domain • Smoothing Frequency Domain Filters • Sharpening Frequency Domain Filters • Homomorphic Filtering • Implementation of Fourier transform
Background • 1807, French math. Fourier • Any function that periodically repeats itself can be expressed as the sum of of sines and/or cosines of different frequencies, each multiplied by a different coefficient (Fourier series)
Periodic function f(t) = f(t+T), T: period (sec.) 1/T: frequency (cycles/sec.)
Frequency Weight f1 w1 f2 w2 f3 w3 f4 w4 Periodic function f
min Minimize squared error How to measure weights? • Assume f1 , f2 ,f3 ,f4 are known • How to measure w1 , w2 ,w3 ,w4 ?
Orthogonal condition 正交 • f1 and f2 are orthogonal if • f1 , f2 ,f3 ,f4 are orthogonal to each other
Recall in linear algebra: projection Minimization calculation • To satisfy min We have =>
Weight = Projection magnitude • Represent input f(x) with another basis functions Functional space Vector space f v projection f1 (1,0)
Summary 1 • A function f can be written as sum of f1 , f2 ,f3 , … If f1 , f2 , f3 , … are orthogonal to each other Weight (magnitude)
Summary 1: sine, cosine bases • Let f1 , f2 ,f3 , … carry frequency information • Let them be sines and cosines n, k:integers => They all satisfy orthogonal conditions
DC 頻率=3 頻率=1 頻率=2 Fourier series (Assume periodic outside) • For
Outline • Introduction to the Fourier Transform and Frequency Domain • Magnitude of frequencies • Phase of frequencies • Fourier transform and DFT • Filtering in the frequency domain • Smoothing Frequency Domain Filters • Sharpening Frequency Domain Filters • Homomorphic Filtering • Implementation of Fourier transform
相位 Correlation with different phase • Weight calculation f 相關係數 f1
Correlation with different phase (cont.) • Weight calculation 相關係數? f f1
Corr(q) q 2p 0 q0 Deal with phase: method 1 • For example, expand f(t) over the cos(wt) basis function • Consider different phases Problem: weight(w, q)
With frequency w: Deal with phase: method 2 • Complex exponential as basis j 1 real Advantage: Derive magnitude and phase q simultaneously
Deal with phase 2: example • Input phase magnitude
DC Fourier series with phase (Assume periodic outside) • For Complex weight 頻率k=1 k=2 k=3
Outline • Introduction to the Fourier Transform and Frequency Domain • Magnitude of frequencies • Phase of frequencies • Fourier transform and DFT • Filtering in the frequency domain • Smoothing Frequency Domain Filters • Sharpening Frequency Domain Filters • Homomorphic Filtering • Implementation of Fourier transform
Fourier transform • Functions that are not periodic can be expressed as the integral of sines and/or cosines multiplied by a weighting functions • Frequency up to infinity • Perfect reconstruction Functions -- Fourier transform Operation in frequency domain without loss of information
1-D Fourier Transform • Fourier transform F(u) of a continuous function f(x) is: Inverse transform: Forward Fourier transform:
2-D Fourier Transform • Fourier transform F(u,v) of a continuous function f(x,y) is: Inverse transform: x u F y v
Future development • 1950, fast Fourier transform (FFT) • Revolution in the signal processing • Discrete Fourier transform (DFT) • For digital computation
1-D Discrete Fourier Transform • f(x),x=0,1,…,M-1 . discrete function • F(u),u=0,1,…,M-1. DFT of f(x) Inverse transform: Forward discrete Fourier transform:
Frequency Domain 頻率域 • Where is the frequency domain? j Euler’s formula: 1 F(u) frequency u
Fourier transform
F(u) Complex quantity? imaginary • Polar coordinate m real magnitude phase Power spectrum
Extend to 2-D DFT from 1-D • 2-D: x-axis then y-axis
Complex Quantities to Real Quantities • Useful representation magnitude phase Power spectrum
DFT: example log(F)
Properties in the frequency domain • Fourier transform works globally • No direct relationship between a specific components in an image and frequencies • Intuition about frequency • Frequency content • Rate of change of gray levels in an image
+45,-45 degree artifacts
Outline • Introduction to the Fourier Transform and Frequency Domain • Magnitude of frequencies • Phase of frequencies • Fourier transform and DFT • Filtering in the frequency domain • Smoothing Frequency Domain Filters • Sharpening Frequency Domain Filters • Homomorphic Filtering • Implementation of Fourier transform
Filtering in the frequency domain • Filter (mask) in the spatial domain • Apply a filter transfer function in the frequency domain • Output(u,v)=Input(u,v) H(u,v) • Suppress certain frequencies while leaving others unchanged 乘法
Filtering in the frequency domain complex real real part even dim. gray-level scaling …
Basic filters • Notch filter • Make a hole(notch) in the frequency domain • Ex. DC
Basic filters (cont.) • Low-pass filter • Attenuates high frequencies while passing low frequencies • smoothing • High-pass filter • Attenuates low frequencies while passing high frequencies • sharpening
Low-pass High-pass
Outline • Review concept of frequencies • How to measure the period(or frequency)? • Adjust frequency by scaling • Properties of DFT • Convolution theorem – relation between spatial domain filtering(masking) and frequency domain operation
How to measure? Periodic function f(t) = f(t+T), T: period 1/T: frequency
Auto-correlation function • Recall correlation function f 相關係數 f1
q0 T Auto-correlation function (cont.) 自相關係數 Corr(q) q0 T q
Example: audio file • phone = wavread('phone.wav'); wavplay(phone);
Example: autocorrelation • corr=autocorr(phone);