84
Filter Design Lecture 20: 10-Sep-12 Dr. P P Das

Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

Filter Design

Lecture 20: 10-Sep-12

Dr. P P Das

Page 2: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

Filtering in Frequency Domain

yxyxf

vuF

vuH

vuH

vuFvuHyxg

)1(by ),(y premultipl

- centered is ),( Needs

centerabout symmetric is ),(Usually

unctionTransfer F Filter :),(

),(),(),( 1

Page 3: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

Example: Frequency Domain Filter

otherwise

QvPuvuH

,1

2/,2/,0),(

),(),(),( 1 vuFvuHyxg

Page 4: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros
Page 5: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros
Page 6: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros
Page 7: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

Wraparound Effect & Zero Padding

Page 8: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros
Page 9: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

Can we pad the filter?

Page 10: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

Filtering Steps

f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros to f(x,y) Multiply fp(x,y) by (–1)^(x+y) to center transform Compute F(u,v) by DFT of fp(x,y) Use real symmetric filter H(u,v), of size PxQ & center at (P/2,

Q/2). Form G(u,v)=H(u,v)F(u,v) Compute gp(x,y) by product of real part of IDFT of G(u,v) and

(–1)^(x+y). Extract g(x,y) taking MxN at left top corner of gp(x,y)

Page 11: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros
Page 12: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

Filter Design

Lecture 21-22: 11-Sep-12

Dr. P P Das

Page 13: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

Filtering Steps

f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros to f(x,y) Multiply fp(x,y) by (–1)^(x+y) to center transform Compute F(u,v) by DFT of fp(x,y) Use real symmetric filter H(u,v), of size PxQ & center at (P/2,

Q/2). Form G(u,v)=H(u,v)F(u,v) Compute gp(x,y) by product of real part of IDFT of G(u,v) and

(–1)^(x+y). Extract g(x,y) taking MxN at left top corner of gp(x,y)

Page 14: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

Filtering in Spatial vis-à-vis Frequency Domains

Filter(FIR) ResponseImpulse Finite:),(

: Hencefinite. are ),( in Quantities

),( of ResponseImpulse :y)(x,

)},({),(Output

: Hence.1),(),,(),(Let

),( : Filter DomainSpatial

),( : FilterDomainFrequency

1

yxh

yxh

vuHh

vuHyxh

vuFyxyxf

yxh

vuH

Page 15: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

Example Gaussian Filter

222

22

2

2/

2)(

)(

: FilterLowpass

x

u

Aexh

AeuH

21

22

21

2/2/

and

22)(

)(

: FilterHighpass

222

2221

2

22

221

2

BA

BeAexh

BeAeuHxx

uu

versa- viceand

)( of profileNarrow

)( of profile Broad

High

xh

uH

Page 16: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

222

22

2

2/

2)(

)(x

u

Aexh

AeuH

22

2222

12

22

221

2

22

21

2/2/

22)(

)(xx

uu

BeAexh

BeAeuH

Page 17: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros
Page 18: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros
Page 19: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

Image Smoothing

Frequency Domain Filters

Page 20: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

Image Smoothing – Low-pass Filter

Low-pass Filtering– Ideal: Very sharp– Butterworth– Gaussian: Very Smooth

Butterworth Filter is parameterized by Filter Order– High Order Ideal– Low Order Gaussian

Page 21: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

Ideal Low-Pass Filter (ILPF)

Frequencyoff-Cut :

)2/()2/(),(

),(,0

),(,1),(

0

2/122

0

0

D

QvPuvuD

DvuD

DvuDvuH

Page 22: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

Ideal Low-Pass Filter (ILPF)

Page 23: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

Ideal Low-Pass Filter (ILPF)

),(),(),(),( where

),( : PowerImage Total

222

1

0

1

0

vuIvuRvuFvuP

vuPPP

u

Q

vT

}),(:,{ 0

/),(100

:filterby off-cutpower ofPercent

DvuDvuTPvuP

Page 24: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

Ideal Low-Pass Filter (ILPF)

Page 25: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

ILPF

Radius Power (α)

10 87.0

30 93.1

60 95.7

160 97.8

460 99.2

Blurring & Ringing decreases with increase of radius / power

Page 26: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

Blurring & Ringing in ILPF

ILPF Box Filter Sinc in Spatial Domain

Page 27: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

Butterworth Low-Pass Filter (BLPF)

BLPFofOrder :

Frequencyoff-Cut :

)2/()2/(),(

/),(1

1),(

0

2/122

20

n

D

QvPuvuD

DvuDvuH n

Page 28: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

Butterworth Low-Pass Filter (BLPF)

Unlike ILPF, no sharp cut-off

Page 29: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

BLPF

Radius

10

30

60

160

460

Page 30: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

ILPF BLPF

- Smooth transition in blurring- No ringing

- Sharp transition in response causing heavy blurring & ringing

Page 31: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

BLPF: Ringing increases with order

Page 32: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

Gaussian Low Pass Filter (GLPF)

Frequencyoff-Cut :

),(

centerabout spread of Measure:

)2/()2/(),(

),(

0

2/),(

2/122

2/),(

20

2

22

D

evuH

QvPuvuD

evuH

DvuD

vuD

Page 33: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

Gaussian Low Pass Filter (GLPF)

Page 34: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

Radius

10

30

60

160

460

GLPF

- No ringing as IDFT of Gaussian is Gaussian

Page 35: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

ILPF BLPF-Smooth transition in blurring- No ringing

GLPF- No ringing- Sharp transition in

response causing heavy blurring & ringing

Radius: 10, 30, 60, 160, 460

Page 36: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

GLFP

BLFP

ILFP

Page 37: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

Image Smoothing: Low-Pass Filters

Page 38: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

LPF: Character Recognition

Page 39: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

LFT: Printing & Publishing

Page 40: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

LFT: Printing & Publishing

Page 41: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros
Page 42: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

LPF: Satellite Imagery

Page 43: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

Image Sharpening

Frequency Domain Filters

Page 44: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

High-Pass Filter (HPF)

),(1),( vuHvuH LPHP

Page 45: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

Image Sharpening – High-pass Filter

High-pass Filtering– Ideal: Very sharp– Butterworth– Gaussian: Very Smooth

Butterworth Filter is parameterized by Filter Order– High Order Ideal– Low Order Gaussian

Page 46: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

Ideal High-Pass Filter (IHPF)

Frequencyoff-Cut :

)2/()2/(),(

),(,1

),(,0),(

0

2/122

0

0

D

QvPuvuD

DvuD

DvuDvuH

Page 47: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

IHFP

BHFP

GHFP

Page 48: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

Image Sharpening: High-Pass Filters

Page 49: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

Ideal High-Pass Filter (IHPF)

Page 50: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

Butterworth High-Pass Filter (BHPF)

BLPFofOrder :

Frequencyoff-Cut :

)2/()2/(),(

),(/1

1),(

0

2/122

20

n

D

QvPuvuD

vuDDvuH n

Page 51: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

Butterworth High-Pass Filter (BHPF)

Page 52: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

Gaussian High Pass Filter (GHPF)

Frequencyoff-Cutt :

)2/()2/(),(

1),(

0

2/122

2/),( 20

2

D

QvPuvuD

evuH DvuD

Page 53: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

Gaussian High Pass Filter (GHPF)

Page 54: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

IHPFBHPF GHPF

Radius: 30, 60, 160

Page 55: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

Image Sharpening: High-Pass Filters

Page 56: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

HPF: Finger Print

BHPF: n=4, D0=50

Page 57: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

Thank you

Page 58: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

Filter Design

Lecture 23: 17-Sep-12

Dr. P P Das

Page 59: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

Laplacian in Spatial Domain

Laplacian– Isotropic – Rotation Invariant

),(4)1,()1,(

),1(),1(2

yxfyxfyxf

yxfyxff

),(),(),( 2 yxfcyxfyxg

2

2

2

22

z

f

t

ff

Page 60: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

Laplacian in Frequency Domain

dudteeztfFztf ujtj 22),(),()},({

),()(4}{

),(4}{),(4}{

)},({4

),()2(

),()},({),(

2222

2

2

2

22

222

222

2

2

122

2222

2

221

Ff

z

f

t

ff

Fz

fF

t

f

F

ddeeFjt

f

ddeeFFztf

jtj

jtj

2

2

2

22

z

f

t

ff

Page 61: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

Laplacian in Frequency Domain

)},(),{{),(

:image an of Laplacian

),(4

))2/()2/(4),(

:rectanglefrequency ofcenter respect to With

)(4),(

12

22

222

222

vuFvuHyxf

vuD

QvPuvuH

vuvuH

Page 62: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

Laplacian in Frequency Domain

Enhancement Eq:

Scales of and as computed by DFT differ widely due to the DFT process

Normalize to [0,1] before DFT Normalize to [-1,1]

1

),(),(),( 2

c

yxfcyxfyxg

),( yxf ),(2 yxf

),( yxf

),(2 yxf

Page 63: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

Laplacian in Frequency Domain

Page 64: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

Comparative Laplacian in Spatial & Frequency Domains

Page 65: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

Unsharp Mask, Highboost Filtering & High-Frequency-Emphasis Filtering

In spatial domain:

Masking Unsharpemphasized- De:1

Filtering Highboost:1

Masking Unsharp:1

),(*),(),(

),(),(),(

k

k

k

yxgkyxfyxg

yxfyxfyxg

mask

mask

Page 66: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

Unsharp Mask, Highboost Filtering & High-Frequency-Emphasis Filtering

In frequency domain:

),(),(),(

),(),(),(1 vuFvuHyxf

yxfyxfyxg

LPLP

LPmask

)},(),(*1{

)},(),(1*1{

),(*),(),(

1

1

vuFvuHk

vuFvuHk

yxgkyxfyxg

FilterEmphasisFrequencyHigh

HP

LP

mask

Page 67: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

Unsharp Mask, Highboost Filtering & High-Frequency-Emphasis Filtering

In frequency domain:

sfrequencie high of oncontributi theControls:0

origin fromoffset theControls:0

)},(),(*{),(

2

1

211

k

k

vuFvuHkkyxgFilterEmphasisFrequencyHigh

HP

Page 68: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

Image: 416x596

D0=40 (5% of short side of padded image)

k1=0.5

k2=0.75

Page 69: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

Homomorphic Filtering

Illumination-Reflectance Model in frequency domain Illumination Component

– Slow Spatial Variations– Attenuate contributions by illumination

Reflectance Component– Varies abruptly – junctions of dissimilar objects– Amplify contributions by reflectance

Simultaneous dynamic range compression & contrast enhancement

Page 70: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

Homomorphic Filtering

),(),(),(

)},({ln)},({ln

)},({ln)},({

),(ln),(ln

),(ln),(

),(),(),(

vuFvuFvuZ

yxryxi

yxfyxz

yxryxi

yxfyxz

yxryxiyxf

ri

Page 71: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

Homomorphic Filtering

),('),('

)},(),({)},(),({

)},({),(

),(),(),(),(

),(),(),(

),(),(),(

11

1

yxryxi

vuFvuHvuFvuH

vuSyxs

vuFvuHvuFvuH

vuZvuHvuS

vuFvuFvuZ

ri

ri

ri

Page 72: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

Homomorphic Filtering

),(),(),( 00),('),('),( yxryxieeeyxg yxryxiyxs

Page 73: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

Homomorphic Filtering

Illumination Component– Slow Spatial Variations– Low Frequencies log of illumination– attenuate contributions by illumination

Reflectance Component– Varies abruptly – junctions of dissimilar objects– High frequencies log of reflectance– amplify contributions by reflectance

Simultaneous dynamic range compression & contrast enhancement

1L

1H

Page 74: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

LDvuDc

HL evuH 20

2 /),(1)(),(

Homomorphic Filtering

Page 75: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

Image: 1162x746γL=0.25, γH=2, c=1, D0=80

Page 76: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

Band-reject & Band-pass Filters

),(1),( vuHvuH BRBP

Page 77: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

Band-reject & Band-pass Filters

Page 78: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

D0=80, n=4

Notch Filters – Narrow Filtering

Page 79: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

Notch Filters – Narrow Filtering

Q

kkkNR vuHvuHvuH

1

),(),(),(

2/122

2/122

)2/()2/(),(

)2/()2/(),(

kkk

kkk

vNvuMuvuD

vNvuMuvuD

Page 80: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

Butterworth Notch Reject Filters

nkkk

nkk

NR

vuDDvuDD

vuH

20

3

12

0 ),(/1

1

),(/1

1

),(

),(1),( vuHvuH NRNP

Page 81: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

D0=80, n=4

Page 82: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros
Page 83: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros
Page 84: Filter Designcse.iitkgp.ac.in/~ksrao/pdf/ip-19/rcg-ch4b.pdf · Filtering Steps f(x,y) is MxN. Pad to PxQ. Typically, P=2M, Q=2N Form fp(x,y) of size PxQ by adding necessary zeros

Thank you