lecture 13 filtering in the frequency domain dr. … digital image processing lecture 13 filtering...

28
EC-433 Digital Image Processing Lecture 13 Filtering in the Frequency Domain Dr. Arslan Shaukat Acknowledgement: Lecture slides material from Dr. Rehan Hafiz, Gonzalez and Woods

Upload: hathu

Post on 11-Apr-2018

234 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Lecture 13 Filtering in the Frequency Domain Dr. … Digital Image Processing Lecture 13 Filtering in the Frequency Domain Dr. Arslan Shaukat Acknowledgement: Lecture slides material

EC-433 Digital Image Processing

Lecture 13

Filtering in the Frequency Domain

Dr. Arslan Shaukat

Acknowledgement: Lecture slides material from

Dr. Rehan Hafiz, Gonzalez and Woods

Page 2: Lecture 13 Filtering in the Frequency Domain Dr. … Digital Image Processing Lecture 13 Filtering in the Frequency Domain Dr. Arslan Shaukat Acknowledgement: Lecture slides material

Highpass Filtering

),(1),( vuHvuH LPHP

Page 3: Lecture 13 Filtering in the Frequency Domain Dr. … Digital Image Processing Lecture 13 Filtering in the Frequency Domain Dr. Arslan Shaukat Acknowledgement: Lecture slides material

Highpass Filters

26/05/2011 EME (NUST) EC-433 Digital Image Processing

Page 4: Lecture 13 Filtering in the Frequency Domain Dr. … Digital Image Processing Lecture 13 Filtering in the Frequency Domain Dr. Arslan Shaukat Acknowledgement: Lecture slides material

Highpass Filters - Spatial Domain

26/05/2011 EME (NUST) EC-433 Digital Image Processing

Page 5: Lecture 13 Filtering in the Frequency Domain Dr. … Digital Image Processing Lecture 13 Filtering in the Frequency Domain Dr. Arslan Shaukat Acknowledgement: Lecture slides material

IHPF

BHPF

GHPF

Do = 30, 60, 160

26/05/2011 EME (NUST) EC-433 Digital Image Processing

Page 6: Lecture 13 Filtering in the Frequency Domain Dr. … Digital Image Processing Lecture 13 Filtering in the Frequency Domain Dr. Arslan Shaukat Acknowledgement: Lecture slides material

HPF and Thresholding

Application: Finger Print Enhancement

HP Filtered image lost the gray-level Zero DC Term

Dark tones pre-dominate in HP Filtered Images (-ve & +ve values)

Binary Thresholding

26/05/2011 EME (NUST) EC-433 Digital Image Processing

Page 7: Lecture 13 Filtering in the Frequency Domain Dr. … Digital Image Processing Lecture 13 Filtering in the Frequency Domain Dr. Arslan Shaukat Acknowledgement: Lecture slides material

Scaling considerations for:

– Can have different scaling

– Need to normalize

Solution:

– Pre-Scale f(x,y)

– Re-Scale Laplacian Image after DFT application

The Laplacian in the Frequency Domain

),(4),( 22 vuDvuH

26/05/2011 EME (NUST) EC-433 Digital Image Processing

)],(),([),( 12 vFvHyxf

)],([),(),( 2 yxfcyxfyxg

Page 8: Lecture 13 Filtering in the Frequency Domain Dr. … Digital Image Processing Lecture 13 Filtering in the Frequency Domain Dr. Arslan Shaukat Acknowledgement: Lecture slides material

The Laplacian in the Frequency Domain

26/05/2011 EME (NUST) EC-433 Digital Image Processing

Page 9: Lecture 13 Filtering in the Frequency Domain Dr. … Digital Image Processing Lecture 13 Filtering in the Frequency Domain Dr. Arslan Shaukat Acknowledgement: Lecture slides material

Implementation

gmask(x,y) = f(x,y) - fLP(x,y)

g(x,y) = f(x,y)+ k*gmask(x,y)

Unsharp Masking k =1

Highboost Filtering k>1

Unsharp Masking and Highboost Filtering

),()],(1[*1),( 1 vuFvuHkyxg LP

),(),(*1),( 1 vuFvuHkyxg HP

26/05/2011 EME (NUST) EC-433 Digital Image Processing

)],(),([),( 1 vFvHyxf LPLP

DC Term is not forced to ZERO !!

Page 10: Lecture 13 Filtering in the Frequency Domain Dr. … Digital Image Processing Lecture 13 Filtering in the Frequency Domain Dr. Arslan Shaukat Acknowledgement: Lecture slides material

High-Frequency Emphasis Filtering

High-pass filtering emphasizes edges but fine details in

the image (i.e., low frequencies) are lost.

Add a constant to H(u,v) to preserve low frequencies.

26/05/2011 EME (NUST) EC-433 Digital Image Processing

Page 11: Lecture 13 Filtering in the Frequency Domain Dr. … Digital Image Processing Lecture 13 Filtering in the Frequency Domain Dr. Arslan Shaukat Acknowledgement: Lecture slides material

Combining Spatial and Frequency Domain Techniques

26/05/2011 EME (NUST) EC-433 Digital Image Processing

Page 12: Lecture 13 Filtering in the Frequency Domain Dr. … Digital Image Processing Lecture 13 Filtering in the Frequency Domain Dr. Arslan Shaukat Acknowledgement: Lecture slides material

Homomorphic Filtering

Page 13: Lecture 13 Filtering in the Frequency Domain Dr. … Digital Image Processing Lecture 13 Filtering in the Frequency Domain Dr. Arslan Shaukat Acknowledgement: Lecture slides material

Homomorphic Filtering

Consider the following model of image formation:

The illumination component is characterized by slow

spatial variations

The reflectance component tends to vary abruptly,

particularly at the junctions of dissimilar objects

Associate the low frequencies of the Fourier transform of

the logarithm of an image with illumination and the high

frequencies with reflectance

So probable solution is to specify H(u,v):

– Enhance high frequencies

– Attenuate low frequencies but preserve fine detail26/05/2011 EME (NUST) EC-433 Digital Image Processing

Page 14: Lecture 13 Filtering in the Frequency Domain Dr. … Digital Image Processing Lecture 13 Filtering in the Frequency Domain Dr. Arslan Shaukat Acknowledgement: Lecture slides material

Separating Low from High Frequencies

Here, low and high frequencies from i(x,y) and r(x,y)

have been mixed together

Difficult to operate on low/high frequencies separately

Solution?

– Attempt to separate signals combined in a nonlinear way by

making the problem become linear (Homomorphic techniques)

26/05/2011 EME (NUST) EC-433 Digital Image Processing

)],([)],([)],([ yxryxiyxf

Page 15: Lecture 13 Filtering in the Frequency Domain Dr. … Digital Image Processing Lecture 13 Filtering in the Frequency Domain Dr. Arslan Shaukat Acknowledgement: Lecture slides material

Homomorphic Filtering

Take the log( )Idea

26/05/2011 EME (NUST) EC-433 Digital Image Processing

Page 16: Lecture 13 Filtering in the Frequency Domain Dr. … Digital Image Processing Lecture 13 Filtering in the Frequency Domain Dr. Arslan Shaukat Acknowledgement: Lecture slides material

Homomorphic Filtering - STEPS

(1) Take Log

(2) Apply FT:

or

(3) Apply H(u,v)

26/05/2011 EME (NUST) EC-433 Digital Image Processing

Page 17: Lecture 13 Filtering in the Frequency Domain Dr. … Digital Image Processing Lecture 13 Filtering in the Frequency Domain Dr. Arslan Shaukat Acknowledgement: Lecture slides material

Homomorphic Filtering (cont’d)

(4) Take Inverse FT:

or

(5) Take exp( )

or

26/05/2011 EME (NUST) EC-433 Digital Image Processing

Page 18: Lecture 13 Filtering in the Frequency Domain Dr. … Digital Image Processing Lecture 13 Filtering in the Frequency Domain Dr. Arslan Shaukat Acknowledgement: Lecture slides material

Homomorphic Filtering (cont’d)

How to choose H(u,v)?

– If l<1 and H>1, the filter tends to decrease the contribution

made by the low frequencies (illumination) and amplify the

contribution made by high frequencies (reflectance)

]/),([ 22

1),( DovuDc

LH evuH

26/05/2011 EME (NUST) EC-433 Digital Image Processing

Page 19: Lecture 13 Filtering in the Frequency Domain Dr. … Digital Image Processing Lecture 13 Filtering in the Frequency Domain Dr. Arslan Shaukat Acknowledgement: Lecture slides material

Application: PET Scan

Blurry Image

Low intensity features obscured by high intensity

of “hot spots”

High Detail

Reduction of effects of dominant illumination allows dynamic

range of lower intensity to be displayed properly

Reflectance components are sharpened26/05/2011 EME (NUST) EC-433 Digital Image Processing

Page 20: Lecture 13 Filtering in the Frequency Domain Dr. … Digital Image Processing Lecture 13 Filtering in the Frequency Domain Dr. Arslan Shaukat Acknowledgement: Lecture slides material

Selective Filtering

Page 21: Lecture 13 Filtering in the Frequency Domain Dr. … Digital Image Processing Lecture 13 Filtering in the Frequency Domain Dr. Arslan Shaukat Acknowledgement: Lecture slides material

Bandreject and Bandpass Filters

26/05/2011 EME (NUST) EC-433 Digital Image Processing

Page 22: Lecture 13 Filtering in the Frequency Domain Dr. … Digital Image Processing Lecture 13 Filtering in the Frequency Domain Dr. Arslan Shaukat Acknowledgement: Lecture slides material

Rejects/Passes a predefined neighborhood of frequencies

Zero phase shift filters must be symmetric about origin.

H(u,v)=H(-u,-v)

Can be defined as product of high pass filters centered at

notch location

Let Q be the no. of notches

Notch Filter

26/05/2011 EME (NUST) EC-433 Digital Image Processing

),(),(),(1

vuHvuHvuH kk

Q

kNR

Page 23: Lecture 13 Filtering in the Frequency Domain Dr. … Digital Image Processing Lecture 13 Filtering in the Frequency Domain Dr. Arslan Shaukat Acknowledgement: Lecture slides material

26/05/2011 EME (NUST) EC-433 Digital Image Processing

Page 24: Lecture 13 Filtering in the Frequency Domain Dr. … Digital Image Processing Lecture 13 Filtering in the Frequency Domain Dr. Arslan Shaukat Acknowledgement: Lecture slides material

Notch Filters - Applications

26/05/2011 EME (NUST) EC-433 Digital Image Processing

Page 25: Lecture 13 Filtering in the Frequency Domain Dr. … Digital Image Processing Lecture 13 Filtering in the Frequency Domain Dr. Arslan Shaukat Acknowledgement: Lecture slides material

Separability of the 2-D DFT

Page 26: Lecture 13 Filtering in the Frequency Domain Dr. … Digital Image Processing Lecture 13 Filtering in the Frequency Domain Dr. Arslan Shaukat Acknowledgement: Lecture slides material

2-D DFT: Separability

The 2-D DFT can be computed using 1-D transforms

– Forward DFT:

– Inverse DFT:

26/05/2011 EME (NUST) EC-433 Digital Image Processing

Page 27: Lecture 13 Filtering in the Frequency Domain Dr. … Digital Image Processing Lecture 13 Filtering in the Frequency Domain Dr. Arslan Shaukat Acknowledgement: Lecture slides material

DFT Properties: Separability (cont’d)

Rewrite F(u,v) as follows:

Let’s set:

Then:

26/05/2011 EME (NUST) EC-433 Digital Image Processing

Page 28: Lecture 13 Filtering in the Frequency Domain Dr. … Digital Image Processing Lecture 13 Filtering in the Frequency Domain Dr. Arslan Shaukat Acknowledgement: Lecture slides material

DFT Properties: (cont’d)

26/05/2011 EME (NUST) EC-433 Digital Image Processing