Methods for Digital Image Processing

Slides:



Advertisements
Similar presentations
Computer Vision Spring ,-685 Instructor: S. Narasimhan Wean Hall 5409 T-R 10:30am – 11:50am.
Advertisements

Computer Vision Lecture 7: The Fourier Transform
Digital Kommunikationselektronik TNE027 Lecture 5 1 Fourier Transforms Discrete Fourier Transform (DFT) Algorithms Fast Fourier Transform (FFT) Algorithms.
Lecture 7: Basis Functions & Fourier Series
CS Spring 2009 CS 414 – Multimedia Systems Design Lecture 4 – Digital Image Representation Klara Nahrstedt Spring 2009.
Fourier Transform (Chapter 4)
Frequency Domain The frequency domain
Fourier Transform – Chapter 13. Image space Cameras (regardless of wave lengths) create images in the spatial domain Pixels represent features (intensity,
Chapter Four Image Enhancement in the Frequency Domain.
Chap 4 Image Enhancement in the Frequency Domain.
Digital Image Processing
Computer Graphics Recitation 6. 2 Motivation – Image compression What linear combination of 8x8 basis signals produces an 8x8 block in the image?
The Fourier Transform Jean Baptiste Joseph Fourier.
The Fourier Transform Jean Baptiste Joseph Fourier.
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.
Introduction to Computer Vision CS / ECE 181B  Handout #4 : Available this afternoon  Midterm: May 6, 2004  HW #2 due tomorrow  Ack: Prof. Matthew.
The Frequency Domain : Computational Photography Alexei Efros, CMU, Fall 2008 Somewhere in Cinque Terre, May 2005 Many slides borrowed from Steve.
Digital Image Processing Final Project Compression Using DFT, DCT, Hadamard and SVD Transforms Zvi Devir and Assaf Eden.
Orthogonal Transforms
S. Mandayam/ DIP/ECE Dept./Rowan University Digital Image Processing / Fall 2001 Shreekanth Mandayam ECE Department Rowan University.
DREAM PLAN IDEA IMPLEMENTATION Introduction to Image Processing Dr. Kourosh Kiani
The Frequency Domain Sinusoidal tidal waves Copy of Katsushika Hokusai The Great Wave off Kanagawa at
CELLULAR COMMUNICATIONS DSP Intro. Signals: quantization and sampling.
Function approximation: Fourier, Chebyshev, Lagrange
Goals For This Class Quickly review of the main results from last class Convolution and Cross-correlation Discrete Fourier Analysis: Important Considerations.
G52IIP, School of Computer Science, University of Nottingham 1 Image Transforms Fourier Transform Basic idea.
Image Processing Fourier Transform 1D Efficient Data Representation Discrete Fourier Transform - 1D Continuous Fourier Transform - 1D Examples.
CSC589 Introduction to Computer Vision Lecture 7 Thinking in Frequency Bei Xiao.
Automation Mike Marsh National Center for Macromolecular Imaging Baylor College of Medicine Single-Particle Reconstructions and Visualization EMAN Tutorial.
Transforms. 5*sin (2  4t) Amplitude = 5 Frequency = 4 Hz seconds A sine wave.
1 Spatial Frequency or How I learned to love the Fourier Transform Jean Baptiste Joseph Fourier.
: Chapter 14: The Frequency Domain 1 Montri Karnjanadecha ac.th/~montri Image Processing.
1 Chapter 5 Image Transforms. 2 Image Processing for Pattern Recognition Feature Extraction Acquisition Preprocessing Classification Post Processing Scaling.
University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell Image processing.
DIGITAL IMAGE PROCESSING
Digital Image Processing Chapter 4 Image Enhancement in the Frequency Domain Part I.
ENG4BF3 Medical Image Processing Image Enhancement in Frequency Domain.
October 29, 2013Computer Vision Lecture 13: Fourier Transform II 1 The Fourier Transform In the previous lecture, we discussed the Hough transform. There.
DCT.
Spatial Frequencies Spatial Frequencies. Why are Spatial Frequencies important? Efficient data representation Provides a means for modeling and removing.
Basic ideas of Image Transforms are derived from those showed earlier.
COMP322/S2000/L171 Robot Vision System Major Phases in Robot Vision Systems: A. Data (image) acquisition –Illumination, i.e. lighting consideration –Lenses,
Recap of Monday linear Filtering convolution differential filters filter types boundary conditions.
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.
Image as a linear combination of basis images
Dr. Scott Umbaugh, SIUE Discrete Transforms.
Fourier Transform.
CS 376b Introduction to Computer Vision 03 / 17 / 2008 Instructor: Michael Eckmann.
 Introduction to reciprocal space
Chapter 13 Discrete Image Transforms
BYST Xform-1 DIP - WS2002: Fourier Transform Digital Image Processing Bundit Thipakorn, Ph.D. Computer Engineering Department Fourier Transform and Image.
The Frequency Domain Digital Image Processing – Chapter 8.
Fourier transform.
The Fourier Transform.
Fourier Transform (Chapter 4) CS474/674 – Prof. Bebis.
Digital Image Processing Lecture 8: Fourier Transform Prof. Charlene Tsai.
Jean Baptiste Joseph Fourier
Sampling Theorem & Antialiasing
Dr. Nikos Desypris, Oct Lecture 3
Fourier Transform.
ENG4BF3 Medical Image Processing
2D Fourier transform is separable
Image Processing, Leture #14
4. DIGITAL IMAGE TRANSFORMS 4.1. Introduction
Chapter 8 The Discrete Fourier Transform
Chapter 8 The Discrete Fourier Transform
Intensity Transformation
Lecture 4 Image Enhancement in Frequency Domain
The Frequency Domain Any wave shape can be approximated by a sum of periodic (such as sine and cosine) functions. a--amplitude of waveform f-- frequency.
Presentation transcript:

Methods for Digital Image Processing

Basic ideas of Image Transforms

Spatial Frequency or Fourier Transform Jean Baptiste Joseph Fourier

Why are Spatial Frequencies important? Efficient data representation Provides a means for modeling and removing noise Physical processes are often best described in “frequency domain” Provides a powerful means of image analysis

What is spatial frequency? Instead of describing a function (i.e., a shape) by a series of positions It is described by a series of cosines

What is spatial frequency? g(x) = A cos(x) g(x) 2 A x

What is spatial frequency? A cos(x  2/L) g(x) = A cos(x  2/) A cos(x  2f) g(x) Period (L) Wavelength () Frequency f=(1/ ) Amplitude (A) Magnitude (A) x

What is spatial frequency? g(x) = A cos(x  2f) g(x) A x (1/f) period

But what if cosine is shifted in phase? g(x) = A cos(x  2f + ) g(x) x 

What is spatial frequency? Let us take arbitrary g(x) x g(x) 0.00 2 cos(0.25) = 0.707106... 0.25 2 cos(0.50) = 0.0 0.50 2 cos(0.75) = -0.707106... 0.75 2 cos(1.00) = -1.0 1.00 2 cos(1.25) = -0.707106… 1.25 2 cos(1.50) = 0 1.50 2 cos(1.75) = 0.707106... 1.75 2 cos(2.00) = 1.0 2.00 2 cos(2.25) = 0.707106... g(x) = A cos(x  2f + ) A=2 m f = 0.5 m-1 = 0.25 = 45 g(x) = 2 cos(x  2(0.5) + 0.25) 2 cos(x   + 0.25) We calculate discrete values of g(x) for various values of x We substitute values of A, f and 

What is spatial frequency? g(x) = A cos(x  2f + ) g(x) We calculate discrete values of g(x) for various values of x x

Now we take discrete values of Ai , fi and i gi(x) = Ai cos(x  2fi + i), i = 0,1,2,3,... x

Now we substitute fi = i/N gi(x) = Ai cos(x  2fi + i), i = 0,1,2,3,... gi(x) = Ai cos(x  2i/N + i), i = 0,1,2,3,…,N-1 f=i/N N N = time interval

Values for various values of i gi(x) = Ai cos(x  2i/N + i), i = 0,1,2,3,…,N-1 f=i/N We calculate values of function for various values of i N

gi(x) = Ai cos(x  2i/N + i), i = 0,1,2,3,…,N-1 Substituting various values of i to the formula we get various cosinusoides gi(x) = Ai cos(x  2i/N + i), i = 0,1,2,3,…,N-1 A2 A1 A0 i=1 i=2 i=0

gi(x) = Ai cos(x  2i/N + i), i = 0,1,2,3,…,N/2 - 1 Changing N to N/2 gi(x) = Ai cos(x  2i/N + i), i = 0,1,2,3,…,N/2 - 1 If N equals the number of pixel in a line, then... i=0 i=N/2 - 1 Lowest frequency Highest frequency

What is spatial frequency? gi(x) = Ai cos(x  2i/N + i), i = 0,1,2,3,…,N/2-1 If N equals the number of pixels in a line, then... i=0 i=N/2-1 Lowest frequency Highest frequency

What will happen if we take N/2? gi(x) = Ai cos(x  2i/N + i), i = 0,1,2,3,…,N/2-1 If N equals the number of pixel in a line, then... i=0 i=N/2 Lowest frequency Too high Redundant frequency

What is spatial frequency? g(x) = A cos(x  2f + ) gi(x) = Ai cos(x  2i/N + i), i = 0,1,2,3,…,N/2-1

We try to approximate a periodic function with standard trivial (orthogonal, base) functions Low frequency Medium frequency + = + High frequency

We add values from component functions point by point + = +

g(x) i=1 i=2 i=3 i=4 i=5 i=63 x Example of periodic function created by summing standard trivial functions 127

g(x) i=1 i=2 i=3 i=4 i=5 i=10 x 127 Example of periodic function created by summing standard trivial functions

64 terms g(x) 10 terms g(x) Example of periodic function created by summing standard trivial functions

Fourier Decomposition of a step function (64 terms) g(x) i=1 i=2 i=3 i=4 i=5 Example of periodic function created by summing standard trivial functions x i=63 127

Fourier Decomposition of a step function (11 terms) g(x) i=1 i=2 i=3 Example of periodic function created by summing standard trivial functions i=4 i=5 i=10 x 63

Main concept – summation of base functions Any function of x (any shape) that can be represented by g(x) can also be represented by the summation of cosine functions Observe two numbers for every i

Information is not lost when we change the domain Spatial Domain gi(x) = 1.3, 2.1, 1.4, 5.7, …., i=0,1,2…N-1 N pieces of information Frequency Domain N pieces of information N/2 amplitudes (Ai, i=0,1,…,N/2-1) and N/2 phases (i, i=0,1,…,N/2-1) and

What is spatial frequency? Information is not lost when we change the domain What is spatial frequency? gi(x) and Are equivalent They contain the same amount of information The sequence of amplitudes squared is the SPECTRUM

EXAMPLE

Substitute values A cos(x2i/N) frequency (f) = i/N wavelength (p) = N/I N=512 i f p 0 0 infinite 1 1/512 512 16 1/32 32 256 1/2 2 Assuming N we get this table which relates frequency and wavelength of component functions

More examples to give you some intuition….

Fourier Transform Notation g(x) denotes an spatial domain function of real numbers (1.2, 0.0), (2.1, 0.0), (3.1,0.0), … G() denotes the Fourier transform G() is a symmetric complex function (-3.1,0.0), (4.1, -2.1), (-3.1, 2.1), …(1.2,0.0) …, (-3.1,-2.1), (4.1, 2.1), (-3.1,0.0) G[g(x)] = G(f) is the Fourier transform of g(x) G-1() denotes the inverse Fourier transform G-1(G(f)) = g(x)

Power Spectrum and Phase Spectrum complex Complex conjugate |G(f)|2 = G(f)G(f)* is the power spectrum of G(f) (-3.1,0.0), (4.1, -2.1), (-3.1, 2.1), … (1.2,0.0),…, (-3.1,-2.1), (4.1, 2.1) 9.61, 21.22, 14.02, …, 1.44,…, 14.02, 21.22 tan-1[Im(G(f))/Re(G(f))] is the phase spectrum of G(f) 0.0, -27.12, 145.89, …, 0.0, -145.89, 27.12

1-D DFT and IDFT Discrete Domains Discrete Fourier Transform Equal time intervals Discrete Domains Discrete Time: k = 0, 1, 2, 3, …………, N-1 Discrete Frequency: n = 0, 1, 2, 3, …………, N-1 Discrete Fourier Transform Inverse DFT Equal frequency intervals n = 0, 1, 2,….., N-1 k = 0, 1, 2,….., N-1

Fourier 2D Image Transform

Another formula for Two-Dimensional Fourier Image is function of x and y A cos(x2i/N) B cos(y2j/M) fx = u = i/N, fy = v =j/M Lines in the figure correspond to real value 1 Now we need two cosinusoids for each point, one for x and one for y Now we have waves in two directions and they have frequencies and amplitudes

Fourier Transform of a spot Original image Fourier Transform

Transform Results image transform spectrum

Two Dimensional Fast Fourier in Matlab

Filtering in Frequency Domain … will be covered in a separate lecture on spectral approaches…..

H(u,v) for various values of u and v These are standard trivial functions to compose the image from

< < image ..and its spectrum

Image and its spectrum

Image and its spectrum

Image and its spectrum

This is a very important result Convolution Theorem Let g(u,v) be the kernel Let h(u,v) be the image G(k,l) = DFT[g(u,v)] H(k,l) = DFT[h(u,v)] Then This is a very important result where means multiplication and means convolution. This means that an image can be filtered in the Spatial Domain or the Frequency Domain.

Convolution Theorem Let g(u,v) be the kernel Let h(u,v) be the image G(k,l) = DFT[g(u,v)] H(k,l) = DFT[h(u,v)] Then Instead of doing convolution in spatial domain we can do multiplication In frequency domain Multiplication in spectral domain Convolution in spatial domain where means multiplication and means convolution.

v Image u Spectrum Noise and its spectrum Noise filtering

Image Spectrum v u

Image x(u,v) v u Spectrum log(X(k,l)) l k

Image of cow with noise Spectrum log(X(k,l)) k l v u Image x(u,v)

white noise white noise spectrum kernel spectrum (low pass filter) red noise red noise spectrum

Filtering is done in spectral domain. Can be very complicated

Image Transforms Fast Fourier Fast Cosine Radon Transform Slant 2-D Discrete Fourier Transform Fast Cosine 2-D Discrete Cosine Transform Radon Transform Slant Walsh, Hadamard, Paley, Karczmarz Haar Chrestenson Reed-Muller

Discrete Cosine Transform (DCT) Used in JPEG and MPEG Another Frequency Transform, with Different Set of Basis Functions

Discrete Cosine Transform in Matlab

“Statistical” Filters Median Filter also eliminates noise preserves edges better than blurring Sorts values in a region and finds the median region size and shape how define the median for color values?

“Statistical” Filters Continued Minimum Filter (Thinning) Maximum Filter (Growing) “Pixellate” Functions Now we can do this quickly in spectral domain

Thinning Growing

Pixellate Examples

DCT Features Can be used for face recognition, tell my story from Japan. Fringe Pattern DCT Coefficients DCT Zonal Mask 1 2 3 4 5 1 2 3 4 5 (1,1) (1,2) (2,1) (2,2) . Artificial Neural Network Feature Vector

Noise Removal Transforms for Noise Removal Image with Noise Transform Image reconstructed

Image Segmentation Recall: Edge Detection f(x,y) Gradient Mask fe(x,y) -1 -2 1 2 Now we do this in spectral domain!!

Image Moments 2-D continuous function f(x,y), the moment of order (p+q) is: Central moment of order (p+q) is:

Image Moments (contd.) Now we do this in spectral domain!! Normalized central moment of order (p+q) is: A set of seven invariant moments can be derived from gpq Now we do this in spectral domain!!

Image Textures Now we do this in spectral domain!! Grass Sand Brick wall Now we do this in spectral domain!! The USC-SIPI Image Database http://sipi.usc.edu/

Problems There is a lot of Fourier and Cosine Transform software on the web, find one and apply it to remove some kind of noise from robot images from FAB building. Read about Walsh transform and think what kind of advantages it may have over Fourier Read about Haar and Reed-Muller transform and implement them. Experiment

Sources Howard Schultz, Umass Herculano De Biasi Shreekanth Mandayam ECE Department, Rowan University http://engineering.rowan.edu/~shreek/fall01/dip/ http://engineering.rowan.edu/~shreek/fall01/dip/lab4.html

Please visit the website Image Compression Please visit the website http://www.cs.sfu.ca/CourseCentral/365/li/material/notes/Chap4/Chap4.html