digital image processing ece.09.452/ece.09.552 fall 2009

17
S. Mandayam/ DIP/ECE Dept./Rowan Universit Digital Image Digital Image Processing Processing ECE.09.452/ECE.09.552 ECE.09.452/ECE.09.552 Fall 2009 Fall 2009 Shreekanth Mandayam ECE Department Rowan University http://engineering.rowan.edu/~shreek/fall09/d ip/ Lecture 4 Lecture 4 October 5, 2009 October 5, 2009

Upload: diamond

Post on 05-Jan-2016

42 views

Category:

Documents


0 download

DESCRIPTION

Digital Image Processing ECE.09.452/ECE.09.552 Fall 2009. Lecture 4 October 5, 2009. Shreekanth Mandayam ECE Department Rowan University http://engineering.rowan.edu/~shreek/fall09/dip/. Plan. Image Spectrum 2-D Fourier Transform (DFT & FFT) Spectral Filtering - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Digital Image Processing ECE.09.452/ECE.09.552 Fall 2009

S. Mandayam/ DIP/ECE Dept./Rowan University

Digital Image ProcessingDigital Image Processing

ECE.09.452/ECE.09.552ECE.09.452/ECE.09.552 Fall 2009Fall 2009

Shreekanth MandayamECE Department

Rowan University

http://engineering.rowan.edu/~shreek/fall09/dip/

Lecture 4Lecture 4October 5, 2009October 5, 2009

Page 2: Digital Image Processing ECE.09.452/ECE.09.552 Fall 2009

S. Mandayam/ DIP/ECE Dept./Rowan University

PlanPlan

• Image Spectrum• 2-D Fourier Transform (DFT & FFT)• Spectral Filtering

• Lab 2: Spatial and Spectral Filtering

Page 3: Digital Image Processing ECE.09.452/ECE.09.552 Fall 2009

S. Mandayam/ DIP/ECE Dept./Rowan University

DIP: DetailsDIP: Details

G ray-level Histogram

Spatial

DF T DC T

Spectral

Digital Image Characteristics

Point Processing M asking Filtering

Enhancem ent

Degradation M odels Inverse Filtering W iener Filtering

Restoration

Pre-Processing

Inform ation Theory

LZW (gif)

Lossless

Transform -based (jpeg)

Lossy

Com pression

Edge Detection

Segm entation

Shape Descriptors Texture M orphology

Description

Digital Im age Processing

Page 4: Digital Image Processing ECE.09.452/ECE.09.552 Fall 2009

S. Mandayam/ DIP/ECE Dept./Rowan University

Noise ModelsNoise Models

• SNRg = 10log10(Pf/Pn)

• Power Variance (how?)

• SNRg = 10log10(f2/ n

2)

f(x,y) g(x,y)

n(x,y)

Degradation Model: g = f + n

Page 5: Digital Image Processing ECE.09.452/ECE.09.552 Fall 2009

S. Mandayam/ DIP/ECE Dept./Rowan University

Noise ModelsNoise Models

• N(0,1): zero-mean, unit-variance, Gaussian RV

• Theorem:• N(0,2) = N(0,1)• Use this for generating normally distributed r.v.’s

of any variance

>>imnoise>>nrfiltdemo>>filter2demos/demo2spatial_filtering/lowpassdemo.m

Page 6: Digital Image Processing ECE.09.452/ECE.09.552 Fall 2009

S. Mandayam/ DIP/ECE Dept./Rowan University

Image PreprocessingImage Preprocessing

Enhancement Restoration

SpatialDomain

SpectralDomain

Point Processing• >>imadjust• >>histeq

Spatial filtering• >>filter2

Filtering• >>fft2/ifft2• >>fftshift

• Inverse filtering• Wiener filtering

Page 7: Digital Image Processing ECE.09.452/ECE.09.552 Fall 2009

S. Mandayam/ DIP/ECE Dept./Rowan University

Recall: 1-D CFTRecall: 1-D CFT

)f(j

ft2j

e )f(W)f(W

)f(Y j)f(X)f(W

dte )t(w)t(w)f(W

F

Continuous Fourier Transform (CFT)

Frequency, [Hz]

AmplitudeSpectrum

PhaseSpectrum

dfe )f(W)f(W)t(w ft2j1-

F

Inverse Fourier Transform (IFT)

Page 8: Digital Image Processing ECE.09.452/ECE.09.552 Fall 2009

S. Mandayam/ DIP/ECE Dept./Rowan University

Recall: 1-D DFTRecall: 1-D DFT• 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 time intervals

Equal frequency intervals

1N

0k

nkN2

j;e ]k[x]n[X

1N

0n

nkN2

j;e ]n[X

N1

]k[x

n = 0, 1, 2,….., N-1

k = 0, 1, 2,….., N-1

Page 9: Digital Image Processing ECE.09.452/ECE.09.552 Fall 2009

S. Mandayam/ DIP/ECE Dept./Rowan University

How to get the frequency axis in the DFTHow to get the frequency axis in the DFT

• The DFT operation just converts one set of number, x[k] into another set of numbers X[n] - there is no explicit definition of time or frequency

• How can we relate the DFT to the CFT and obtain spectral amplitudes for discrete frequencies?

1N

0

x

.

x

]k[x

1N

0

X

.

X

]n[X

(N-point FFT)

n=0 1 2 3 4 n=N

f=0 f = fs

N

fs

Need to know fs

Page 10: Digital Image Processing ECE.09.452/ECE.09.552 Fall 2009

S. Mandayam/ DIP/ECE Dept./Rowan University

DFT PropertiesDFT Properties• DFT is periodic

X[n] = X[n+N] = X[n+2N] = ………

• I-DFT is also periodic!

x[k] = x[k+N] = x[k+2N] = ……….

• Where are the “low” and “high” frequencies on the DFT spectrum?

n=0 N/2 n=N

f=0 fs/2 f = fs

Page 11: Digital Image Processing ECE.09.452/ECE.09.552 Fall 2009

S. Mandayam/ DIP/ECE Dept./Rowan University

1-D FFT Demo1-D FFT Demo

>>fft

http://engineering.rowan.edu/~shreek/spring09/ecomms/demos/dft.m

Page 12: Digital Image Processing ECE.09.452/ECE.09.552 Fall 2009

S. Mandayam/ DIP/ECE Dept./Rowan University

2-D Continuous Fourier Transform2-D Continuous Fourier Transform

dxdyeyxfx y

vyuxj

)(2),(v)u,(F

SpatialDomain

SpatialFrequencyDomain

v

u

y

x

Page 13: Digital Image Processing ECE.09.452/ECE.09.552 Fall 2009

S. Mandayam/ DIP/ECE Dept./Rowan University

2-D Discrete Fourier Transform2-D Discrete Fourier Transform

1

0

1

0

)(2exp),(v)u,(F

N

x

N

y Nvyux

jyxf

>>fft2>>ifft2

u=0 u=N/2 u=N

v=N

v=

N/2

v

=0

Page 14: Digital Image Processing ECE.09.452/ECE.09.552 Fall 2009

S. Mandayam/ DIP/ECE Dept./Rowan University

2-D DFT Properties2-D DFT Properties

• Conjugate symmetrydemos/demo3dft_properties/con_symm_and_trans.m

• Rotationdemos/demo3dft_properties/rotation.m

• Separabilitydemos/demo3dft_properties/separability.m

>>fftshift

Page 15: Digital Image Processing ECE.09.452/ECE.09.552 Fall 2009

S. Mandayam/ DIP/ECE Dept./Rowan University

Spectral Filtering: Spectral Filtering: Radially Symmetric FilterRadially Symmetric Filter

• Low-pass Filterdemos/demo4freq_filtering/lowpass.m

u=-N/2 u=0 u=N/2v=

N/2

v=

0

v=

-N/2

D0

D(u,v)

Page 16: Digital Image Processing ECE.09.452/ECE.09.552 Fall 2009

S. Mandayam/ DIP/ECE Dept./Rowan University

Lab 2: Spatial & Spectral Lab 2: Spatial & Spectral FilteringFiltering

http://engineering.rowan.edu/~shreek/fall09/dip/lab2.html

Page 17: Digital Image Processing ECE.09.452/ECE.09.552 Fall 2009

S. Mandayam/ DIP/ECE Dept./Rowan University

SummarySummary