0% found this document useful (0 votes)
12 views46 pages

Tutorial 3 - Image Enhancement in Frequency Domain

Uploaded by

Habiba Yasser
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views46 pages

Tutorial 3 - Image Enhancement in Frequency Domain

Uploaded by

Habiba Yasser
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 46

DIGITAL IMAGE PROCESSING

TUTORIAL 3

Image Enhancement in Frequency


Domain
AGENDA

❑ Fourier Transform.
❑ Continuous.
❑ Discrete.

❑ Frequency Domain Filters.


❑ Low Pass Filters.
❑ High Pass Filters.

❑ Sheet 2.
Frequency in a Digital Image

➢ Frequency
It is the rate of change of intensity values.
• A high-frequency image is the one where the intensity
values change quickly from one pixel to the next.
• A low-frequency image may be one that is relatively
uniform in brightness or where intensity changes very
slowly
Why Frequency Domain?

▪ Easier to remove undesirable frequencies in the


frequency domain (i.e., frequency domain filtering).

▪ Faster to perform certain operations in the frequency


domain than in the spatial domain (e.g., convolution).
Fourier

➢ Jean Baptiste Joseph Fourier


Developed one of the most important
mathematical theories in modern
engineering.

A function can be decomposed into a sum of


sinusoids multiplied by a weighing function.
Continuous Fourier Transform

➢ 1D Fourier Transform 
F (u ) = 
−
f ( x )e − j 2 ux dx

➢ 1D Inverse Fourier Transform



f ( x) =
−
 F (u )e j 2 ux du

➢ 2D Fourier Transform
 
F (u , v ) =  
− −
f ( x, y )e − j 2  ( ux + vy ) dxdy

➢ 2D Inverse Fourier Transform


 
f ( x, y ) = 
− −
F (u , v)e j 2  ( ux + vy ) dudv
Discrete Fourier Transform

➢ 1D Fourier Transform N −1 − j 2  kx
F (k ) =  f ( x )e N
, k = 0,1, ...N − 1
x =0

➢ 1D Inverse Fourier Transform


N −1 j 2  kx
1
f ( x) =
N
 F ( k )e
k =0
N
, x = 0,1,...N − 1

➢ 2D Fourier Transform
N −1 M −1 − j 2 (
ux vy
+ )
F (u, v) =   f ( x, y )e N M
, u = 0,1,...N − 1& v = 0,1,....M − 1
x =0 y =0

➢ 2D Inverse Fourier Transform


1 N −1 M −1 ux vy
j 2 ( + )
f ( x, y ) =  
MN u =0 v =0
F (u, v)e N M , x = 0,1,...N − 1& y = 0,1,....M − 1
Useful Fourier Transform
➢ Delta Function
Useful Fourier Transform
➢ Basis Function
Useful Fourier Transform
➢ Cosine Function
Useful Fourier Transform
➢ Sine Function
Useful Fourier Transform
➢ Window Function
(Rect)
Useful Fourier Transform
➢ Window Function (Rect)
Fourier Transform Properties

▪ Duality of Fourier Transform:


If f(x) has a Fourier Transform F(u), then if we form a new function
of x that has the functional form of the transform, F(x), it will have a
Fourier Transform f(-u) [if f(u) is even function then f(-u) = f(u)]

▪ The original function can be completely recovered (transformed


back to its domain) without loss of data by using an inverse
formula. It is a reversible operation.
Polar Representation of Fourier
Example
▪ The zero crossings of the
spectrum are closer in the
vertical direction because the
rectangle is longer in that
direction.

▪ As the vertical height of the


rectangle decreases, the
distance between the zero
crossings of the spectrum
increases.
Translation and Rotation
Displaying Fourier Transform of an Image
▪ The center of the spectrum (DC component of zero frequency) is in the top left. It is
better to center the spectrum by multiplying the image by (−1) before computing the
x+ y

DFT.
▪ To better visualize the spectrum, it is converted to log scale: log(1+ | F (u, v) |)
DC component and Power
▪ DC component (frequency zero) has the largest magnitude.
▪ Average intensity of the image:

▪ Power spectrum of a signal is the square of the magnitude of its Fourier


Transform.

Circle radius % of Power


10 87.0
30 93.1
60 95.7
160 97.8
460 99.2
Image Enhancement in Frequency Domain

▪ It is more computationally efficient to do the filtering in the


frequency domain.
Filter Types

1. Low pass filter (LPF)


A. Ideal
B. Butterworth
C. Gaussian

2. High pass filter (HPF)


A. Ideal
B. Butterworth
C. Gaussian
1.A Ideal Low Pass Filter

➢ Formula 1 if D (u , v )  D0
H (u , v ) = 
0 if D (u , v )  D0
1.A Ideal Low Pass Filter

➢ Example
▪ As D0 increases, the blurriness
decreases and less power is
removed.

▪ The filtered image is suffering


from ringing effect.
1.A Ideal Low Pass Filter

➢ Ringing Effect

ILPF representation in frequency and spatial domains


respectively

▪ Convolution with sinc function causes the ringing effect.


1.B Butterworth Low Pass Filter

➢ Formula
1
H (u , v) =
1 + [ D(u , v) / D0 ]2 n

▪ It doesn’t have the sharp discontinuity of the ideal low pass filter.
1.B Butterworth Low Pass Filter

➢ Example
▪ Less ringing effect that ideal low
pass filter.

n=2
1.B Butterworth Low Pass Filter

➢ Ringing Effect
▪ As n (order of filter) increases, it approaches the ideal low pass filter.
1.C Gaussian Low Pass Filter

➢ Formula
− D 2 ( u , v ) / 2 D0 2
H (u , v ) = e
1.C Gaussian Low Pass Filter

➢ Example
▪ No ringing effect.
2.A Ideal High Pass Filter

➢ Formula
0 if D(u , v)  D0
H (u , v) = 
1 if D(u , v)  D0
2.A Ideal High Pass Filter

➢ Example
▪ The filtered image is suffering
from ringing effect.
2.A Ideal High Pass Filter

➢ Ringing Effect

IHPF representation in frequency and spatial domains


respectively

▪ Convolution with sinc function causes the ringing effect.


2.B Butterworth High Pass Filter

➢ Formula
1
H (u , v) =
1 + [ D0 / D(u , v)]2 n

▪ It doesn’t have the sharp discontinuity of the ideal high pass filter.
2.B Butterworth High Pass Filter

➢ Example
▪ Less ringing effect than ideal high
pass filter.
2.C Gaussian High Pass Filter

➢ Formula
− D 2 ( u , v ) / 2 D0 2
H (u , v ) = 1 − e
2.C Gaussian High Pass Filter

➢ Example
▪ No ringing effect.
Question 1
Question 1
▪ Image A → FT-2. This is the normal Image transform.

▪ Image B → FT-3. Here we can see noise in the spatial domain.


This is represented as frequencies everywhere in the frequency
domain.

▪ Image C → FT-1. Here, we can see a pattern that is repeated in


the spatial domain. This is represented as two frequencies in the
frequency domain.
Question 2
Question 2

▪ Low pass with D0 = 50 → C. Low pass filter. We also see ringing effects due to low
cutoff.

▪ Low pass with D0 =100 → B. Also, a low pass filter. The ringing effects are almost
not there due to the somewhat high cutoff.

▪ High pass with D0 = 50 → A. High pass filter that highlight the edges in the image.
Question 3
Question 3

▪ Image A → FT-2: A normal image with all frequencies.


▪ Image B → FT-4: Ideal high pass filter is applied which removes the low frequencies and
causes ringing effect.
▪ Image C→ FT-1: Ideal low pass filter is applied which blurred the image and causes ringing
effect.
▪ Image D→ FT-3: Ideal band pass filter is applied that causes ringing effect.
Question 4

Ideal low pass filter is represented by rectangular function in frequency domain. It is


transformed to sinc function in spatial domain which has many intersections with the zeros
value. These intersections are the main cause of the ringing effects.
Question 5
Question 5
Question 5

You might also like