Image Enhancement in the Frequency Domain (2)

Slides:



Advertisements
Similar presentations
3-D Computational Vision CSc Image Processing II - Fourier Transform.
Advertisements

HILBERT TRANSFORM Fourier, Laplace, and z-transforms change from the time-domain representation of a signal to the frequency-domain representation of the.
Frequency Domain Filtering (Chapter 4)
1 Image Processing Ch4: Filtering in frequency domain Prepared by: Tahani Khatib AOU.
Digital Image Processing
Image Enhancement in the Frequency Domain Part III
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.
Image Processing Frequency Filtering Instructor: Juyong Zhang
Digital Image Processing
Digtial Image Processing, Spring ECES 682 Digital Image Processing Oleh Tretiak ECE Department Drexel University.
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.
General Functions A non-periodic function can be represented as a sum of sin’s and cos’s of (possibly) all frequencies: F(  ) is the spectrum of the function.
Digital Image Processing Chapter 4: Image Enhancement in the Frequency Domain.
2D Fourier Theory for Image Analysis Mani Thomas CISC 489/689.
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.
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.
DTFT And Fourier Transform
Presentation Image Filters
CSC589 Introduction to Computer Vision Lecture 8
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.
IIR Filter design (cf. Shenoi, 2006) The transfer function of the IIR filter is given by Its frequency responses are (where w is the normalized frequency.
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.
Frequancy Domain Filtering (FDF) Lab 5. Using FFT (Fast Fourier Transform ) algorithm DFT (Discrete Fourier Transform) & inverse DFT.
Digital Image Processing Chapter 4 Image Enhancement in the Frequency Domain Part I.
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 Chapter 4: Image Enhancement in the Frequency Domain 22 June 2005 Digital Image Processing Chapter 4: Image Enhancement in the.
Convolution in Matlab The convolution in matlab is accomplished by using “conv” command. If “u” is a vector with length ‘n’ and “v” is a vector with length.
Chapter 7 Finite Impulse Response(FIR) Filter Design
1 Conditions for Distortionless Transmission Transmission is said to be distortion less if the input and output have identical wave shapes within a multiplicative.
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
1 CMPB 345: IMAGE PROCESSING DISCRETE TRANSFORM 2.
15. Fourier analysis techniques
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.
Frequency domain analysis and Fourier Transform
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.
Digital Image Processing Lecture 8: Fourier Transform Prof. Charlene Tsai.
Digital Image Processing Chapter - 4
Digital Image Processing , 2008
IMAGE ENHANCEMENT IN THE FREQUENCY DOMAIN
IMAGE PROCESSING FREQUENCY DOMAIN PROCESSING
Spatial & Frequency Domain
Gaussian Lowpass Filter
Image Enhancement in the
General Functions A non-periodic function can be represented as a sum of sin’s and cos’s of (possibly) all frequencies: F() is the spectrum of the function.
Digital Image Processing
Image Enhancement in the Frequency Domain Part I
ENG4BF3 Medical Image Processing
4. Image Enhancement in Frequency Domain
Frequency Domain Processing
Digital Image Processing
Digital Image Processing Week IV
Lecture 4 Image Enhancement in Frequency Domain
Presentation transcript:

Image Enhancement in the Frequency Domain (2)

Frequency Domain Filtering Steps of filtering in the frequency domain Calculate the DFT of the image f Generate a frequency domain filter H H and F should have the same size H should NOT be centered. Centered H is for displaying purpose only. If H is centered, F needs to be centered too and some post-processing is required (textbook pp158-159) Multiply F by H (element by element) Take the real part of the IDFT

Construction of Frequency Domain Filters from Spatial Domain Filters Ex: Given an image f and an 9×9 spatial filter as shown on the right Result of spatial filtering using the MATLAB command imfilter(f,h,’conv’,’circular’,’same’) is shown below We would like to perform the same filtering but in the frequency domain 1

Construction of Frequency Domain Filters from Spatial Domain Filters Step 1: Zero-padding the spatial domain filter h to make the size the same as the size of the image f (300×300). How? Option 1 The filter is located at the center of the expanded filter (h_exp1) Option 2 The filter is located at the top-left corner (h_exp2) Which one is correct? 300 9 9 300 9 9 300 300

Construction of Frequency Domain Filters from Spatial Domain Filters Step 2: Obtain the frequency domain representation of the expanded spatial domain filter by taking the DFT Results using the following MATLAB commands are shown below H=fft2(h_exp);imshow(log(1+abs(H)),[ ]); imshow(log(1+abs(fftshift(H))),[ ]); Imshow(angle(H),[ ]); Notice the spectra are the same for h_exp1 and h_exp2 (from shift property). The difference lies in the phase spectrum h_exp1 h_exp2

Construction of Frequency Domain Filters from Spatial Domain Filters Step 3: Multiply the DFT of the image (not centered) by the DFT of expanded h Notice that, overall speaking, the high frequency parts of F are attenuated Centered F F H F∙H Centered F∙H

Construction of Frequency Domain Filters from Spatial Domain Filters Step 4: Take the real part of the IDFT of the results of step 3 From h_exp1 From h_exp2 From spatial domain filtering Neither one is correct What is going on?

Spatial Filtering vs. Convolution Theory Recall the mathematic expression for (1D) spatial filtering in terms of correlation and convolution For convolution theory The origin of spatial filter is at the center for spatial filtering while the origin of the filter in convolution theory is at the top, left corner

Spatial Filtering vs. Convolution Theory Therefore, to have exactly the same results, the top-left element of the expanded spatial filter used to construct the frequency filter needs to correspond to the center of spatial filter when it is used in spatial domain filtering 5 5 9 5 4 9 300 300 9 9 5 4 4 4 300 300

Homework #5 Write MATLAB codes to construct the equivalent frequency domain filter for a given spatial domain filter Input: Spatial domain filter h (odd sized), desired filter size Output: Non-centered frequency domain filter H and plot the centered spectrum. Verify your codes by performing filtering in both spatial and frequency domains and check the results (take the sum of the absolute difference of the two resulting filtered images)

Direct Construction of Frequency Domain Filters Ideal lowpass filters (ILPF) Cut off all high-frequency components of the Fourier transform that are at a distance greater than a specified distance D0 (cut off frequency) from the origin of the (centered) transform The transfer function (frequency domain filter) is defined by D(u,v) is the distance from point (u,v) to the origin (center) of the frequency domain filter Usually, the image to be filtered is even-sized, in this case, the center of the filter is (M/2,N/2). Then the distance D(u,v) can be obtained by

How to determine the cutoff frequency D0? One way to do this is to compute circles that enclose specified amounts of total image power PT.

As the filter radius increases, less and less power is removed/filtered out, more and more details are preserved. Ringing effect is clear in most cases except for the last one. Ringing effect is the consequence of applying ideal lowpass filters

Ringing Effect Ringing effect can be better explained in spatial domain Convolution of a function with an impulse “copies” the value of that function at the location of the impulse. An impulse function is defined as

The transfer function of the ideal lowpass filter with radius 5 is ripple shaped Convolution of any image (consisting of groups of impulses of different strengths) with the ripple shaped function results in the ringing phenomenon. Lowpass filtering with less ringing will be discussed.

Butterworth Lowpass Filters A butterworth lowpass filter (BLPF) of order n with cutoff frequency at a distance D0 from the origin is given by the following transfer function BLPF does not have a sharp discontinuity For BLPF, the cutoff frequency is defined as the frequency at which the transfer function has value which is half of the maximum

Examples of Application of BLPF Same order but with different cutoff frequencies The larger the cutoff frequency, the more details are reserved

Butterworth Lowpass Filters To check whether a Butterworth lowpass filter suffer the ringing effect as dose the ILPF, we need to examine the pattern of its equivalent spatial filter (How to obtain it?)

Original D0=80, n=1 D0=80, n=2 D0=80, n=3 D0=80, n=5 D0=80, n=10 D0=80, n=20 D0=80, n=50

How to Obtain a Spatial Filter From Its Centered Frequency Domain Filter? fftshift ifftshift Back to back representation Centered representation Circularly shifted by 4 ( (M-1)/2 ) f(x)f(x)∙e-j2u4/9 Done by fftshift 1 2 3 4 5 6 7 8 5 6 7 8 1 2 3 4 Circularly shifted by -4 or 5 f(x)f(x)∙e-j2u5/9 Done by ifftshift After restoring to the back to back form, perform IDFT to obtain the spatial filter (back to back form)

Gaussian Lowpass Filters 1D Gaussian distribution function is given by X0 is the center of the distribution σ is the standard deviation controlling the shape (width) of the curve A is a normalization constant to ensure the area under the curve is one. The Fourier transform of a Gaussian function is also a Gaussian function

Gaussian Lowpass Filters GLPF is given by the following (centered ) transfer function (u0,v0) is the center of the transfer function It is [M/2, N/2] if M,N are even and [(M+1)/2,(N+1)/2] if M,N are odd numbers Dose GLPF suffer from the ringing effect?

Homework #6 Let g(x)=cos(2fx), x=0,0.01,0.02,…0.99 Plot the signal g(x) Plot the spectrum of g(x) for f=1, 5, 10, 20 Plot the centered spectrum Plot the signal g’(x) whose spectrum is the centered spectrum of g(x) Plot the spectrum of g2(x)=1+g(x) How do we get g(x) from g2(x) using frequency domain filtering?