Image Transforms and Image Enhancement in Frequency Domain Lecture 5, Feb 25 th, 2008 Lexing Xie thanks to G&W website, Mani Thomas, Min Wu and Wade Trappe.

Slides:



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

Fourier Transform (Chapter 4)
Chap 4 Image Enhancement in the Frequency Domain.
Image Processing Frequency Filtering Instructor: Juyong Zhang
School of Computing Science Simon Fraser University
Digital Image Processing
Digtial Image Processing, Spring ECES 682 Digital Image Processing Oleh Tretiak ECE Department Drexel University.
Computer Graphics Recitation 6. 2 Motivation – Image compression What linear combination of 8x8 basis signals produces an 8x8 block in the image?
Reminder Fourier Basis: t  [0,1] nZnZ Fourier Series: Fourier Coefficient:
Chapter 4 Image Enhancement in the Frequency Domain.
Chap 4-2. Frequency domain processing Jen-Chang Liu, 2006.
Digital Image Processing Chapter 4: Image Enhancement in the Frequency Domain.
Borrowed from UMD ENEE631 Spring’04
Unitary Transforms. Image Transform: A Revisit With A Coding Perspective.
2D Fourier Theory for Image Analysis Mani Thomas CISC 489/689.
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.
Orthogonal Transforms
Digital Image Processing, 2nd ed. © 2002 R. C. Gonzalez & R. E. Woods Chapter 4 Image Enhancement in the Frequency Domain Chapter.
General Image Transforms and Applications Lecture 6, March 3 rd, 2008 Lexing Xie EE4830 Digital Image Processing
Presentation Image Filters
CSC589 Introduction to Computer Vision Lecture 7 Thinking in Frequency Bei Xiao.
Digital Image Processing Chapter # 4 Image Enhancement in Frequency Domain Digital Image Processing Chapter # 4 Image Enhancement in Frequency Domain.
EE D Fourier Transform. Bahadir K. Gunturk EE Image Analysis I 2 Summary of Lecture 2 We talked about the digital image properties, including.
CS654: Digital Image Analysis Lecture 15: Image Transforms with Real Basis Functions.
Image Processing © 2002 R. C. Gonzalez & R. E. Woods Lecture 4 Image Enhancement in the Frequency Domain Lecture 4 Image Enhancement.
1 Chapter 5 Image Transforms. 2 Image Processing for Pattern Recognition Feature Extraction Acquisition Preprocessing Classification Post Processing Scaling.
CS654: Digital Image Analysis Lecture 12: Separable Transforms.
1 Lecture III Shobhit Niranjan Gaurav Gupta. 2 Convolution Definition: For discrete functions: Properties Commutativity Associativity Distributivity.
Chapter 7: The Fourier Transform 7.1 Introduction
Part I: Image Transforms DIGITAL IMAGE PROCESSING.
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.
DCT.
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.
Dr. Scott Umbaugh, SIUE Discrete Transforms.
Practical Image Processing1 Chap7 Image Transformation  Image and Transformed image Spatial  Transformed domain Transformation.
CS654: Digital Image Analysis
Image processing Honza Černocký, ÚPGM. 1D signal 2.
CS654: Digital Image Analysis Lecture 13: Discrete Fourier Transformation.
1 CMPB 345: IMAGE PROCESSING DISCRETE TRANSFORM 2.
Fourier Transform.
Fourier and Wavelet Transformations Michael J. Watts
Image Enhancement (Frequency Domain)
CS 376b Introduction to Computer Vision 03 / 17 / 2008 Instructor: Michael Eckmann.
Image hole-filling. Agenda Project 2: Will be up tomorrow Due in 2 weeks Fourier – finish up Hole-filling (texture synthesis) Image blending.
CS654: Digital Image Analysis Lecture 11: Image Transforms.
Digital Image Processing Lecture 9: Filtering in Frequency Domain Prof. Charlene Tsai.
Chapter 13 Discrete Image Transforms
Fourier transform.
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 , 2008
Jean Baptiste Joseph Fourier
Digital Image Processing
An Example of 1D Transform with Two Variables
Image Enhancement in the
Fourier and Wavelet Transformations
Fourier Transform.
All about convolution.
ENG4BF3 Medical Image Processing
Outline Linear Shift-invariant system Linear filters
Outline Linear Shift-invariant system Linear filters
Chapter 8 The Discrete Fourier Transform
Lecture 17 DFT: Discrete Fourier Transform
Chapter 8 The Discrete Fourier Transform
Chapter 8 The Discrete Fourier Transform
Lecture 4 Image Enhancement in Frequency Domain
Presentation transcript:

Image Transforms and Image Enhancement in Frequency Domain Lecture 5, Feb 25 th, 2008 Lexing Xie thanks to G&W website, Mani Thomas, Min Wu and Wade Trappe for slide materials EE4830 Digital Image Processing

HW clarification HW#2 problem 1 Show: f - r 2 f ¼ A f – B blur(f) A and B are constants that do not matter, it is up to you to find appropriate values of A and B, as well as the appropriate version of the blur function. Recap for lecture 4

roadmap 2D-DFT definitions and intuitions DFT properties, applications pros and cons DCT

the return of DFT Fourier transform: a continuous signal can be represented as a (countable) weighted sum of sinusoids.

warm-up brainstorm Why do we need image transform?

why transform? Better image processing Take into account long-range correlations in space Conceptual insights in spatial-frequency information. what it means to be “smooth, moderate change, fast change, …” Fast computation: convolution vs. multiplication Alternative representation and sensing Obtain transformed data as measurement in radiology images (medical and astrophysics), inverse transform to recover image Efficient storage and transmission Energy compaction Pick a few “representatives” (basis) Just store/send the “contribution” from each basis ?

outline why transform 2D Fourier transform a picture book for DFT and 2D-DFT properties implementation applications discrete cosine transform (DCT) definition & visualization Implementation next lecture: transform of all flavors, unitary transform, KLT, others …

1-D continuous FT real(g(  x))imag(g(  x)) 1D – FT 1D – DFT of length N x  =0  =7 x

1-D DFT in as basis expansion Forward transform Inverse transform basis n u=0 u=7 real(A)imag(A) n

1-D DFT in matrix notations N=8 n u=0 u=7 real(A)imag(A) n

1-D DFT of different lengths N=32 n u real(A) imag(A) N=8 N=16 N=64

performing 1D DFT real-valued input Note: the coefficients in x and y on this slide are only meant for illustration purposes, which are not numerically accurate.

another illustration of 1D-DFT real-valued input Note: the coefficients in x and y are not numerically accurate

from 1D to 2D 1D2D ?

Computing 2D-DFT DFT IDFT Discrete, 2-D Fourier & inverse Fourier transforms are implemented in fft2 and ifft2, respectively fftshift : Move origin (DC component) to image center for display Example: >> I = imread(‘test.png’); % Load grayscale image >> F = fftshift(fft2(I)); % Shifted transform >> imshow(log(abs(F)),[]); % Show log magnitude >> imshow(angle(F),[]); % Show phase angle

2-D Fourier basis imagreal real( )imag( )

2-D FT illustrated imag real real-valued

notes about 2D-DFT Output of the Fourier transform is a complex number Decompose the complex number as the magnitude and phase components In Matlab: u = real(z), v = imag(z), r = abs(z), and theta = angle(z)

Explaining 2D-DFT fft2 ifft2

circular convolution and zero padding

zero padded filter and response

observation 1: compacting energy

observation 2: amplitude vs. phase Amplitude: relative prominence of sinusoids Phase: relative displacement of sinusoids

another example: amplitude vs. phase Adpated from A = “Aron” P = “Phyllis” log(abs(FA))log(abs(FP)) angle(FA) angle(FP) ifft2(abs(FA), angle(FP)) FA = fft2(A)FP = fft2(P) ifft2(abs(FP), angle(FA))

fast implementation of 2-D DFT 2 Dimensional DFT is separable 1D FFT: O(N ¢ log 2 N) 2D DFT naïve implementation: O(N 4 ) 2D DFT as 1D FFT for each row and then for each column 1-D DFT of f(m,n) w.r.t n 1-D DFT of F(m,v) w.r.t m

Implement IDFT as DFT DFT2 IDFT2

Properties of 2D-DFT

duality result

outline why transform 2D Fourier transform a picture book for DFT and 2D-DFT properties implementation applications discrete cosine transform (DCT) definition & visualization implementation

DFT application #1: fast Convolution ?? O(N 2 ) Spatial filtering ? f(x.y)*h(x.y)

DFT application #1: fast convolution O(N 2 ¢ log 2 N) O(N 2 ) Spatial filtering O(N 4 ) f(x.y)*h(x.y)

DFT application #2: feature correlation Find letter “a” in the following image bw = imread('text.png');a = imread(‘letter_a.png'); % Convolution is equivalent to correlation if you rotate the convolution kernel by 180deg C = real(ifft2(fft2(bw).*fft2(rot90(a,2),256,256))); % Use a threshold that's a little less than max. % Display showing pixels over threshold. thresh =.9*max(C(:)); figure, imshow(C > thresh) from Matlab image processing demos.

DFT application #3: image filters Zoology of image filters Smoothing / Sharpening / Others Support in time vs. support in frequency c.f. “FIR / IIR” Definition: spatial domain/frequency domain Separable / Non-separable

smoothing filters: ideal low-pass

butterworth filters

Gaussian filters

low-pass filter examples

smoothing filter application 1 text enhancement

smoothing filter application 2 beautify a photo

high-pass filters

sobel operator in frequency domain Question: Sobel vs. other high-pass filters? Spatial vs frequency domain implementation?

high-pass filter examples

band-pass, band-reject filters

outline why transform 2D Fourier transform a picture book for DFT and 2D-DFT properties implementation applications in enhancement, correlation discrete cosine transform (DCT) definition & visualization implementation

Is DFT a Good (enough) Transform? Theory Implementation Application

The Desirables for Image Transforms Theory Inverse transform available Energy conservation (Parsevell) Good for compacting energy Orthonormal, complete basis (sort of) shift- and rotation invariant Implementation Real-valued Separable Fast to compute w. butterfly-like structure Same implementation for forward and inverse transform Application Useful for image enhancement Capture perceptually meaningful structures in images DFT??? XX?XXXX?XX xXXXxXXX X

DFT vs. DCT 1D-DFT real(a)imag(a) n=7 u=0 u=7 u=0 u=7 1D-DCT a

1-D Discrete Cosine Transform (DCT) Transform matrix A a(k,n) =  (0) for k=0 a(k,n) =  (k) cos[  (2n+1)/2N] for k>0 A is real and orthogonal rows of A form orthonormal basis A is not symmetric! DCT is not the real part of unitary DFT!

1-D DCT k Z (k) Transform coeff Basis vectors u=0 u=0 to 1 u=0 to 4 u=0 to 5 u=0 to 2 u=0 to 3 u=0 to 6 u=0 to 7 Reconstructions n z (n) Original signal

DFT and DCT in Matrix Notations Matrix notation for 1D transform 1D-DFT real(A)imag(A) 1D-DCT AN=32

From 1D-DCT to 2D-DCT n=7 u=0 u=7 Rows of A form a set of orthonormal basis A is not symmetric! DCT is not the real part of unitary DFT!

basis images: DFT (real) vs DCT

Periodicity Implied by DFT and DCT

DFT and DCT on Lena DFT2DCT2 Shift low-freq to the center Assume periodic and zero-padded …Assume reflection …

Using FFT to implement fast DCT Reorder odd and even elements Split the DCT sum into odd and even terms

The Desirables for Image Transforms Theory Inverse transform available Energy conservation (Parsevell) Good for compacting energy Orthonormal, complete basis (sort of) shift- and rotation invariant Implementation Real-valued Separable Fast to compute w. butterfly-like structure Same implementation for forward and inverse transform Application Useful for image enhancement Capture perceptually meaningful structures in images DFT??? XX?XXXX?XX xXXXxXXX X DCT XX?XXXX?XX XXXXXXXX

Summary of Lecture 5 Why we need image transform DFT revisited Definitions, properties, observations, implementations, applications What do we need for a transform DCT Coming in Lecture 6: Unitary transforms, KL transform, DCT examples and optimality for DCT and KLT, other transform flavors, Wavelets, Applications Readings: G&W chapter 4, chapter 5 of Jain has been posted on Courseworks “Transforms” that do not belong to lectures 5-6: Rodon transform, Hough transform, …