Image Enhancement in the Frequency Domain Spring 2005, Jen-Chang Liu.

Slides:



Advertisements
Similar presentations
Image Enhancement in the Frequency Domain (2)
Advertisements

Local Enhancement Histogram processing methods are global processing, in the sense that pixels are modified by a transformation function based on the gray-level.
Frequency Domain Filtering (Chapter 4)
Digital Image Processing
Image Enhancement in the Frequency Domain Part III
Fourier Transform (Chapter 4)
Chapter Four Image Enhancement in the Frequency Domain.
Image processing (spatial &frequency domain) Image processing (spatial &frequency domain) College of Science Computer Science Department
© by Yu Hen Hu 1 ECE533 Digital Image Processing Image Enhancement in Frequency Domain.
Chap 4 Image Enhancement in the Frequency Domain.
ECE 472/572 - Digital Image Processing Lecture 5 - Image Enhancement - Frequency Domain Filters 09/13/11.
Digital Image Processing
Digtial Image Processing, Spring ECES 682 Digital Image Processing Oleh Tretiak ECE Department Drexel University.
Reminder Fourier Basis: t  [0,1] nZnZ Fourier Series: Fourier Coefficient:
Chapter 4 Image Enhancement in the Frequency Domain.
CHAPTER 4 Image Enhancement in Frequency Domain
Chap 4-2. Frequency domain processing Jen-Chang Liu, 2006.
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.
Some Properties of the 2-D Fourier Transform Translation Distributivity and Scaling Rotation Periodicity and Conjugate Symmetry Separability Convolution.
Image Enhancement in the Frequency Domain Part II Dr. Samir H. Abdul-Jauwad Electrical Engineering Department King Fahd University of Petroleum & Minerals.
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
Digital Image Processing, 2nd ed. © 2002 R. C. Gonzalez & R. E. Woods Chapter 4 Image Enhancement in the Frequency Domain Chapter.
Filters in the Frequency Domain.  Image Smoothing Using Frequency Domain Filters: ◦ Ideal Lowpass Filters ◦ Butterworth Lowpass Filters ◦ Gaussian Lowpass.
Topic 7 - Fourier Transforms DIGITAL IMAGE PROCESSING Course 3624 Department of Physics and Astronomy Professor Bob Warwick.
Presentation Image Filters
Medical Image Analysis Image Enhancement Figures come from the textbook: Medical Image Analysis, by Atam P. Dhawan, IEEE Press, 2003.
Digital Image Processing Chapter # 4 Image Enhancement in Frequency Domain Digital Image Processing Chapter # 4 Image Enhancement in Frequency Domain.
Image Processing © 2002 R. C. Gonzalez & R. E. Woods Lecture 4 Image Enhancement in the Frequency Domain Lecture 4 Image Enhancement.
Image Enhancement in the Frequency Domain Spring 2006, Jen-Chang Liu.
Chapter 7: The Fourier Transform 7.1 Introduction
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.
Digital Image Processing, 2nd ed. © 2002 R. C. Gonzalez & R. E. Woods Background Any function that periodically repeats itself.
Digital Image Processing CSC331 Image Enhancement 1.
ENG4BF3 Medical Image Processing Image Enhancement in Frequency Domain.
Computer Vision – Enhancement(Part III) Hanyang University Jong-Il Park.
Digital Image Processing (Digitaalinen kuvankäsittely) Exercise 2
Digital Image Processing Chapter 4: Image Enhancement in the Frequency Domain 22 June 2005 Digital Image Processing Chapter 4: Image Enhancement in the.
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.
Frequency Domain Processing Lecture: 3. In image processing, linear systems are at the heart of many filtering operations, and they provide the basis.
University of Ioannina - Department of Computer Science Filtering in the Frequency Domain (Application) Digital Image Processing Christophoros Nikou
Practical Image Processing1 Chap7 Image Transformation  Image and Transformed image Spatial  Transformed domain Transformation.
1 CMPB 345: IMAGE PROCESSING DISCRETE TRANSFORM 2.
Fourier Transform.
Image Enhancement (Frequency Domain)
Computer Graphics & Image Processing Chapter # 4 Image Enhancement in Frequency Domain 2/26/20161.
G52IIP, School of Computer Science, University of Nottingham 1 Image Transforms Basic idea Input Image, I(x,y) (spatial domain) Mathematical Transformation.
Digital Image Processing Lecture 9: Filtering in Frequency Domain Prof. Charlene Tsai.
BYST Xform-1 DIP - WS2002: Fourier Transform Digital Image Processing Bundit Thipakorn, Ph.D. Computer Engineering Department Fourier Transform and Image.
Frequency Domain Filtering. Frequency Domain Methods Spatial Domain Frequency Domain.
Fourier transform.
Amity School of Engineering & Technology 1 Amity School of Engineering & Technology DIGITAL IMAGE PROCESSING & PATTERN RECOGNITION Credit Units: 4 Mukesh.
Digital Image Processing Lecture 8: Image Enhancement in Frequency Domain II Naveed Ejaz.
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
Jean Baptiste Joseph Fourier
The content of lecture This lecture will cover: Fourier Transform
Spatial & Frequency Domain
Image Enhancement in the
ENG4BF3 Medical Image Processing
Frequency Domain Analysis
4. Image Enhancement in Frequency Domain
Filtering in the Frequency Domain
Lecture 4 Image Enhancement in Frequency Domain
Presentation transcript:

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.)

Periodic function f Frequency Weight f 1 w 1 f 2 w 2 f 3 w 3 f 4 w 4

How to measure weights? Assume f 1, f 2, f 3, f 4 are known How to measure w 1, w 2, w 3, w 4 ? min Minimize squared error

Minimize MSE calculation min

Orthogonal condition f 1 and f 2 are orthogonal if f 1, f 2, f 3, f 4 are orthogonal to each other 正交

Minimization calculation To satisfy min We have => Recall in linear algebra: projection

Weight = Projection magnitude Represent input f(x) with another basis functions v Vector space (1,0) projection Functional space f f1f1

Summary 1 A function f can be written as sum of f 1, f 2, f 3, … If f1, f2, f3, … are orthogonal to each other Weight (magnitude)

Summary 1: sine, cosine bases Let f 1, f 2, f 3, … carry frequency information Let them be sines and cosines n, k:integers => They all satisfy orthogonal conditions

Summary 1: orthogonal

Fourier series For (Assume periodic outside) DC 頻率 =1 頻率 =2 頻率 =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

Correlation with different phase Weight calculation 相關係數 f1f1 f 相位

Correlation with different phase (cont.) Weight calculation 相關係數 ? f1f1 f

Deal with phase: method 1 For example, expand f(t) over the cos(wt) basis function Consider different phases  0 22  Corr(  Problem: weight(w,  )

Deal with phase: method 2 Complex exponential as basis j 1 real With frequency w: Advantage: Derive magnitude and phase  simultaneously

Deal with phase 2: example Input magnitude phase

Fourier series with phase For (Assume periodic outside) DC 頻率 k=1 k=2 k=3 Complex weight

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 y u v F

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:

0123 … M-1 f(x) x Assume periodic outside 0123M-1 x 頻率 = M-1 x 頻率 =1/M ( 基頻 ) … … 0123 M-1 x 頻率 =2/M … … 0123 M-1 x 頻率 =(M-1)/M …

Frequency Domain 頻率域 Where is the frequency domain? j 1 Euler ’ s formula: frequency u F(u)

Fourier transform

Physical analogy Mathematical frequency splitting Fourier transform Physical device Galss prism 三稜鏡 Split light into frequency components

F(u) Complex quantity? Polar coordinate real imaginary m magnitude phase Power spectrum

Some notes about sampling in time and frequency axis Time index Frequency index Also follow reciprocal property

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

Some notes about 2-D Fourier transform Frequency axis x y u v u v Fshift 0

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 even dim. gray-level scaling … complex real real part

Basic filters Notch filter Make a hole(notch) in the frequency domain Ex. DC

Notch filter: result

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

Periodic function f(t) = f(t+T), T: period 1/T: frequency How to measure?

Auto-correlation function Recall correlation function 相關係數 f1f1 f

Auto-correlation function (cont.) 自相關係數  Corr(  )   T 

Example: audio file phone = wavread('phone.wav'); wavplay(phone);

Example: autocorrelation corr=autocorr(phone);

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

Function scaling and frequency P=2  P=  P=1 sin  t)

P=1 P=8 P=4 P=8/3? P=3

P=2 P=8/5 ? If t is continuous in time, then has period =8/5 However, now t ={0,1,2, …,} is discrete, sampling period 1>4/5 P=8/3? P=3

Half of the DFT frequencies is redundant x=0,1, …,M-1, u=0,1, …,M-1 u<2/M u |F(u)| 01M2M2 … M-1 … M2M2 …

For real signal Forward DFT: That is,Magnitude: |F(M-u)| = |F(u)|, u<2/M Phase: F(M-u) = - F(u)

DFT example for real signal f(x) |F(u)| angle(F(u))

DFT implementation m = 0:1:M-1; F = 1/M*f*exp(-j*2*pi*1/M*m'*m); Matlab code:

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

2-D Translation

2-D Translation (cont.) M N M/2 N/2

Periodicity and conjugate symmetry Periodicity F(u,v)=F(u+M,v)=F(u,v+N)=F(u+M,v+N) Conjugate symmetry

M N M/2 N/2 0

Separability of 2-D DFT

Distribution and Scaling Distribution over addition Scaling linear Reciprocal property

Rotation invariant f(x,y) -> f(r,  )

Inverse Fourier transform using Forward Fourier transform forward inverse F(u) F * (u) Inverse transform (1/M)f * (x) xM f * (x) f(x)

Periodicity and zero padding What is the equivalent spatial-domain convolution to the frequency-domain multiplication? ?

correct conv. erroneous conv. 400

800 Implicit periodicity of DFT zero padding Correct convolution after zero-padding

Ideal low-pass filter with zero-padding Spatial convolution

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

Connection between spatial and frequency filters Convolution theorem

Convolution - 1-D case convolution h(m) m m h(-m) 轉 m h(x-m) x m f(m) 乘 x m f(m)h(x-m) x 積

Convolution – 2-D case 2d convolution Mask operation

mask coefficients underlying neighborhood X (product) output

Convolution theorem f Fourier transform F h Fourier transform H Time domain Frequency domain convolution multiplication

Gaussian filters (low pass) mean=0 variance Frequency domain Time domain Low-pass

Difference of Gaussian (high pass)

Why frequency domain operation? It ’ s more intuitive to design frequency filters Computation complexity Frequency domain: Fourier transform + multiplication Spatial domain: convolution Size of mask

Outline Introduction to the Fourier Transform and Frequency Domain Filtering in the Frequency domain Smoothing Frequency Domain Filters Sharpening Frequency Domain Filters Homomorphic Filtering Implementation

Practical applications 1028x732

Filtering in the frequency domain

Smoothing frequency-domain filters Design issue G(u,v)=F(u,v) H(u,v) Remove high freq. component (details, noise, …) Ideal low-pass filter Butterworth filter Gaussian filter More smooth in the edge of cut-off frequency

Ideal low-pass filter Sharp cut-off frequency where D(u,v) is the distance to the center freq.

Ideal low-pass filter (cont.) Cut-off freq.

Ideal low-pass filter (con.t) ILPF can not be realized in electronic components, but can be implemented in a computer Decision of cut-off freq.? Measure the percentage of image power within the low freq. Total image power

ILPF: example originalFreq

original  =92 D 0 =5  =94.6 D 0 =15  =96.4 D 0 =30  =98 D 0 =80  =99.5 D 0 =230 Ideal low-pass filtering

Ringing effect

Effects of ideal low-pass filtering Blurring and ringing ILPF: Freq. F -1 blurring ringing ILPF: spatial

Effects of ideal low-pass filtering (cont.) spatial impulse ILPF spatial

Butterworth low-pass filters H=0.5 when D(u,v)=D 0

Order of butterworth filters n=1n=2n=5n=20

Butterworth filters Order = 2 original D 0 =5 D 0 =15D 0 =30 D 0 =80D 0 =230

Gaussian low-pass filters Variance or cut-off freq. D(u,v)=D 0 H = 0.607

Gaussian smoothing original D 0 =5 D 0 =15D 0 =30 D 0 =80D 0 =230

Practical applications: 1 444x508 GLPF, D 0 =80

Practical applications: 2 GLPF, D 0 =100 GLPF, D 0 = x732

Practical applications: 3 588x600 GLPF, D 0 =30 GLPF, D 0 =10 Scan line

Outline Introduction to the Fourier Transform and Frequency Domain Smoothing Frequency Domain Filters Sharpening Frequency Domain Filters Homomorphic Filtering Implementation

Sharpening frequency-domain filters Image details corresponds to high- frequency Sharpening: high-pass filters H hp (u,v)=1-H lp (u,v) Ideal high-pass filters Butterworth high-pass filters Gaussian high-pass filters Difference filters

Ideal HPF Butterworth HPF Gaussian HPF

Spatial-domain HPF ideal Butterworth Gaussian negative

Ideal high-pass filters D 0 =15D 0 =30D 0 =80 ringing original

Butterworth high-pass filters n=2,D 0 =15D 0 =30D 0 =80

Gaussian high-pass filters D 0 =15D 0 =30D 0 =80

Laplacian frequency-domain filters Spatial-domain Laplacian Fourier transform

Laplacian frequency-domain filters Input f(x,y) Laplacian F(u,v) F F -(u 2 +v 2 )F(u,v) ? -(u 2 +v 2 ) The Laplacian filter in the frequency domain is H(u,v) = -(u 2 +v 2 )

0 frequency spatial

original Laplacian Scaled Laplacian original+ Laplacian

High-boost filtering and High- frequency emphasis Ideal: tune the ratio of original image and the high-passed image High-boost filter High-frequency emphasis H hb (u,v)= (A-1) + H hp (u,v), A >= 1 Equivalent to (A-1)f(x,y) in the spatial-domain H hfe (u,v)= a + b H hp (u,v), a>=0, b>a

High-boost filtering original Laplacian A=2 A=2.7

High-frequency emphasis original Butterworth a=0.5 b=2.0 Histogram Equalization

Outline Introduction to the Fourier Transform and Frequency Domain Smoothing Frequency Domain Filters Sharpening Frequency Domain Filters Homomorphic Filtering Implementation

Homomorphic filtering Homomorphism: Image formation model f(x,y)=i(x,y) r(x,y) illumination: reflectance: Slow spatial variations vary abruptly, particularly at the junctions of dissimilar objects

Image Formation Model Illumination source scene reflection

Homomorphic filtering Product term Log of product z(x,y)=ln f(x,y)=ln i(x,y)+ ln r(x,y) Separation of signal source:

Homomorphic filtering approach ln i(x,y) ln r(x,y)

How to identify the illumination and reflection Illumination -> low frequency Reflection -> high frequency Radius from the origin sharpening

Homomophic filtering: example originalHomomorphic filtering