0% found this document useful (0 votes)
4 views9 pages

Lec - 11 SIP CIS-322 Freq Domain Processing

The document discusses the Discrete Fourier Transform (DFT) and its application in image filtering in the frequency domain. It covers basic properties of the DFT, types of filters (lowpass, highpass, Gaussian, Butterworth), and the process of enhancing images through frequency domain techniques. Key concepts include the relationship between frequency components and image characteristics, as well as the effects of different filters on image quality.

Uploaded by

Masud Urrehman
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)
4 views9 pages

Lec - 11 SIP CIS-322 Freq Domain Processing

The document discusses the Discrete Fourier Transform (DFT) and its application in image filtering in the frequency domain. It covers basic properties of the DFT, types of filters (lowpass, highpass, Gaussian, Butterworth), and the process of enhancing images through frequency domain techniques. Key concepts include the relationship between frequency components and image characteristics, as well as the effects of different filters on image quality.

Uploaded by

Masud Urrehman
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/ 9

DFT

Lecture No. 11

Filtering
in the Frequency Domain

CIS-322

Discrete Fourier Transform Basic Properties


• Common practice:
• In a 2-variable case, the discrete FT pair is:
 
 f ( x, y )(1) x  y  F (u  M / 2, v  N / 2)
1 M 1 N 1
F (u, v)   f ( x, y) exp[  j 2 (ux / M  vy / N )]
MN x0 y 0
• F(0,0) is at u=M/2 and v=N/2
• Shifts the origin of F(u,v) to (M/2, N/2), i.e. the
For u=0,1,2,…,M-1 and v=0,1,2,…,N-1 center of MxN of the 2-D DFT (frequency rectangle)
• Frequency rectangle:
M 1 N 1 from u=0 to u=M-1, and v=0 to v=N-1
AND: f ( x, y )   F (u, v) exp[ j 2 (ux / M  vy / N )] (u,v integers, M,N even numbers)
u 0 v 0
• In computers:
For x=0,1,2,…,M-1 and y=0,1,2,…,N-1 summations are from u=1 to M and v=1 to N
center of transform: u=(M/2) +1 and v=(N/2) +1

Basic Properties
Rate of change at 900
• Value of transform at (u,v)=(0,0):
1 M 1N 1
F(0,0)   f (x, y)
MN x 0 y 0
which means that the value of FT at the origin = the
average gray level of the image
• FT is also conjugate symmetric:
 F(u,v)=F*(-u,-v)
so |F(u,v)|=|F(-u,-v)|
which means that the FT spectrum is symmetric.
The separation of spectrum zeros in the u-direction is exactly
twice the separation of zeros in the v-direction.

1
Image Enhancement in the Frequency Domain
Some basic properties of the
frequency domain
• F(0,0) corresponds to the average gray level
of the image
• As we move away from the origin of the
transform , the low frequency correspond to
the slowly varying components of the image.
• As we move further away from the origin,
the higher frequencies begin to correspond
to faster and faster gray level of the image.

Basic of filtering in frequency Block diagram of basic of filtering in


domain frequency domain
• Multiply the input image by (-1)x+y to centre the transform.
• Compute Fourier transform of image (DFT)
• Multiply the result by a filter transfer function H(u,v) (or simply
filter).
• Take the inverse transform to produce the enhanced image.
• The final image is obtained by taking the real part and multiply it by
(-1)x+y to cancel the multiplication of the input image by this
quantity
• Summary:
G(u,v) = H(u,v) F(u,v)
Filtered Image = 1 G(u,v)



Some basic filters and their properties


1 M 1 N 1
Example: Notch filter
F (0,0)   f ( x, y)
MN x 0 y 0

To force the average value of an image to 0:


F(0,0) gives the average value of an image
then, since F(0,0)=0
Assuming that the transform has been centered

 
by
 f ( x, y )(1) x  y  F (u  M / 2, v  N / 2)

0 if (u,v) =(M/2, N/2)


H(u,v)  
1 otherwise



2
Enhancement in
the Frequency Domain
• Types of enhancement that can be done:
– Lowpass filtering: reduce the high-frequency
content -- blurring or smoothing
(Low frequencies in the Fourier Transform are
responsible for the general gray level appearance
of an image over smooth areas)
– Highpass filtering: increase the magnitude of
high-frequency components relative to low-
frequency components -- sharpening.
(High frequencies are responsible for detail, such
as edges and noise.) Image d is sharpe with little smooth gray level as F(0,0)= 0

Addition of a constant to the filter (K+H(u,v) so that it will not


completely eliminate F(0,0) {constant of one-half}
Lowpass Filtering
in the Frequency Domain

• Edges, noise contribute significantly to the


high-frequency content of the FT of an image.

• Blurring/smoothing is achieved by reducing a


specified range of high-frequency components:

G(u, v)  H (u, v) F (u, v)

Smoothing Ideal Filter (Lowpass)


in the Frequency Domain • A 2-D ideal low-pass filter:
G(u,v) = H(u,v) F(u,v) 1 if D (u , v)  D0
H (u , v)  
0 if D (u , v)  D0
• Ideal
where D0 is a specified nonnegative quantity and
• Butterworth (parameter: filter order) D(u,v) is the distance from point (u,v) to the center of
• Gaussian the frequency rectangle.

• Center of frequency rectangle: (u,v)=(M/2,N/2)


• Distance from any point to the center (origin) of the FT:
D (u , v)  (u 2  v 2 )1/ 2

3
Image Enhancement in the
Frequency Domain
Ideal Filter (Lowpass)
• Ideal:

– all frequencies inside a circle of radius D0 are


passed with no attenuation

– all frequencies outside this circle are completely


attenuated.

Ideal Filter (Lowpass) Ideal Filter (cont.)


• Cutoff-frequency: the point of transition • PT is obtain by summing the components of
between H(u,v)=1 and H(u,v)=0 (D0) power spectrum P(u,v) at each point for u up
to M-1 and v up to N-1.
• To establish cutoff frequency loci, we typically • A circle with radius r, origin at the center of
compute circles that enclose specified amounts the frequency rectangle encloses a
of total image power PT. percentage of the power which is given by
the expression
100[ P(u,v) /PT
u v

• The summation is taken within the circle r



Image Enhancement in the


Frequency Domain

4
ILPF
The most simple lowpass filter is the ideal lowpass. It suppresses all
A dominant frequencies higher than the cut-off frequency Do and leaves smaller
component at the
origin and frequencies unchanged
concentric circular
components about The drawback of this filter function is a ringing effect that occurs
the central
component.
along the edges of the filtered spatial domain image. This
No. of circles is phenomenon is illustrated in Figure 1, which shows the shape of the
inversely prop. to one-dimensional filter in both the frequency and spatial domains for
cutoff freq.
two different values of Do . We obtain the shape of the two-
dimensional filter by rotating these functions about the y-axis. As
mentioned earlier, multiplication in the Fourier domain corresponds
to a convolution in the spatial domain. Due to the multiple peaks of
the ideal filter in the spatial domain, the filtered image produces
ringing along intensity edges in the spatial domain.

ILPF ILPF
Better results can be achieved with a Gaussian shaped filter
function. The advantage is that the Gaussian has the same shape
in the spatial and Fourier domains and therefore does not incur
the ringing effect in the spatial domain of the filtered image. A
commonly used discrete approximation to the Gaussian is the
Butterworth filter. Applying this filter in the frequency domain
shows a similar result to the Gaussian smoothing in the spatial
domain. One difference is that the computational cost of the
spatial filter increases with the standard deviation (i.e. with the
size of the filter kernel), whereas the costs for a frequency filter
are independent of the filter function. Hence, the spatial Gaussian
filter is more appropriate for narrow lowpass filters, while the
Butterworth filter is a better implementation for wide lowpass
filters.

ILPF Butterworth Filter (Lowpass)


The drawback of a low-pass filter is a ringing • To reduce ringing, while smoothing an image
effect that occurs along the edges of the filtered • This filter does not have a sharp discontinuity
establishing a clear cutoff between passed and
spatial domain image. filtered frequencies.

Multiplication in the Fourier domain


1
corresponds to a convolution in the spatial H (u , v) 
1  [ D(u , v) / D0 ]2 n
domain. Due to the multiple peaks of the ideal
filter in the spatial domain, the filtered image Where n is the order of BLPF
produces ringing along intensity edges in the Ringing becomes significant beyond
spatial domain. n=2

5
Image Enhancement in the
Frequency Domain
Butterworth Filter (Lowpass)
• To define a cutoff frequency locus: at points
for which H(u,v) is down to a certain fraction
of its maximum value.

• When D(u,v) = D0, H(u,v) = 0.5

– i.e. down 50% from its maximum value of 1.

Image Enhancement in the


Frequency Domain
Gaussian Lowpass Filter
• Earlier we studied that GLPF to discuss
important relations bw spatial and freq.
domains.
• i.e. width of filter in freq. domain is inversely
prop. to width of filter in spatial domain.
2 2
(u,v)/ 2
H(u,v)  eD
• D(u,v): distance from the origin of FT
• Parameter: =D0 (cutoff frequency)
•
The inverse FT of the Gaussian filter is also a
Gaussian

6
Image Enhancement in the
Frequency Domain

Image smoothing through


GLPF

Image Enhancement in the Frequency Domain


Comparison of GLPF with BLPF
• Smooth transition in blurring as a function of
increasing cutoff frequency.
• GLPF did not achieve as much smoothing as
the BLPF of order 2 for the same value of
cutoff frequency because the profile of GLPF
is not as tight as that of BLPF.
• It is assumed that no ringing in GLPF.
• BLPF is a suitable choice where tight control
of the transition between low and high
frequencies about the cutoff frequency are As we increase D0 for
needed. GPLF, details are
• The price of this additional control over the enhanced
filter profile is the possibility of ringing

Image Enhancement in the


Frequency Domain
Sharpening (Highpass) Filtering
» We know that blurring is achieved by
attenuating high freq. components
through LPF.
» Since edges and other abrupt changes in
gray level are associated with high freq.
components in freq. domain.
» Therefore image sharpening can be
performed using a HPF

Hhp (u,v) 1 Hlp (u,v)



7
Ideal Filter (Highpass) Butterworth Filter (Highpass)

0 if D(u , v)  D0 H (u , v) 
1
H (u , v)  
1 if D(u , v)  D0 1  [ D0 / D(u , v)]2 n

• This filter is the opposite of the ideal lowpass


filter. • D0/D approaches zero, as D approaches
infinity.

Gaussian Highpass Filter


2 2
(u,v)/ 2
H(u,v)  1 eD

• D(u,v): distance from the origin of FT



• Parameter: =D0 (cutoff frequency)

Laplacian in the Frequency Domain

Laplacian (in Spatial Domain, chap. 3)


2 f 2 f
2 f  
x 2 y 2
2 f
 f (x  1, y)  f (x 1, y)  2 f (x, y)
2x2
 f
2
 f (x, y  1)  f (x, y 1)  2 f (x, y)
 2y2
 2 f  [ f (x 1, y)  f (x 1, y)  f (x, y 1)  f (x, y 1)]  4 f (x, y)




8
9

You might also like