0% found this document useful (0 votes)
263 views40 pages

Fourier Transforms For DIP

This document summarizes image enhancement techniques in the frequency domain. It introduces Fourier analysis and the Fourier transform, which represents an image as a sum of sine and cosine functions. Filtering can be performed by multiplying the Fourier transform of an image by a filter function. Low-pass filtering removes high-frequency content, reducing noise but also causing ringing artifacts. Gaussian and Butterworth filters are better alternatives to ideal low-pass filters as they reduce ringing due to their monotonic spatial profiles.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
263 views40 pages

Fourier Transforms For DIP

This document summarizes image enhancement techniques in the frequency domain. It introduces Fourier analysis and the Fourier transform, which represents an image as a sum of sine and cosine functions. Filtering can be performed by multiplying the Fourier transform of an image by a filter function. Low-pass filtering removes high-frequency content, reducing noise but also causing ringing artifacts. Gaussian and Butterworth filters are better alternatives to ideal low-pass filters as they reduce ringing due to their monotonic spatial profiles.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 40

Chapter 4

Image Enhancement in the


Frequency Domain
Fourier s idea : Any periodic function can be represented
as a sum of sine and cosine functions, with appropriate
amplitudes and phases.
Since we represent an image by a two-dimensional
function f(x,y), we can represent it as a sum of sines and
cosines, if it is periodic.
If the function is not periodic, we have to use a
generalization of the Fourier series representation, known
as the Fourier Transform.

Development of Fourier Series

,
_

,
_

x
L
n
b x
L
n
a
a
x f
n
n
n
n
2
sin
2
cos
2
) (
1 1
0
Any function f(x) which is periodic and is integrable can be
represented (expanded) as:
This can be conveniently written in exponential form as:

,
_

n
n
L
jnx
c x f
2
exp ) (

The C
n
s

are known as the Fourier coefficients.
The original function can be reconstructed from a
knowledge of all the Fourier coefficients.
If the function is non-periodic, i.e., L , n/L can
take continuous values. We set n/L = u (called spatial
frequency).
Therefore:


du jux u F x f ) 2 exp( ) ( ) (

This relation can be inverted to give:


dx jux x f u F ) 2 exp( ) ( ) (
F(u) is known as the Fourier Transform of f(x). It is
analogous to c
n
.
This can be easily generalized to two-dimensions:


+ dxdy vy ux j y x f v u F )) ( 2 exp( ) , ( ) , (

The Meaning of the Fourier Transform:
Let f(x) = sin(2u
o
x). The representation of this function
in the Fourier Space, would be:


dx jux x u u F
o
) 2 exp( ) sin( ) (

function (also called impulse function):
Property :
0 for x 0
0 for x ) (

x
Also area under the delta function = 1


1 ) ( dx x


) 0 ( ) ( ) ( f dx x x f
Rectangular or box function:
f(x) = 1 for a < x < a
= 0 for |x| > a
f(x)
-a 0 a

Fourier Transform of rect function:
) 2 ( sin 2
) 2 sin(
2
)] 2 exp( ) 2 [exp(
) 2 exp( ua c a
u
ua
ju
jua jua
dx jux
a
a



Does this remind you of something?
Clue: Optical phenomena which you studied in Physics-
I/MT-I
Ans: The diffraction pattern of a single slit!
In fact, this is true in general. Diffraction patterns are the
FT of the aperture.

Points to ponder:

Reciprocal nature of F(u) and f(x). Here the width of the


central peak is inversely proportional to a (the width of
f(x)). This is a general property of the Fourier transform.

F(u) is complex (in general).

Sharp changes in the image (f(x)) give rise to peaks at


large values of u.

The phase part of F(u) gives us information about where


these sharp changes occur.

DISCRETE FOURIER TRANSFORM (DFT)
1 - .M 0,1,2,.... u
2
exp ) (
1
) (
1
0

,
_

for
M
jux
x f
M
u F
M
x

1 - .M 0,1,2,.... x
2
exp ) ( ) (
1
0

,
_

for
M
jux
u F x f
M
u

Inverse DFT

Proof:
Substituting for F(u) in the definition of inverse DFT, we
get:

,
_

,
_

1
0
1
0
'
2
exp
2
exp ) (
1
) (
M
u
M
x
M
jux
M
jux
x f
M
x f

,
_

1
0
1
0
) ' ( 2
exp ) (
1
) (
M
x
M
u
M
x x ju
x f
M
x f


If x = x, then the summand = 1, otherwise it is zero.
How?
Phasor addition:
Here M=6; let (x-x)=1,
therefore
Angle between successive
phasors = 2/6
Therefore the summation over
u equals M if (x-x)=0 and the
other summation has only one
term. Hence the proof.

Alternatively
The sum for f(x) is equal to:
0
) ' ( 2
exp 1
)) ' ( 2 exp( 1 ) ' ( 2
exp
1
0

1
]
1

,
_

M
x x ju
x x
M
x x ju
M
u



ADDITIONAL PROPERTIES OF THE DFT:

PERIODICITY: F(u+M)=F(u)
This follows from the definition of the DFT.

,
_

,
_

,
_

+
+

M
jux
x f
M
jux
M
jux
x f
M
M
x M u j
x f
M
M u F
M
x
M
x
M
x

2
exp ) (
1
) 2 exp(
2
exp ) (
1
) ( 2
exp ) (
1
) (
1
0
1
0
1
0

Due to the periodic nature of the DFT, the Fourier
spectrum may appear scrambled if we apply it directly
on an image.
Consider the Fourier spectrum of a 2-D rectangular (or
box) function.
Direct application of the DFT would give rise to a
scrambled Fourier Transform.

Fourier Spectrum of a white rectangle

Centering the Fourier Transform can be done by
multiplying the Image by (-1)
(x+y)
before taking the
Fourier Transform.
We can show that this centers the Transfrom.
From the definition of DFT:

2 2
exp ) ( ) 1 (
1
) , (
1
0
) (

,
_


M
x
y x
N
jvy
M
jux
x f
M
v u F

,
_

+
1
0
2 2
exp ) ( ) exp(
1
M
x
N
jvy
M
jux
x f jy jx
M



Significance of Fourier components:

The zero frequency component , F(0,0) is equal to the


average gray level (intensity) of the image.
Proof:

,
_

,
_

N
jvy
M
jux
y x f
MN
v u F
M
x
N
y
2
exp
2
exp ) , (
1
) , (
1
0
1
0
y) f(x, of Average ) , (
1
) 0 , 0 (
1
0
1
0

M
x
N
y
y x f
MN
F

Fourier Spectrum of typical images

BASIC STEPS FOR FILTERING IN THE FREQUENCY
DOMAIN
1. Multiply the input image by (-1)
(x+y)
to center the
transform
2. Compute F(u,v)
3. Multiply F(u,v) by a filter function H(u,v) (component
wise)
4. Compute the inverse DFT
5. Obtain the real part of the result in (4)
6. Multiply the result by (-1)
(x+y)


NOTCH FILTER : Sets average to zero:
Display is scaled by setting most
negative to zero

Low pass filtering: Result is similar to averaging

IDEAL LOW PASS FILTER


EFFECT OF APPLYING AN IDEAL LOW PASS FILTER:
RINGING

What is the origin of ringing?
To understand ringing we need to understand an
operation called convolution.


+ +
mn
i
i i
b
b t
a
a s
z w t y s x f t s w y x g
1
) , ( ) , ( ) , (
Convolution, is usually defined as:


1
0
1
0
) , ( ) , (
1
) , ( * ) , ( ) , (
N
n
M
m
n y m x h n m f
MN
y x h y x f y x g
This is similar to averaging

If the domain of the functions is continuous, then
convolution is defined as:


d d y x h f y x g ) , ( ) , ( ) , (
Let us now consider convolution in 1-d and look at its
Fourier transform:


dx jux d x h f u G ) 2 exp( ) ( ) ( ) (

) ( ) (
) 2 exp( )) ( 2 exp( ) ( ) ( ) (
u H u F
dx ju x ju d x h f u G



Therefore, convolution in the spatial domain is equivalent
to multiplication in the Fourier Domain and vice-versa.
Let us consider a simple point image (impulse function).
The Fourier transform of this would be a constant. We
multiply this by the filter function. Hence in the real
domain we have to convolve the impulse function with the
spatial representation of the filter function.
The filter function in the spatial domain will have
circular symmetry. It has a central peak and it reduces in
height as we move away from the origin

RINGING

In order to avoid ringing Ideal Low pass filter is not used.
Other filters are available: Gaussian and Butterworth
Filters.
For ringing to be absent, the filter function should have a
spatial representation which varies monotnically. This is
true for Gaussian function and the I order Butterworth
filter.

,
_

2
2
2
) , (
exp ) , (

v u D
v u H

Gaussian Filters

Why does the Gaussian filter not suffer from ringing?
To understand this, let us look at its spatial representation.


+ + dudv vy ux j v u v u H )) ( 2 exp( ) 2 / ) ( exp( ) , (
2 2 2

( ) ( ) dudv y x jy
v
jx
u
2 2 2 2 2 2
2 2
2 2 exp 2
2
exp 2
2
exp

,
_

,
_

,
_

,
_


Converting this integral to polar co-ordinates, we have
( ) ( )

+



0
2
0
2 2 2 2 2 2 2
2 2 exp ) exp( d d y x

Butterworth Low pass filters

Butterworth Low pass filters:
n
D v u D
v u H
2
0
] / ) , ( [ 1
1
) , (
+

Here D(u,v) is the distance from the origin , D


0
is the
distance of the cut-off frequency from the origin and n is
the order of the Butterworth filter. Sharper cutoffs are
obtained with higher values of n but at the cost of increase
in ringing effect.

EFFECT OF FILTERING WITH BUTTERWORTH FILTERS

You might also like