0% found this document useful (0 votes)
12 views

Chapter 4

The document discusses frequency domain image enhancement techniques. It provides mathematical definitions of the Fourier transform and how it relates spatial and frequency domains. Common frequency domain filters and their effects on image components are also covered.

Uploaded by

alazarmatiyos
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 views

Chapter 4

The document discusses frequency domain image enhancement techniques. It provides mathematical definitions of the Fourier transform and how it relates spatial and frequency domains. Common frequency domain filters and their effects on image components are also covered.

Uploaded by

alazarmatiyos
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/ 36

CoSc 4082: Computer Vision and Image Processing

Hawassa University, Bensa Daye Campus

Chapter Four:

Frequency Domain Image Enhancement


Kassawmar Mandefro
Department of Computer Science
March, 2024

Compiled By: Kassawmar Mandefro


Image enhancement: Frequency Domain
 The frequency domain methods are mainly used for transforming image into
frequency domain-- pixels are operated in groups as well as indirectly.
 such as:
◦ Fourier transform provides the relation b/n spatial and frequency domain.
 Frequency domain is the representation of the image in terms of its
frequency components.
 The basic idea in using this technique is to enhance the image by manipulating
the transform coefficients.
 Change- the whole image unlike spatial domain.
 Frequency refers to the rate at which patterns of light and dark change within
an image.
o It is a fundamental concept in the context of frequency domain image
processing, where images are analyzed and manipulated based on their
frequency components.
2
Image enhancement: Frequency Domain
 Any function that periodically repeats itself can be expressed as the sum of
sines and/or cosines of different frequencies, each multiplied by a different
coefficient (Fourier series).

 Functions that are not periodic (but whose area under the curve is finite)
can be expressed as the integral of sines and/or cosines multiplied by a
weighting function (Fourier transform).
 In the context of image processing, most natural images are non-periodic.
 Each pixel in the image typically represents a unique value, and there is no
inherent repetition of image data across the boundaries of the image.
3
Image enhancement: Frequency Domain
 Any periodic function can be decomposed into a summation of sines
and cosines

4
Image enhancement: Frequency Domain

• The purpose of the Fourier transform is


to represent a signal as a linear
combination of sinusoidal signals of
various frequencies.

Fig: the function at the bottom is the sum of the four functions above it. Fourier’s idea in
1807 that periodic functions could be presented as a weighted sum of sines and cosines
was met with skepticism 5
Fourier Transform
 ‘Fourier Transform’ means transforms one function into
another domain , which is called the frequency domain
representation of the original function
 In image Processing the original function is in the Spatial
Domain
 The term Fourier transform can refer to either the Frequency
domain representation of a function or to the process/formula
that "transforms" one function into the other.
 We will be dealing only with functions (images) of finite
duration so we will be interested only in Fourier transform.

6
Image enhancement: Frequency Domain
 Fourier transform is a mathematical operation used to decompose a
function, such as an image, into its frequency components.
 Let's define the Fourier transform F for a function f defined on 𝑅𝑛 :

 A point in 𝑅𝑛 as an n-tuple-- x = (x1,x2,... ,xn).

 An n-tuple of “frequencies”-- ξ = (ξ1,ξ2,... ,ξn)

 Dot product of vectors in 𝑅𝑛 is given by

x · ξ = x1ξ1 + x2ξ2 + · · · + xnξn.

 Define Fourier Transform (FT)

◦ A function f defined on 𝑅𝑛 , and write f(x) or f(x1,... ,xn),

◦ The Fourier transform of f(x) is the function F(ξ1…. ξn)


7
Image enhancement: Frequency Domain
 The Fourier transform is defined mathematically as follows:
 The one-dimensional Fourier transform and its inverse
◦ Fourier transform (continuous case)

◦ The inverse Fourier transform of a function g(ξ) is

◦ The Fourier transform, or the inverse transform, of a real-valued


function is (in general) complex valued.

8
Image enhancement: Frequency Domain
 The two-dimensional Fourier transform and its inverse
◦ Fourier transform (continuous case)

◦ Inverse Fourier transform


 
f ( x, y )    F ( 1,  2)e j 2 (ux  vy ) d 1d 2
 

 All of the familiar algebraic properties of the Fourier transform are


present in the higher dimensional setting

9
Image enhancement: Frequency Domain
 The one-dimensional Fourier transform and its inverse
◦ Fourier transform (discrete case)
M 1
1
F (u ) 
M
 f ( x )e
x 0
 j 2ux / M
for u  0,1,2,..., M  1

◦ Inverse Fourier transform:


M 1
f ( x)   F (u )e j 2ux / M for x  0,1,2,..., M  1
u 0

10
Image enhancement: Frequency Domain
 Since e j  cos  j sin and the fact cos( )  cos
then discrete Fourier transform can be redefined
M 1
1
F (u) 
M
 f ( x)[cos 2ux / M  j sin 2ux / M ]
x 0
for u  0,1,2,..., M  1
◦ Frequency (time) domain: the domain (values of u) over which the
values of F(u) range; because u determines the frequency of the
components of the transform.
◦ Frequency (time) component: each of the M terms of F(u).

11
Image enhancement: Frequency Domain
• The two-dimensional Fourier transform and its inverse
– Fourier transform (discrete case)
M 1 N 1
1
F (u, v) 
MN

x 0 y 0
f ( x, y )e  j 2 (ux / M vy / N )

for u  0,1,2,..., M  1, v  0,1,2,..., N  1


– Inverse Fourier transform:
M 1 N 1
f ( x, y )   F (u, v)e j 2 ( ux / M  vy / N )

u 0 v 0

for x  0,1,2,..., M  1, y  0,1,2,..., N  1


• u, v : the transform or frequency variables
• x, y : the spatial or image variables 12
Image enhancement: Frequency Domain
 In general, the equations you provided are fundamental to
understanding how images are represented and processed in the
frequency domain.

 They involve representing image data and frequency components as


vectors in 𝑅𝑛 and quantifying their relationships using dot products.

 This framework forms the basis for various frequency domain image
processing techniques, such as Fourier transforms and filtering
operations.

13
Sampling in Frequency Domain
 Continuous functions have to be converted into a sequence of discrete
values before they can be processed in a computer.
 This requires sampling and quantization

(a) A continuous function.


(b) Train of impulses used to model sampling.
(c) Sampled function formed as the product of (a)
and (b).
(d) Sample values obtained by integration and using
the sifting property of impulses. (The dashed
line in (c) is shown for reference. It is not part
of the data.)

14
Filtering in the Frequency Domain
 Usually it is challenging task to make direct associations between specific
components of an image and its transform.
 Some general statements can be made about the relationship between the
frequency components of the Fourier transform and spatial features of an
image.
◦ As we move away from the origin of the transform, the low frequencies
correspond to the slowly varying intensity components of an image.
◦ As we move further away from the origin, the higher frequencies begin to
correspond to faster and faster intensity changes in the image
 Types of filter in Frequency Domain Filters:
◦ Lowpass Frequency Domain Filters

◦ Highpass Frequency Domain Filters


15
Image enhancement: Frequency Domain

 Discrete Fourier Transform (DFT) of the spatial image f(x, y) to


produce a frequency domain image F(u, v), processing the image in the
frequency domain, and then taking the inverse of the DFT to obtain the
filtered spatial image g(x, y).

 Finally the inverse Fourier transform is applied for obtaining resultant


image.

16
Image enhancement: Frequency Domain

The 2D DFT F(u,v) can be obtained by


1. Taking the 1D DFT of every row of image f(x,y), F(u,y),
2. Taking the 1D DFT of every column of F(u,y)

(a)f(x,y) (b)F(u,y) (c)F(u,v)

17
Image enhancement: Frequency Domain

 Estimation of scaling coefficient: Scaling sub-band represents


overall image structure
◦ Closely related to global brightness and contrast of the image.
◦ Do not have exactly the same properties as the intensity values in
the spatial domain
 Estimation of wavelet coefficient:
◦ Estimation of wavelet coefficients used to obtain clear details such as
edges and textures for better local contrast and sharpness of image.

18
Lowpass Frequency Domain Filters
 It is used for image smoothing.
 Smoothing is achieved in the frequency domain by high-frequency
attenuation or rejection.
 Edges and other sharp intensity transitions (such as noise) in an image
contribute significantly to the high frequency content of its Fourier
transform.
 The basic model for filtering in the frequency domain

G (u , v)  H (u , v) F (u , v)
where F(u,v): the Fourier transform of the image to be
smoothed and H(u,v): a filter transfer function

19
Lowpass Frequency Domain Filters
 Three types of lowpass filters:
◦ Ideal: very sharp
◦ Butterworth: 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.
◦ Gaussian: very smooth

20
Lowpass Frequency Domain Filters

0 if D(u, v)  D0
H (u, v)  
1 if D(u, v)  D0

(a) Perspective plot of an ideal lowpass-filter transfer function.


(b) Function displayed as an image. (c) Radial cross section.

21
Lowpass Frequency Domain Filters

Fig: a) Original image of size pixels. (b)–(f) Results of filtering using


ILPFs with cutoff frequencies set at radii values 10, 30, 60, 160, and 460

22
Lowpass Frequency Domain Filters
 Gaussian lowpass filter (GLPF) transfer functions have the form

 D 2 ( u ,v ) / 2 D02
H (u, v)  e
where D0 is a parameter controlling the spread of the Gaussian function.

Fig: (a) Perspective plot of a GLPF transfer function. (b) Function


displayed as an image. (c) Radial cross sections for various values of D0
23
Lowpass Frequency Domain Filters

Fig: (a) Original image of size pixels. (b)–(f) Results of filtering using
GLPFs with cutoff frequencies at the radii (D0) 10, 30, 60, 160, and 460
24
Image enhancement: Frequency Domain
• One very useful property of the Gaussian function is that both it and
its Fourier transform are real valued and positive.

• There is also an important relationship between the widths of a


Gaussian function and its Fourier transform. If we make the width of
the function smaller, the width of the Fourier transform gets larger.

• These properties make the Gaussian filter very useful for lowpass
filtering an image.

• Other filters besides lowpass can also be implemented by using two


different sized Gaussian functions.

25
Lowpass Frequency Domain Filters
 Butterworth: shape of a Butterworth filter is controlled by a
parameter called the filter order.
 The Butterworth Lowpass Filter provides a smooth transition
between passband and stopband, attenuating or rejecting high-
frequency components gradually.
 The frequency response of the Butterworth Lowpass Filter is given
by:

where n is the filter order, and D0 is the cutoff frequency.


26
Image enhancement: Frequency Domain

a b c
Fig: Spatial representations of typical (a) ideal, (b) Butterworth, and (c) Gaussian
frequency domain highpass filters, and corresponding gray-level profiles 27
Image Sharpening Using Highpass Filters
 Because edges and other rapid 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.

 Advantageous to enhance the high-frequencies of the Fourier


transform.

28
Ideal, Gaussian, and Butterworth Highpass Filters

Fig: (a)–(c): Ideal, Gaussian, and Butterworth highpass spatial filters obtained from IHPF,
GHPF, and BHPF frequency-domain transfer functions. (The thin image borders are not
part of the data.) (d)–(f): Horizontal intensity profiles through the centers of the
kernels.
29
Image enhancement: Frequency Domain

0 if D(u, v)  D0
H (u, v)  
Ideal Highpass filter 1 if D(u, v)  D0

a b c
Fig: Result of ideal highpass filtering the image in previous ILPF figure (a) with D0
= 15, 30, and 80 respectively.
30
Image enhancement: Frequency Domain
1
H (u, v) 
Butterworth highpass filter 1  D0 / D(u, v)
2n

a b c
Fig: Result of highpass filtering the image in previous ILPF figure (a) using BHPF of
order 2 with D0=15,30, and 80 respectively. These results are much smoother
than those obtained with an ILPF 31
Image enhancement: Frequency Domain

Guassian highpass filter  D 2 ( u ,v ) / 2 D02


H (u, v)  1  e

a b c
Fig: Result of highpass filtering the image in previous ILPF figure (a) using GHPF of
order 2 with D0=15,30, and 80 respectively. than those obtained with an ILPF
32
Question

From SD and FD, which image enhancement technique


is better?

33
Question

 The choice of Spatial Domain Processing versus Frequency Domain


Processing depends on the nature of the problem.

 Frequency Domain Processing offers a great deal of flexibility in filter


design.

 A combination of these two methods produces the best results in


some cases.

34
Caution?
 The enhanced image is expected to have better brightness and
contrast, good color consistency, reduced noise or defect, less visual
artifacts, or better resolution.
 Mathematically an inverse problem and it is impossible to solve in
general-- something better under certain conditions.
 If used inappropriately, enhancement techniques themselves:
◦ May increase noise while improving contrast,
◦ May eliminate small details and edge sharpness while removing noise,
◦ Produce artifacts in general.

 Users need to be cautious to avoid these pitfalls in the pursuit of the


best possible enhanced image.

35
36

You might also like