[go: up one dir, main page]

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

Ch04_Frequency Domain Image Processing

Image processing and computer vision

Uploaded by

Shafi Esa
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)
95 views46 pages

Ch04_Frequency Domain Image Processing

Image processing and computer vision

Uploaded by

Shafi Esa
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

Chapter Four

Frequency Domain Image Processing

1
4.1 Introduction to Frequency
Domain
 In spatial domain, we deal with images as it
is. The value of the pixels of the image
change with respect to scene.
 Whereas in frequency domain, we deal with
the rate at which the pixel values are
changing in spatial domain.
 We use the Fourier transform to go from the
spatial to the frequency domain; to return to
the spatial domain we use the inverse Fourier
transform.
2
4.2 Fourier series

 A function f(t) of a continuous variable, t, that


is periodic with a period, T, can be expressed
as the sum of sines and cosines multiplied by
appropriate coefficients. This sum, known as
a Fourier series, has the form

where

are the coefficients.


3
For example

 The function at the bottom is the sum of the four


functions above it

4
Fourier Transform

 Functions that are not periodic can be


expressed as the integral of sines and/or
cosines multiplied by a weighting function.
 This sum, known as a Fourier transform, has
the form

 Conversely, given , we can obtain f(t)


back using the inverse Fourier transform,
written as
5
…cont’d

 Fourier transformation is used in a wide


range of application such as image filtering,
image compression, Image analysis and
image reconstruction etc.

6
4.3 Frequency Spectrum

 In general, the Fourier transform contains


complex terms, and it is customary for display
purposes to work with the magnitude of the
transform (a real quantity), which is called the
Fourier spectrum or the frequency spectrum:

7
(a) A box function, (b) its Fourier transform, and (c) its spectrum.
4.4 Continuous 2-D Fourier
Transform and Its Inverse
 Let f(t,z) be a continuous function of two
continuous variables, t and z. The two
dimensional, continuous Fourier transform is
given by the expressions

and its inverse is given by

where and are the frequency variables.


8
…cont’d

 When referring to images, t and z are


interpreted to be continuous spatial variables.
 The domain of the variables and defines
the continuous frequency domain.

9
4.5 Discrete 2-D Fourier
Transform And Its Inverse
 The 2-D discrete Fourier transform (DFT) is
given by:

where f(x,y) is a digital image of size M x N,


= 0, 1, 2 ,… M – 1 and = 0, 1, 2 ,… N - 1

10
…cont’d

 Given the transform , we can obtain


f(x,y) by using the inverse discrete Fourier
transform (IDFT):

for x = 0, 1, 2 ,…, M - 1 and y = 0, 1, 2 , ..., N - 1

11
Fourier Spectrum And Phase
Angle
 Because the 2-D DFT is complex in general,
it can be expressed in polar form:

where the magnitude

is called the Fourier (or frequency) spectrum,


and

is the phase angle or phase spectrum.


12
…cont’d

 Finally, the power spectrum is defined as

 R and I are the real and imaginary parts of ,


and all computations are carried out for the
discrete variables u = 0, 1, 2 ,…, M - 1 and
v = 0, 1, 2 , . …, N - 1
 Therefore, , , , , and are arrays of
size M x N.
13
4.6 Frequency Information of
Images
 Frequency in images is the rate of change of
intensity values.
 Thus, a high-frequency image is the one
where the intensity values change quickly
from one pixel to the next.
 On the other hand, a low-frequency image
may be one that is relatively uniform in
brightness or where intensity changes very
slowly.
 Most images contain both high-frequency and
low-frequency components. 14
…cont’d

 Let’s see by an example below

15
…cont’d

 Clearly, in the above image, the zebra pattern


has a high frequency as the intensity changes
very rapidly from white to black.
 While the intensity changes very gradually in
the sky thus it has low frequency.

16
4.7 Image Enhancement in
Frequency Domain
 Image enhancement is the process of making
images more useful.
 The reason for doing this include:
 Highlighting
 Remove nose from images interesting detail in
images
 Making images more visually appealing

17
Types of enhancement Techniques

 There are two broad categories of image


enhancement techniques:
 Spatial domain techniques – manipulating
image pixels directly
 Frequency domain techniques – manipulating
Fourier transform of images

18
Frequency Domain Filtering
Fundamentals
 Filtering in the frequency domain consists of
modifying the Fourier transform of an image,
then computing the inverse transform to
obtain the spatial domain representation of
the processed result.
 Thus, given (a padded) digital image, f(x,y),
of size PxQ pixels, the basic filtering equation
in which we are interested has the form:

where is the IDFT, is DFT of the input


image , f(x,y), is a filter transform function19
…cont’d

(which we often call just a filter or filter function),


and g(x,y) is the filtered (output) image.
 Functions F, H, and g are arrays of size PxQ,
the same as the padded input image.
 The product is formed using
elementwise multiplication.
 The filter transfer function modifies the
transform of the input image to yield the
processed output, g(x,y).

20
Filtering steps in Frequency
Domain
 The process of filtering in the frequency
domain can:
1. Given an input image f(x,y) of size MxN,
obtain the padding sizes P and Q using
P=2M and Q=2N.
2. Form a padded image fp (x,y) of size PxQ
using zero-, mirror-, or replicate padding
3. Multiply fp (x,y) by (-1)x+y to center the Fourier
transform on the PxQ frequency rectangle.
4. Compute the DFT, , of the image from
Step 3. 21
…cont’d

5. Construct a real, symmetric filter transfer


function, , of size PxQ with center at
(P/2, Q/2).
6. Form the product using
elementwise multiplication; that is,
for i = 0, 1, 2, …, M – 1, and k = 0, 1, 2, …, N – 1
7. Obtain the filtered image (of size P × Q) by
computing the IDFT of :

22
…cont’d

8. Obtain the final filtered result, g (x, y), of the


same size as the input image, by extracting
the MxN region from the top, left quadrant of
gp (x,y)

23
Example

Step 1 Step 2 Step 3

Step 4 Step 5 Step 6

Step 7 Step 8
24
Frequency Domain Filtering

 Filtering in the frequency domain consists of


modifying the Fourier transform of an image
and then computing the inverse transform to
obtain the processed result.
 There are two types of Frequency domain
filters:
 Lowpass frequency domain filters and
 Highpass frequency domain filters

25
Lowpass Frequency domain
Filtering
 Edges and other sharp intensity transitions
(such as noise) in an image contribute
significantly to the high frequency content of
its Fourier transform.
 Hence, smoothing (blurring) is achieved in
the frequency domain by high-frequency
attenuation.
 Attenuating high frequency and passing low
frequency is know as lawpass filtering.
 Three types of lowpass filters: ideal,
Butterworth, and Gaussian. 26
Ideal Lowpass Filters

 A 2-D lowpass filter that passes without


attenuation all frequencies within a circle of
radius from the origin, and “cuts off” all
frequencies outside this circle is called an
ideal lowpass filter (ILPF); It is specified by
the transfer function:

where D0 is a positive constant, and D(u,v) is the


distance between a point (u,v) in the frequency
domain and the center of the PxQ frequency
rectangle; that is, 27
…cont’d

 The name ideal indicates that all frequencies


on or inside a circle of radius D0 are passed
without attenuation, whereas all frequencies
outside the circle are completely attenuated
(filtered out).

Perspective plot of an ideal Function displayed Radial cross section


lowpass-filter transfer as an image 28
function
…cont’d

 For an ILPF cross section, the point of


transition between the values H(u,v) = 1 and
H(u, v) = 0 is called the cutoff frequency.

a b c

d e f

(a) Original image. (b)–(f) Results of filtering using ILPFs with cutoff
frequencies set at radii values 10, 30, 60, 160, and 460
29
Gaussian Lowpass Filters

 Gaussian lowpass filter (GLPF) transfer


functions have the form

where, D(u, v) is the distance from the center of


the PxQ frequency rectangle to any point, (u,v)
contained by the rectangle.
 By letting , we can express the
Gaussian transfer function

where D0 is the cutoff frequency.


30
…cont’d

 When D(u,v) = D0 the GLPF transfer function


is down to 0.607 of its maximum value of 1.0.

Perspective plot of a GLPF Function displayed Radial cross section


transfer function as an image

31
…cont’d

(a) Original image. (b)–(f) Results of filtering using GLPFs


with cutoff frequencies 32
Butterworth Lowpass Filters

 The transfer function of a Butterworth


lowpass filter (BLPF) of order n, with cutoff
frequency at a distance D0 from the center of
the frequency rectangle, is defined as

33
…cont’d

Perspective plot of a BLPF Function displayed Radial cross sections


transfer function as an image. of BLPFs of orders 1
through 4.

34
…cont’d

(a) Original image. (b)–(f) Results of filtering using BLPFs


with cutoff frequencies and n = 2.5
35
Summary

 Ideal, Butterworth, and Gaussian cover the


range from very sharp (ideal) to very smooth
(Gaussian) filtering.
 The shape of a Butterworth filter is controlled
by a parameter called the filter order. For
large values of this parameter, the
Butterworth filter approaches the ideal filter.
 For lower values, the Butterworth filter is
more like a Gaussian filter.
 Thus, the Butterworth filter provides a
transition between two “extremes.” 36
Highpass Frequency Domain
Filtering
 Because edges and other abrupt changes in
intensities are associated with high-frequency
components, image sharpening can be
achieved in the frequency domain by
highpass filtering, which attenuates low-
frequencies components without disturbing
high-frequencies in the Fourier transform.
 Three types of lowpass filters: ideal,
Butterworth, and Gaussian

37
…cont’d

 Subtracting a lowpass filter transfer function


from 1 yields the corresponding highpass
filter transfer function in the frequency
domain:

where is the transfer function of a


lowpass filter.

38
Ideal Highpass Filters

 An ideal highpass filter (IHPF) transfer


function is given by

where, as before, D(u,v) is the distance from the


center of the P x Q frequency rectangle

39
…cont’d

 Perspective plot, image, and, radial cross


section of an IHPF transfer function.

40
…cont’d

 Example, image filtered with IHPF transfer


functions using D0 = 60 ( first row) and D0 =
160 (second row).

41
Gaussian Highpass Filters

 The transfer function of a Gaussian highpass


filter (GHPF) transfer function is given by

 Perspective plot, image, and, radial cross


section of an GHPF transfer function.

42
…cont’d

 Example, image filtered with GHPF transfer


functions using D0 = 60 ( first row) and D0 =
160 (second row).

43
Butterworth Highpass Filters

 The transfer function of a Butterworth


highpass filter (BHPF) is

 Perspective plot, image, and, radial cross


section of an BHPF transfer function.

44
…cont’d

 Example, image filtered with GHPF transfer


functions using D0 = 60 in all cases (n = 2 for
the BHPF) ( first row) and D0 = 160 (second
row).

45
…cont’d

 As before, we see that the BHPF transfer


function represents a transition between the
sharpness of the IHPF and the broad
smoothness of the GHPF transfer function.

46

You might also like