Image Enhancement Frequency Domain

Preview:

DESCRIPTION

CS804B, M2_2, Lecture Notes

Citation preview

Resmi N.G.Reference:

Digital Signal ProcessingRafael C. GonzalezRichard E. Woods

� Frequency Domain Methods� Basics of filtering in frequency domain� Basic Filters and Properties

� Notch filter� Lowpass Filter� Highpass Filter

� Smoothing Frequency Domain Filters� Ideal Lowpass Filters� Butterworth Lowpass Filters� Gaussian Lowpass Filters� Gaussian Lowpass Filters

� Sharpening Frequency Domain Filters� Ideal Highpass Filters� Butterworth Highpass Filters� Gaussian Highpass Filters� Enhancement using The Laplacian� Unsharp Masking� High Boost Filtering� High-Frequency Emphasis Filtering

� Homomorphic Filtering

3/20/2012 CS04 804B Image Processing - Module2 2

Basics of Filtering in Frequency Domain

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

2. Compute the DFT, F(u,v) of the resulting image.

3. Multiply F(u,v) by a filter function H(u,v) to obtain G (u,v).3. Multiply F(u,v) by a filter function H(u,v) to obtain G (u,v).

4.Compute the inverse DFT of G(u,v) to obtain g*(x,y).

5. Obtain the real part of g*(x,y).

6. Multiply the result by (-1)x+y to obtain g (x,y).

3/20/2012 CS04 804B Image Processing - Module2 3

Basic Steps for Filtering in Frequency Domain

3/20/2012 4CS04 804B Image Processing - Module2

� Frequency Domain Methods� Basics of filtering in frequency domain� Basic Filters and Properties

� Notch filter� Lowpass Filter� Highpass Filter

� Smoothing Frequency Domain Filters� Ideal Lowpass Filters� Butterworth Lowpass Filters� Gaussian Lowpass Filters� Gaussian Lowpass Filters

� Sharpening Frequency Domain Filters� Ideal Highpass Filters� Butterworth Highpass Filters� Gaussian Highpass Filters� Enhancement using The Laplacian� Unsharp Masking� High Boost Filtering� High-Frequency Emphasis Filtering

� Homomorphic Filtering

3/20/2012 CS04 804B Image Processing - Module2 5

Basic Filters and Properties� Notch Filter

� It is a constant function with a hole at the origin.� Sets F(0,0) to zero.

� Lowpass Filter� It attenuates high frequencies and passes low frequencies.

� Highpass Filter� It attenuates low frequencies and passes high frequencies.

3/20/2012 CS04 804B Image Processing - Module2 6

� Frequency Domain Methods� Basics of filtering in frequency domain� Basic Filters and Properties

� Notch filter� Lowpass Filter� Highpass Filter

� Smoothing Frequency Domain Filters� Ideal Lowpass Filters� Butterworth Lowpass Filters� Gaussian Lowpass Filters� Gaussian Lowpass Filters

� Sharpening Frequency Domain Filters� Ideal Highpass Filters� Butterworth Highpass Filters� Gaussian Highpass Filters� Enhancement using The Laplacian� Unsharp Masking� High Boost Filtering� High-Frequency Emphasis Filtering

� Homomorphic Filtering

3/20/2012 CS04 804B Image Processing - Module2 7

Smoothing Frequency Domain Filters

�Low Pass Filter (Smoothing Filter)� The result in the spatial domain is equivalent to that of

a smoothing filter as the blocked high frequenciesa smoothing filter as the blocked high frequenciescorrespond to sharp intensity changes, i.e. to the fine-scale details and noise in the spatial domain image.

3/20/2012 CS04 804B Image Processing - Module2 8

3/20/2012 CS04 804B Image Processing - Module2 9

High Pass Filter(Sharpening Filter)� A highpass filter attenuates the low-frequency

components without disturbing the high frequencyinformation in the Fourier Transform.

� It yields edge enhancement or edge detection in thespatial domain, because edges contain many highfrequencies. Areas of constant gray level consistmainly of low frequencies and are thereforesuppressed.

3/20/2012 CS04 804B Image Processing - Module2 10

3/20/2012 CS04 804B Image Processing - Module2 11

Band Pass Filter� A bandpass filter attenuates very low and very high

frequencies, but retains a middle range band offrequencies. Bandpass filtering can be used to enhanceedges (suppressing low frequencies) while reducing theedges (suppressing low frequencies) while reducing thenoise(attenuating high frequencies).

� Bandpass filter is a combination of both lowpass andhighpass filters. These filters attenuate all frequenciesbelow a specific frequency and above a specific frequency,while retaining the frequencies between the two cut-offs.

3/20/2012 CS04 804B Image Processing - Module2 12

� Frequency Domain Methods� Basics of filtering in frequency domain� Basic Filters and Properties

� Notch filter� Lowpass Filter� Highpass Filter

� Smoothing Frequency Domain Filters� Ideal Lowpass Filters� Butterworth Lowpass Filters� Gaussian Lowpass Filters� Gaussian Lowpass Filters

� Sharpening Frequency Domain Filters� Ideal Highpass Filters� Butterworth Highpass Filters� Gaussian Highpass Filters� Enhancement using The Laplacian� Unsharp Masking� High Boost Filtering� High-Frequency Emphasis Filtering

� Homomorphic Filtering

3/20/2012 CS04 804B Image Processing - Module2 13

Ideal Low Pass Filters

0

0

1 ( , )( , )

0 ( , )

.

Transfer Function

if D u v DH u v

if D u v D

D is a specified non negativequantity

≤= >

3/20/2012 CS04 804B Image Processing - Module2 14

( ) ( )

0

122 2

.

( , ) 2 2

D is a specified non negativequantity

D(u,v)is thedistance from point (u,v)to theoriginof

the frequency rectangle.

NMD u v u v

= − + −

� Ideal – because all frequencies inside a circle of radius D0are passed without any attenuation, whereas allfrequencies outside the circle are completely attenuated.

� The point of transition between H(u,v) = 1 and H(u,v) = 0is called the cut-off frequency.

3/20/2012 CS04 804B Image Processing - Module2 15

3/20/2012 CS04 804B Image Processing - Module2 16

Ideal Low pass Filter

� Produces “Ringing” effect.� Cannot be realized in electronic components.� Cannot be realized in electronic components.� Not very Practical

3/20/2012 17CS04 804B Image Processing - Module2

Butterworth Low Pass Filters� The transfer function of a BLPF of order n, and with cut-

off frequency at a distance D0 from the origin, is definedas

2

1( , )

( , )nH u v

D u v=

3/20/2012 CS04 804B Image Processing - Module2 18

( ) ( )

2

0

22

20

( , )1

1

2 21

n

n

D u vD

NMu v

D

+

= − + − +

3/20/2012 CS04 804B Image Processing - Module2 19

� Provides a smooth transition between low and highfrequencies.

� Butterworth filter of order 1 has neither ringing nornegative values.

� BLPF of order 2 has mild ringing and small negativevalues.

� Reduced ringing effect than ILPF.

3/20/2012 CS04 804B Image Processing - Module2 20

Gaussian Low Pass Filters2

2( , )

2( , )D u v

H u v e

D(u,v)is thedistance fromtheoriginof the Fourier

Transform.

σ−

=

3/20/2012 CS04 804B Image Processing - Module2 21

2

20

0

( , )2

0

.

,

( , )

.

D u vD

Transform.

is ameasureof the spread of theGaussiancurve

When D

H u v e

whereD is thecut off frequency

σσ

=

=

3/20/2012 22CS04 804B Image Processing - Module2

20

20

12 20

( , ) 0, ( , ) 1

( , ) , ( , ) 0.607D

D

WhenD u v H u v

WhenD u v D H u v e e−

= =

= = = =

Gaussian Low Pass Filters

� Very smooth filter function.� Inverse DFT of the Gaussian lowpass filter is Gaussian.� No “Ringing” effect.� No “Ringing” effect.

3/20/2012 23CS04 804B Image Processing - Module2

Applications of Low Pass Filters� In the field of machine perception

� Character Recognition

� In printing and publishing industry.� In printing and publishing industry.� Cosmetic processing prior to printing

� For processing satellite and aerial images.

3/20/2012 CS04 804B Image Processing - Module2 24

� Frequency Domain Methods� Basics of filtering in frequency domain� Basic Filters and Properties

� Notch filter� Lowpass Filter� Highpass Filter

� Smoothing Frequency Domain Filters� Ideal Lowpass Filters� Butterworth Lowpass Filters� Gaussian Lowpass Filters� Gaussian Lowpass Filters

� Sharpening Frequency Domain Filters� Ideal Highpass Filters� Butterworth Highpass Filters� Gaussian Highpass Filters� Enhancement using The Laplacian� Unsharp Masking� High Boost Filtering� High-Frequency Emphasis Filtering

� Homomorphic Filtering

3/20/2012 CS04 804B Image Processing - Module2 25

Sharpening Frequency Domain Filters

� Ideal High Pass Filters� Transfer Function of high pass filter is given by

( , ) 1 ( , )hp lpH u v H u v= −

� That is, when low pass filter attenuates frequencies, high pass filter passes them and vice versa.

3/20/2012 CS04 804B Image Processing - Module2 26

( , )

.

hp lp

lpH u v is thetransfer functionof corresponding

low pass filter

� Opposite of ideal lowpass filter.

� Sets to zero all frequencies inside a circle of radius D0while all frequencies outside the circle are passed without

0

0

0 ( , )( , )

1 ( , )

if D u v DH u v

if D u v D

≤= >

while all frequencies outside the circle are passed withoutattenuation.

� Not physically realizable with electronic components.

� Produces ringing effect.

3/20/2012 CS04 804B Image Processing - Module2 27

3/20/2012 28CS04 804B Image Processing - Module2

D0 = 15,30,80

3/20/2012 29CS04 804B Image Processing - Module2

Butterworth High Pass Filter

2

0

1( , )

1( , )

nH u vD

D u v

=

+

3/20/2012 CS04 804B Image Processing - Module2 30

3/20/2012 31CS04 804B Image Processing - Module2

� Represents a transition between the sharpness of IHPF andthe total smoothness of Gaussian filter.

D0 = 15,30,80

Gaussian High Pass Filter2

20

( , )2( , ) 1

D u vDH u v e

= −

3/20/2012 32CS04 804B Image Processing - Module2

D0 = 15,30,80

3/20/2012 33CS04 804B Image Processing - Module2

� Frequency Domain Methods� Basics of filtering in frequency domain� Basic Filters and Properties

� Notch filter� Lowpass Filter� Highpass Filter

� Smoothing Frequency Domain Filters� Ideal Lowpass Filters� Butterworth Lowpass Filters� Gaussian Lowpass Filters� Gaussian Lowpass Filters

� Sharpening Frequency Domain Filters� Ideal Highpass Filters� Butterworth Highpass Filters� Gaussian Highpass Filters� Enhancement using The Laplacian� Unsharp Masking� High Boost Filtering� High-Frequency Emphasis Filtering

� Homomorphic Filtering

3/20/2012 CS04 804B Image Processing - Module2 34

Enhancement using The Laplacian

2 2

( )( ) ( )

( , ) ( , )

nn

n

d f xju F u

dx

d f x y d f x y

ℑ =

3/20/2012 CS04 804B Image Processing - Module2 35

2 22 2

2 2

2 2

2 2

2 2

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

( ) ( , )

( , ) ( , )( , ).

d f x y d f x yju F u v jv F u v

dx dy

u v F u v

d f x y d f x yis the Laplacianof f x y

dx dy

ℑ + = +

= − +

+

( ) ( )

2 2 2

2 2

22

( , ) ( ) ( , )

, ( , ) ( ).

( , ) ( )2 2

f x y u v F u v

Laplaciancanbeimplemented in the frequency domain

using the filter H u v u v

NMH u v u v shifted

∴ℑ ∇ = − +

= − +

= − − + −

3/20/2012 CS04 804B Image Processing - Module2 36

The Laplacian filtered imageinthe spatial domain is

obtained by comput

( ) ( )222 1

( , ) ( , ) :

( , ) ( , )2 2

ing theinverse FourierTransform

of H u v F u v

NMf x y u v F u v− ∇ = ℑ − − + −

Unsharp Masking and High Boost Filtering� High pass filters eliminate the zero frequency component

of their Fourier transforms and hence average backgroundintensity reduces to near black.

� Solution: Add a portion of the image back to the filteredresult.

� Enhancement using Laplacian adds the entire image backto the filtered result.

3/20/2012 CS04 804B Image Processing - Module2 37

� Unsharp masking consists of generating a sharp image by subtracting a blurred version of an image from itself.

� That is, obtaining a highpass-filtered image by subtracting from the image a lowpass-filtered version of itself.

( , ) ( , ) ( , )f x y f x y f x y= −

� High-boost filtering generalizes this by multiplying f(x,y) by a constant A≥1.

3/20/2012 CS04 804B Image Processing - Module2 38

( , ) ( , ) ( , )hp lpf x y f x y f x y= −

( , ) ( , ) ( , )hp lpf x y Af x y f x y= −

� High-boost filtering thus increases the contribution made by the image to the overall enhanced result.

� When A=1, high-boost filtering reduces to regular highpass filtering.

3/20/2012 CS04 804B Image Processing - Module2 39

High Frequency Emphasis Filtering� To increase the contribution made by high-frequency

components of an image.

� Multiply a highpass filter function by a constant and addan offset so that the zero frequency term is not eliminatedby the filter.by the filter.

� Filter transfer function is given by

� Where a ≥0 and b>a.

3/20/2012 CS04 804B Image Processing - Module2 40

( , ) ( , )hfe hpH u v a bH u v= +

Module 2 Assignment� Explain the following point operations:

� Contrast Stretching� Range Compression� Image Clipping� Image Clipping

� Explain Homomorphic Filtering.� Explain Convolution and Correlation Theorems.

3/20/2012 CS04 804B Image Processing - Module2 41

Thank YouThank You

3/20/2012 CS04 804B Image Processing - Module2 42

Recommended