coe4tn3 image processing

43
CoE4TN3 Image Processing Chapter 4 Image Enhancement in Frequency Domain

Upload: others

Post on 01-Mar-2022

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: CoE4TN3 Image Processing

CoE4TN3Image Processing

Chapter 4Image Enhancement in

Frequency Domain

Page 2: CoE4TN3 Image Processing

2

Fourier Transform • Fourier Transform (FT) of a 2-D signal:

1 1

0 0

1 1

0 0

1

2 2 1/ 2

1( , ) ( , ) exp( 2 ( / / )

( , ) ( , ) exp( 2 ( / / ))

( , ) ( , ) ( , )( , )( , ) tan [ ]( , )

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

M N

x y

M N

u v

F u v f x y j xu M yv NMN

f x y F u v j xu M yv N

F u v R u v jI u vI u vu vR u v

F u v R u v I u vF u M v N F u v

π

π

φ

− −

= =

− −

= =

= − +

= +

= +

=

= +

+ + =

∑ ∑

∑ ∑

Page 3: CoE4TN3 Image Processing

3

Fourier Transform • Properties of Fourier Transform (FT) of a 2-D real, signal:

1 1

0 0

*

*

1(0,0) ( , )

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

M N

x yF f x y

MNF u v F u vF u v F M u N vF u v F u v

− −

= ==

= − −

= − −

= − −

∑ ∑

Page 4: CoE4TN3 Image Processing

4

Fourier Transform • It is common to multiply input image by (-1)x+y prior to

computing the Fourier Transform.

• This shift the center of the FT to (M/2,N/2)

Page 5: CoE4TN3 Image Processing

5

Fourier Transform

Page 6: CoE4TN3 Image Processing

6

Frequency domain filtering 1. Multiply the input image by (-1)x+y to center the transform

Compute the DFT of the image from step 12. Multiply the result by the transfer function of the filter

(centered)3. Take the inverse transform.4. Multiply the result by (-1)x+y

Page 7: CoE4TN3 Image Processing

7

Frequency domain filtering • G(u,v)=F(u,v)H(u,v)• Based on convolution theorem: g(x,y)=h(x,y)*f(x,y)

– f(x,y) is the input image– g(x,y) is the processed image– h(x,y): impulse response or point spread function

• Based on the form of H(u,v), the output image exhibits some features of f(x,y)

Page 8: CoE4TN3 Image Processing

8

Frequency domain filtering

f(x,y)h(x,y)

Convolution

1) Flip 2) Shift, multiply, add

f(x,y)w(x,y)

Implementing a mask

Page 9: CoE4TN3 Image Processing

9

Frequency domain filtering• Convolution with a filter and implementing a mask are very

similar• The only difference is the flipping operation• If the impulse response of the filter is symmetric about the

origin the two operations are the same.• Instead of filtering in the frequency domain, we can

approximate the impulse response of the filter by a mask, and use the mask in the spatial domain.

Page 10: CoE4TN3 Image Processing

10

Page 11: CoE4TN3 Image Processing

11

Frequency domain filtering

• Edges and sharp transitions (e.g., noise) in the gray levels of an image contribute significantly to high-frequency content of FT.

• Low frequency in the Fourier transform of an image are responsible for the general gray-level appearance of the image over smooth areas.

• Blurring (smoothing) is achieved by attenuating range of high frequency components of FT.

• We consider 3 types of lowpass filters: ideal, Butterworth and Gaussian

Page 12: CoE4TN3 Image Processing

12

Ideal low-pass filter• Ideal: all the frequencies inside a circle of radius D0 are

passed and all the frequencies outside this circle are completely removed.

=01

),( vuH0),( DvuD ≤

0),( DvuD >

uv

2 2 1/ 2( , ) [( / 2) ( / 2) ]D u v u M v N= − + − |H||H|

D(u,v)M/2+D0M/2-D0

Page 13: CoE4TN3 Image Processing

13

Page 14: CoE4TN3 Image Processing

14

Page 15: CoE4TN3 Image Processing

15

Ideal low-pass filter• Effects of ideal low-pass filtering: blurring and ringing

Page 16: CoE4TN3 Image Processing

16

Ideal low-pass filter

• The radii of the concentric rings in h(x,y) are proportional to 1/D0

D0 1/D0 Less blurring, Less ringing (amplitude of rings drop)

D0 1/D0 More blurring, More ringing (amplitude of rings increase)

Page 17: CoE4TN3 Image Processing

17

Butterworth Lowpass Filters• Smooth transfer function, no sharp discontinuity, no clear

cutoff frequency.

n

DvuD

vuH 2

0

),(1

1),(

+

=

21

Page 18: CoE4TN3 Image Processing

18

Butterworth Lowpass Filters

Page 19: CoE4TN3 Image Processing

19

Butterworth Lowpass Filters

Page 20: CoE4TN3 Image Processing

20

• Smooth transfer function, smooth impulse response, no ringing

02

2

2),(

),( DvuD

evuH−

=

Gaussian Lowpass Filters

Page 21: CoE4TN3 Image Processing

21

Gaussian Lowpass Filters

Page 22: CoE4TN3 Image Processing

22

Applications of Lowpass Filters

Page 23: CoE4TN3 Image Processing

23

Applications of Lowpass Filters

Page 24: CoE4TN3 Image Processing

24

High-pass filtering• Image sharpening can be achieved by a high-pass filtering

process.• Hhp(u,v)=1-Hlp(u,v)

• Ideal:

• Butterworth:

• Gaussian:

n

vuDD

vuH 20

2

),(1

1|),(|

+

=

=01

),( vuH0),( DvuD >

0),( DvuD ≤

20

2 2/),(1),( DvuDevuH −−=

Page 25: CoE4TN3 Image Processing

25

High-pass filtering

Page 26: CoE4TN3 Image Processing

26

High-pass filtering

Page 27: CoE4TN3 Image Processing

27

High-pass filtering

Page 28: CoE4TN3 Image Processing

28

High-pass filtering

Page 29: CoE4TN3 Image Processing

29

High-pass filtering

Page 30: CoE4TN3 Image Processing

30

Laplacian in Frequency Domain

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

),(),(),(

)(),(

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

222

22

2

221

222

2

2

2

vuvuHvuFvuvuFvuG

yxfyxfyxg

vuvuH

vuFvuyyxf

xyxf

++=

++=

∇−=

+−=

+−=∂

∂+

∂∂

Page 31: CoE4TN3 Image Processing

31

Laplacian in Frequency Domain

Page 32: CoE4TN3 Image Processing

32

Page 33: CoE4TN3 Image Processing

33

Unsharp Masking, High-boost Filtering• Unsharp masking: fhp(x,y)=f(x,y)-flp(x,y)• Hhp(u,v)=1-Hlp(u,v)

• High-boost filtering: fhb(x,y)=Af(x,y)-flp(x,y)• fhb(x,y)=(A-1)f(x,y)+fhp(x,y)• Hhb(u,v)=(A-1)+Hhp(u,v)

Page 34: CoE4TN3 Image Processing

34

Unsharp Masking, High-boost Filtering

Page 35: CoE4TN3 Image Processing

35

Homomorphic filtering• In some images, the quality of the image has reduced because

of non-uniform illumination• Homomorphic filtering can be used to perform illumination

correction• We can view an image f(x,y) as a product of two components:

• This equation cannot be used directly in order to operate separately on the frequency components of illumination and reflectance

( ) ( ) ( )yxryxiyxf ,,, ⋅=

Page 36: CoE4TN3 Image Processing

36

( ) ( ) ( )( )( ) ( )vuFvuHvuFvuHvuSvuZvuHvuSvuFvuFvuZ

ri

ri

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

,,,

+==

+=

( ) ( ) ( ) ( )yxryxiyxfyxz ,ln,ln,ln, +==

),(),(),(

),(),(),(

00),(),(),(

''

''

yxryxieeeyxg

yxryxiyxsyxryxiyxs ===

+=

Homomorphic filtering

Page 37: CoE4TN3 Image Processing

37

• The key to the approach is that separation of the illumination and reflectance components is achieved. The homomorphicfilter can then operate on these components separately

• Illumination component of an image generally has slow variations, while the reflectance component vary abruptly

• By removing the low frequencies (highpass filtering) the effects of illumination can be removed

Homomorphic filtering

Page 38: CoE4TN3 Image Processing

38

Homomorphic filtering

Page 39: CoE4TN3 Image Processing

39

Page 40: CoE4TN3 Image Processing

40

Page 41: CoE4TN3 Image Processing

41

Page 42: CoE4TN3 Image Processing

42

Page 43: CoE4TN3 Image Processing

43