Digital Image Processing in Frequency Domain

Preview:

DESCRIPTION

Digital Image Processing in Frequency Domain. Md. Al Mehedi Hasan Assistant Professor Dept. of Computer Science & Engineering RUET, Rajshahi. How con we connect broken text ?. How can we remove blemishes in a photograph?. How can we get the enhanced image from the original image?. - PowerPoint PPT Presentation

Citation preview

Digital Image Processing in Frequency Domain

Md. Al Mehedi HasanAssistant Professor

Dept. of Computer Science & EngineeringRUET, Rajshahi

How con we connect broken text ?

How can we remove blemishes in a photograph?

How can we get the enhanced

image from the original

image?En

hanc

ed im

age

How can we get this original image?

What is a transformation?

• im is the original image;• IM is the transformed image;• (or ) represents the spatial coordinates of a pixel.

The goal of a transformation is to get a new representation of the incoming picture. This new representation can be more convenient for a particular application or can ease the extraction of particular properties of the picture.

Goal of a transformation

Image transformation

Image transformation

• Geometric transformation such as rotation, scaling...Example of rotation:

Remark: a point to point transformation doesn't require extra memory...

Point to point transformation

Local to point transformation

Note that local to point transformation is also called neighborhood operators.

Examples of local to point transformation:

One of the most important transformation is the Fourier transform that gives a frequential representation of the signal.

Fourier series (development in real term):

Every periodic signal can be decomposed into a linear combination of sinusoidal and cosinusoidal component functions.

and are used to weight the influence of each frequency component.

𝑓 (𝑥 )=𝑎0+∑𝑛=1

𝑎𝑛cos (2𝜋 𝑓𝑛𝑥 )+∑𝑛=1

𝑏𝑛sin (2𝜋 𝑓𝑛𝑥 )

Global to point transformation

Why Frequency Domain?

Similar jobs can be done in the spatial and frequency domains.

Filtering in the spatial domain can be easier to understand.

Filtering in the frequency domain can be much faster – especially for large images.

Note that convolution in the time domain is equivalent to multiplication in the frequency domain (and vice versa)– When you are faced with a difficult convolution (or

multiplication), you can switch domains and do the complement operation

Jean Baptiste Joseph FourierFourier was born in Auxerre, France in 1768

– Most famous for his work “La Théorie Analitique de la Chaleur” published in 1822

– Translated into English in 1878: “The Analytic Theory of Heat”

Nobody paid much attention when the work was first publishedOne of the most important mathematical theories in modern engineering

The Big Idea

=

Any function that periodically repeats itself can be expressed as a sum of sines and cosines of different frequencies each multiplied by a different coefficient – a Fourier series

Imag

es ta

ken

from

Gon

zale

z &

Woo

ds, D

igita

l Im

age

Proc

essi

ng (2

002)

Mathematical Background

Sine and Cosine Functions

• Periodic functions• General form of sine and cosine functions:

𝑦 (𝑡 )=𝐴𝑠𝑖𝑛(𝛼𝑡+𝑏) 𝑦 (𝑡 )=𝐴𝑐𝑜𝑠 (𝛼𝑡+𝑏)

Sine and Cosine Functions (cont’d)

• Changing the period T=2π/|α| e.g., y=cos(αt)

period 2π/4=π/2

shorter period higher frequency(i.e., oscillates faster)

α =4

Frequency is defined as f=1/T

Different notation: cos(αt)=cos(2πt/T)=cos(2πft)

In physics, angular frequency ω is a scalar measure of rotation rate. Angular frequency is the magnitude of the vector quantity angular velocity. One revolution is equal to 2π radians, hence

Where

ω is the angular frequency or angular speed (measured in radians per second),T is the period (measured in seconds),f is the ordinary frequency (measured in hertz).

Angular Frequency

Different Notation of Sine and Cosine Functions

• Changing the period T=2π/|α| e.g., y=cos(αt)

period 2π/4=π/2

shorter period higher frequency(i.e., oscillates faster)

α =4

Frequency is defined as f=1/T

Different notation: cos(αt)=cos(2πt/T)=cos(2πft)=where

++

cos (2𝜋 𝑓𝑛𝑥 )s∈(2𝜋 𝑓𝑛𝑥 )

Different Notation of Sine and Cosine Functions (continue)

Fundamental Frequency?

Time Domain and Frequency Domain

Time Domain:

The time-domain plot shows changes in signal amplitude with respect to time. Phase and frequency are not explicitly measure on a time-domain plot.

Frequency Domain:

The time-domain plot shows changes in signal amplitude with respect to frequency.

3.22

The time-domain and frequency-domain plots of a sine wave

The time domain and frequency domain of three sine waves

A composite periodic signal

Decomposition of a composite periodic signal in the time and frequency domains

When we deal with a one dimensional signal (time series), it is quite easy to understand what the concept of frequency is. Frequency is the number of occurrences of a repeating event per unit time. For example, in the figure below, we have 3 cosine functions with increasing frequencies cos(t), cos(2t), and cos(3t).

Spatial Frequency in image

So, we know that a sequence of such numbers gives us the feeling that cos(t) is a low frequency signal. How we can create an image of these numbers? Let scale the numbers to the range 0 and 255:

Considering that values are intensity values, we can obtain the following image.

This is our first image with a low frequency component. We have a smooth transition from white to black and black to white. However, it is still difficult to say anything since we have not seen an image with high frequency. If we repeat all the steps for cos(3t) , we obtain the following image:

where we have sudden jumps to black. You can try the same experiment for different cosines. By looking at two examples, we can say that if there are sharp intensity changes in an image, those regions correspond to high frequency components. On the other hand, regions with smooth transitions correspond to low frequency components.

We now have an idea for one dimensional image. It is time to switch to two dimensional representation of a signal. Let us first define a kind of two dimensional signal: f(x, y)=cos(kx) cos(ky). For example, the signal for k=1, we have: f(x, y)=cos(x) cos(y).

Our corresponding two dimensional function will be f(x, y)=cos(x) cos(y). How we will obtain a two dimensional image from this function? This is the question! We are going to define a matrix and store the values of f(x,y) for different (x, y) pairs.

Basically, we divide the angle range 0-2∏ into M=512 and N=512 regions for x and y, respectively.

Here are images for different k values. Values of k represents the level of frequency (from low to high) for k=0,….,20.

Similar to the 1D case, we can say that if the intensity values in an image changes dramatically, that image has high frequency components.

Special Frequency In Images

Spatial frequency of an image refers to the rate at which the pixel intensities change

In picture on right: High frequences:

Near center Low frequences:

Corners

According to Fourier, any periodic function defined in

can be expressed as

𝑓 (𝑥 )=𝑎0+∑𝑛=1

𝑎𝑛cos (𝑛𝑥 )+∑𝑛=1

𝑏𝑛sin (𝑛𝑥)

Where𝑎0=

12𝜋 ∫

−𝜋

𝜋

𝑓 (𝑥 )𝑑𝑥

𝑎𝑛=1𝜋 ∫

−𝜋

𝜋

𝑓 (𝑥 )cos (𝑛𝑥 )𝑑𝑥

𝑏𝑛=1𝜋 ∫

−𝜋

𝜋

𝑓 (𝑥 )𝑠𝑖𝑛 (𝑛𝑥 )𝑑𝑥

𝑛=1,2,3 ,……

Fourier Series and it’s Derivation

Math

ematical C

on

cepts

Basis, CoordinateDefinition A: A set of vectors is a basis of V if it has the following two properties: ( 1 ) S is linearly independent. (2) S spans V.

Definition B: A set of vectors is a basis of V if every can be written uniquely as a linear combination of the basis vectors.

Let

These n scalars are called the coordinates of v relative to the basis S. Thus

Example

Consider real space . The following vectors form a basis S of :

The coordinates of v = (5 , 3 , 4) relative to the basis S is obtained as follows. Set , that is, set v as a linear combination of the basis vectors using unknown scalars x, y, z. This yields:

The equivalent system of linear equations is as follows:

The solution of the system is x = 3, y = 2, z = 4. Thus

40

Definition

An inner product on a real vector spaces V is a function that associates a number, denoted 〈 u, v 〉 , with each pair of vectors u and v of V. This function has to satisfy the following conditions for vectors u, v, and w, and scalar c.

1. 〈 u, v 〉 = 〈 v, u 〉 (symmetry axiom)

2. 〈 u + v, w 〉 = 〈 u, w 〉 + 〈 v, w 〉 (additive axiom)

3. 〈 cu, v 〉 = c 〈 u, v 〉 (homogeneity axiom)

4. 〈 u, u 〉 0, and 〈 u, u 〉 = 0 if and only if u = 0

(position definite axiom)

Inner product

IneInner Product

Space

NNorm

Metric

Inner product Space, Norm. Metric, Projection

Orthogonal Projection

ORTHOGONAL SETS AND BASES

Consider a set of nonzero vectors in an inner product space V. S is called orthogonal if each pair of vectors in S are orthogonal, and S is called orthonormal if S is orthogonal and each vector in S has unit length. That is:

Let S consist of the following three vectors in :

we can verify that the vectors are orthogonal; hence they are linearly independent. Thus S is an orthogonal basis of

Suppose we want to write v = (7 , 1 , 9) as a linear combination of . First we set v as a linear combination of using unknowns as follows:

Orthogonal Basis and Linear Combinations

Method One

Expand (*) to obtain the system

Solve the system by Gaussian elimination to obtain , , .

Thus

This method uses the fact that the basis vectors are orthogonal, and the arithmetic i s much simpler. If we take the inner product of each side of (*) with respect to we get

Here two terms drop out, since are orthogonal. Accordingly,

Method Two

Orthogonal Basis and Linear Combinations (continue)

Theorem

Let be an orthogonal basis of V. Then, for any

Definition . A Hilbert space H is a vector space endowed with an inner product and associated norm and metric, such that every Cauchy sequence in H has a limit in H.

An example of a Hilbert space is the space

Definition of . The space is the collection of Borel measurable real or complex valued square integrable functions f on (a,b), i.e.,, endowed with inner product ,and associated norm and metric

,

respectively, where the integrals involved are Lebesgue integrals.

Hilbert Space

and are examples of finite dimensional Hilbert spaces; that is, any basis will have a finite number of basis vectors (in fact, n of them); expressing a vector in and as a vector in terms of an orthonormal basis is easy.

In infinite-dimensional Hilbert spaces, however, such an expression must involve an infinite sum, and hence issues of convergence. To say that for some vectors , we mean that

as

Basis of a Hilbert space

Orthonormal System: Let V be an inner product space. A collection of vectors is said to be an orthonormal system if for and if for all .

A collection of vectors in a Hilbert space H is complete if for all implies that y = 0.

An equivalent definition of completeness is the following. is complete in H if span is dense in H , that is, given and , there exists such that .

Basis of a Hilbert space (con..)

Complete orthonormal system

Definition Let be an orthonormal set in an Hilbert space .Then is said to be an orthonormal basis of if it is a complete orthonormal set in .

TheoremLet be an orthonormal set in an Hilbert space . Then is an orthonormal basis if and only if .

TheoremEvery Hilbert spaces has an orthonormal basis.

Basis of a Hilbert space (Continue)

Separable Hilbert spaces

Theorem A Hilbert space is separable if and only if it has a countable orthonormal basis.

Definition. A Hilbert space with a countable dense subset is separable. That is, a separable Hilbert space H has subset such that for any and for all , there exist with . Therefore the closure of D is H.

A set is a basis for a Hilbert space H if every x can be expressed uniquely in the form

for some in the field of scalars. If in addition is an orthonormal set, then we refer to it as an orthonormal basis.

Proposition . Let be an orthonormal set in a Hilbert space H. Then the following are equivalent:

Basis of a Separable Hilbert space

According to Fourier, any function defined in

can be expressed as

𝑓 (𝑥 )=𝑎0+∑𝑛=1

𝑎𝑛cos (𝑛𝑥 )+∑𝑛=1

𝑏𝑛sin (𝑛𝑥)

Where𝑎0=

12𝜋 ∫

−𝜋

𝜋

𝑓 (𝑥 )𝑑𝑥

𝑎𝑛=1𝜋 ∫

−𝜋

𝜋

𝑓 (𝑥 )cos (𝑛𝑥 )𝑑𝑥

𝑏𝑛=1𝜋 ∫

−𝜋

𝜋

𝑓 (𝑥 )𝑠𝑖𝑛 (𝑛𝑥 )𝑑𝑥

𝑛=1,2,3 ,……

(Con..)

𝑓 (𝑥 )=𝑎0+∑𝑛=1

𝑎𝑛cos (𝑛𝑥 )+∑𝑛=1

𝑏𝑛sin (𝑛𝑥)

This is an infinite series of continuous functions, so each of the functions

1 ,𝑐𝑜𝑠𝑥 ,𝑠𝑖𝑛𝑥 ,𝑐𝑜𝑠2𝑥 ,𝑠𝑖𝑛2 𝑥 ,….belong to . What happens if we compute the inner product of these functions?

(Con..)

(Con..)

So the functions 1, cos x, sin x, cos 2x, sin 2x, . . . are orthogonal with respect to the inner product!

They are not, however, orthonormal, since:

(Con..)

(Con..)

Normalizing them appropriately, we get the orthonormal sequence of functions:

If this sequence were in fact an orthonormal basis, then we would be able to say that every function in has an expression in terms of that basis, i.e. a Fourier series, which converges to the function in question.

1

√2𝜋,

1

√𝜋𝑐𝑜𝑠𝑥 ,

1

√𝜋𝑠𝑖𝑛𝑥 ,

1

√𝜋𝑐𝑜𝑠2 𝑥 ,

1

√𝜋𝑠𝑖𝑛2 𝑥 ,….

(Con..)

Theorem. The sequence

1

√2𝜋,

1

√𝜋𝑐𝑜𝑠𝑥 ,

1

√𝜋𝑠𝑖𝑛𝑥 ,

1

√𝜋𝑐𝑜𝑠2 𝑥 ,

1

√𝜋𝑠𝑖𝑛2 𝑥 ,….

of functions in form an orthonormal basis of that space.

Lemma. If f is integrable on [−π, π], and f is orthogonal to each of the functions

1

√2𝜋,

1

√𝜋𝑐𝑜𝑠𝑥 ,

1

√𝜋𝑠𝑖𝑛𝑥 ,

1

√𝜋𝑐𝑜𝑠2 𝑥 ,

1

√𝜋𝑠𝑖𝑛2 𝑥 ,….

then f(x) = 0 almost everywhere in [−π, π].

So we can write any function defined in

AS

𝑓 (𝑥 )=𝑎0+∑𝑛=1

𝑎𝑛cos (𝑛𝑥 )+∑𝑛=1

𝑏𝑛sin (𝑛𝑥)

⟨ 𝑓 ,𝑔⟩=∫−𝜋

𝜋

𝑓 (𝑥 )𝑔 (𝑥 )𝑑𝑥

Inner Product of

𝑓 (𝑥 )= ⟨ 𝑓 (𝑥) ,1 ⟩⟨1,1 ⟩

1+∑𝑛=1

∞ ⟨ 𝑓 (𝑥) ,cos (𝑛𝑥) ⟩⟨cos (𝑛𝑥 ) ,cos (𝑛𝑥) ⟩

cos (𝑛𝑥)+∑𝑛=1

∞ ⟨ 𝑓 (𝑥) , sin (𝑛𝑥 )⟩⟨sin (𝑛𝑥 ), sin (𝑛𝑥 )⟩

sin (𝑛𝑥 )

So we can write any function defined in

AS

So𝑎0=

12𝜋 ∫

−𝜋

𝜋

𝑓 (𝑥 )𝑑𝑥

𝑎𝑛=1𝜋 ∫

−𝜋

𝜋

𝑓 (𝑥 )cos (𝑛𝑥 )𝑑𝑥

𝑏𝑛=1𝜋 ∫

−𝜋

𝜋

𝑓 (𝑥 )𝑠𝑖𝑛 (𝑛𝑥 )𝑑𝑥𝑛=1,2,3 ,……

Functions with a periodicity of (i.e: for all n) can be decomposed into contributions from and which are periodic on the period .

𝑓 (𝑥 )=𝑎0+∑𝑛=1

𝑎𝑛cos (𝑛𝜋 𝑥 /𝐿)+∑𝑛=1

𝑏𝑛sin (𝑛𝜋 𝑥 /𝐿)

Where

𝑎0=1

2𝐿∫−𝐿

𝐿

𝑓 (𝑥 )𝑑𝑥

𝑎𝑛=1𝐿 ∫

−𝐿

𝐿

𝑓 (𝑥 ) cos (𝑛𝜋 𝑥/𝐿)𝑑𝑥

𝑏𝑛=1𝐿∫

−𝐿

𝐿

𝑓 (𝑥 ) 𝑠𝑖𝑛 (𝑛𝜋 𝑥 /𝐿)𝑑𝑥

Functions of arbitrary periodicity

An equation with many faces

𝑓 (𝑥 )=𝑎0+∑𝑛=1

𝑎𝑛cos (𝑛𝑥 )+∑𝑛=1

𝑏𝑛sin (𝑛𝑥)

𝑓 (𝑥 )=𝑎0+∑𝑛=1

𝑎𝑛cos (2𝜋 𝑓𝑛𝑥 )+∑𝑛=1

𝑏𝑛sin (2𝜋 𝑓𝑛𝑥 )

𝑓 (𝑥 )=𝑎0+∑𝑛=1

𝑎𝑛cos (2𝜋𝑛𝑥 /𝑇 )+∑𝑛=1

𝑏𝑛sin (2𝜋𝑛𝑥 /𝑇 )

𝑓 (𝑥 )=𝑎0+∑𝑛=1

𝑎𝑛cos (𝑛𝑤𝑥 )+∑𝑛=1

𝑏𝑛sin (𝑛𝑤𝑥 )

𝑓 (𝑥 )=𝑎0+∑𝑛=1

𝑎𝑛cos (𝜋 𝑛𝑥 /𝐿)+∑𝑛=1

𝑏𝑛sin (𝜋 𝑛𝑥 /𝐿)

The Complex Fourier Series

𝑐0=𝑎0

𝑐𝑛=12(𝑎𝑛−𝑖𝑏𝑛)

𝑐−𝑛=12(𝑎𝑛+𝑖𝑏𝑛)

Let and be the Fourier coefficients of the function f(x) defined on [-L, L]. We introduce a new set of coefficients, viz. , where . These are given by

You are reminded of the following identities:

𝑎0=𝑐0

𝑎𝑛=(𝑐𝑛+𝑐−𝑛)𝑏𝑛=(𝑐𝑛− 𝑖𝑐−𝑛)

The Fourier series may then be expressed as

=

=

=

=

A new formula for the Fourier coefficients can be obtained as follows:

𝑐0=𝑎0=1

2𝐿∫−𝐿

𝐿

𝑓 (𝑥)𝑒0𝑑𝑥

and

The formula for the complex Fourier coefficients is therefore

for

++

Meaning of Coefficients

++

Examples of Signals and the Fourier Series Representation

3.69

Sawtooth Signal

𝒇 (𝒙 )=𝟐 𝑨𝝅

𝐬𝐢𝐧 (𝟐𝝅 𝒇𝒙 ) −𝟐 𝑨𝟐𝝅

𝒔𝒊𝒏 (𝟐𝝅 𝒇 𝟐 𝒙 )+𝟐𝑨𝟑𝝅

𝒔𝒊𝒏 (𝟐𝝅 𝒇 𝟑 𝒙 )−𝟐 𝑨𝟒𝝅

𝒔𝒊𝒏 (𝟐𝝅 𝒇 𝟓 𝒙 )+…

Application

If has period , its (complex) Fourier series expansion is

f ( x )= ∑𝑛=− ∞

𝑛=∞

𝑐𝑛𝑒𝑖𝑛 𝜋 𝑥𝐿

We now develop an expansion for non-periodic functions, by allowing complex exponentials (or equivalently sin’s and cos’s) of all possible periods, not just , for some fixed . So, from now on, do not assume that is periodic.

Fourier Series to Fourier Transform

�̂� (𝑤 )=∫−∞

𝑓 (𝑥)𝑒− 𝑖𝑤𝑥𝑑𝑥

Fourier Series to Fourier Transform

Where

Parseval's Theorem: Energy Relations in Time and Frequency

Now We have Finished

Mathematical Discussion

Start DFT and it’s application in Image

Processing

Discrete Fourier Transform1-D case

Discrete Fourier transform (1-D)

The Discrete Fourier Transform (DFT)2-D case

The Discrete Fourier Transform of f(x,y), for x = 0, 1, 2…M-1 and y = 0,1,2…N-1, denoted by F(u,v), is given by the equation:

for u = 0, 1, 2…M-1 and v = 0, 1, 2…N-1.

1

0

1

0

)//(2),(),(M

x

N

y

NvyMuxjeyxfvuF

The Inverse DFT

It is really important to note that the Fourier transform is completely reversible.

The inverse DFT is given by:

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

1

0

1

0

)//(2),(1

),(M

u

N

v

NvyMuxjevuFMN

yxf

Discrete Fourier transform (2-D)

Spatial Domain and Frequency Domain of an Image

Image data can be represented in either the spatial domain or the frequency domain. The frequency domain contains the same information as the spatial domain but in a vastly different form.

Useful for data compressionMore efficient for certain image operations

Spatial Domain

For each location in the image, what is the value of the light intensity at that location?

Spatial Domain

For each location in the image, what is the value of the light intensity at that location?

Frequency Domain

For each frequency component in the image, what is power or its amplitude?

Frequency Domain

For each frequency component in the image, what is power or its amplitude?

Image and it’s DFT

A frequential decomposition in terms of exponential basis images ...

Image Representation using basis

f

f

are the weighting coefficients of the spatial frequencies present in the signal.

Note: A picture having a size of is a linear combination of exponential basis images!!!!

Image Representation using basis

The DFT and Image Processing

Imag

es ta

ken

from

Gon

zale

z &

Woo

ds, D

igita

l Im

age

Proc

essi

ng (2

002)

DFT & Images

DFT

Scanning electron microscope image of an integrated circuit

magnified ~2500 times

Fourier spectrum of the image

Filter

Some Basic Frequency Domain Filters

Imag

es ta

ken

from

Gon

zale

z &

Woo

ds, D

igita

l Im

age

Proc

essi

ng (2

002) Low Pass Filter

High Pass Filter

Smoothing Frequency Domain Filters

Smoothing is achieved in the frequency domain by dropping out the high frequency componentsThe basic model for filtering is:

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

where F(u,v) is the Fourier transform of the image being filtered and H(u,v) is the filter transform functionLow pass filters – only pass the low frequencies, drop the high ones

Ideal Low Pass FilterSimply cut off all high frequency components that are a specified distance D0 from the origin of the transform

changing the distance changes the behaviour of the filter

Imag

es ta

ken

from

Gon

zale

z &

Woo

ds, D

igita

l Im

age

Proc

essi

ng (2

002)

Ideal Low Pass Filter (cont…)

The transfer function for the ideal low pass filter can be given as:

where D(u,v) is given as:

0

0

),( if 0

),( if 1),(

DvuD

DvuDvuH

2/122 ])2/()2/[(),( NvMuvuD

Ideal Low Pass Filter (cont…)

Above we show an image, it’s Fourier spectrum and a series of ideal low pass filters of radius 5, 15, 30, 80 and 230 superimposed on top of it

Imag

es ta

ken

from

Gon

zale

z &

Woo

ds, D

igita

l Im

age

Proc

essi

ng (2

002)

Ideal Low Pass Filter (cont…)

Imag

es ta

ken

from

Gon

zale

z &

Woo

ds, D

igita

l Im

age

Proc

essi

ng (2

002)

Originalimage

Result of filtering with ideal low pass filter of radius 5

Result of filtering with ideal low pass filter of radius 30

Result of filtering with ideal low pass filter of radius 230

Result of filtering with ideal low pass

filter of radius 80

Result of filtering with ideal low pass

filter of radius 15

Illustration

Butterworth Lowpass Filters

The transfer function of a Butterworth lowpass filter of order n with cutoff frequency at distance D0 from the origin is defined as:

Imag

es ta

ken

from

Gon

zale

z &

Woo

ds, D

igita

l Im

age

Proc

essi

ng (2

002)

nDvuDvuH

20 ]/),([1

1),(

Butterworth Lowpass Filter (cont…)

Imag

es ta

ken

from

Gon

zale

z &

Woo

ds, D

igita

l Im

age

Proc

essi

ng (2

002)

Originalimage

Result of filtering with Butterworth filter of order 2 and cutoff radius 5

Result of filtering with Butterworth filter of order 2 and cutoff radius 30

Result of filtering with Butterworth filter of order 2 and cutoff radius 230

Result of filtering with Butterworth filter of

order 2 and cutoff radius 80

Result of filtering with Butterworth filter of

order 2 and cutoff radius 15

Gaussian Lowpass Filters

The transfer function of a Gaussian lowpass filter is defined as:

Imag

es ta

ken

from

Gon

zale

z &

Woo

ds, D

igita

l Im

age

Proc

essi

ng (2

002)

20

2 2/),(),( DvuDevuH

Gaussian Lowpass Filters (cont…)

Imag

es ta

ken

from

Gon

zale

z &

Woo

ds, D

igita

l Im

age

Proc

essi

ng (2

002)

Originalimage

Result of filtering with Gaussian filter with cutoff radius 5

Result of filtering with Gaussian filter with cutoff radius 30

Result of filtering with Gaussian filter with cutoff radius 230

Result of filtering with Gaussian

filter with cutoff radius 85

Result of filtering with Gaussian

filter with cutoff radius 15

Lowpass Filters Compared

Result of filtering with ideal low pass

filter of radius 15

Result of filtering with Butterworth filter of order 2 and cutoff radius 15

Result of filtering with Gaussian

filter with cutoff radius 15

Imag

es ta

ken

from

Gon

zale

z &

Woo

ds, D

igita

l Im

age

Proc

essi

ng (2

002)

Lowpass Filtering Examples

A low pass Gaussian filter is used to connect broken text

Imag

es ta

ken

from

Gon

zale

z &

Woo

ds, D

igita

l Im

age

Proc

essi

ng (2

002)

Lowpass Filtering Examples (cont…)

Different lowpass Gaussian filters used to remove blemishes in a photograph

Imag

es ta

ken

from

Gon

zale

z &

Woo

ds, D

igita

l Im

age

Proc

essi

ng (2

002)

Sharpening in the Frequency Domain

Edges and fine detail in images are associated with high frequency components.

High pass filters – only pass the high frequencies, drop the low ones

High pass frequencies are precisely the reverse of low pass filters, so:

Hhp(u,v)=1–Hlp(u,v)

Ideal High Pass Filters

The ideal high pass filter is given as:

where D0 is the cut off distance as before

0

0

),( if 1

),( if 0),(

DvuD

DvuDvuH

Imag

es ta

ken

from

Gon

zale

z &

Woo

ds, D

igita

l Im

age

Proc

essi

ng (2

002)

Ideal High Pass Filters (cont…)

Results of ideal high pass filtering with

D0 = 15

Results of ideal high pass filtering with

D0 = 30

Results of ideal high pass filtering with

D0 = 80

Imag

es ta

ken

from

Gon

zale

z &

Woo

ds, D

igita

l Im

age

Proc

essi

ng (2

002)

Butterworth High Pass Filters

The Butterworth high pass filter is given as:

where n is the order and D0 is the cut off distance as before

nvuDDvuH

20 )],(/[1

1),(

Imag

es ta

ken

from

Gon

zale

z &

Woo

ds, D

igita

l Im

age

Proc

essi

ng (2

002)

Butterworth High Pass Filters (cont…)

Results of Butterworth

high pass filtering of

order 2 with D0 = 15

Results of Butterworth high pass filtering of order 2 with D0 = 80

Results of Butterworth high pass filtering of order 2 with D0 = 30

Imag

es ta

ken

from

Gon

zale

z &

Woo

ds, D

igita

l Im

age

Proc

essi

ng (2

002)

Gaussian High Pass Filters

The Gaussian high pass filter is given as:

where D0 is the cut off distance as before

20

2 2/),(1),( DvuDevuH

Imag

es ta

ken

from

Gon

zale

z &

Woo

ds, D

igita

l Im

age

Proc

essi

ng (2

002)

Gaussian High Pass Filters (cont…)

Results of Gaussian high pass

filtering with D0 = 15

Results of Gaussian high pass filtering with D0 = 80

Results of Gaussian high pass filtering with D0 = 30

Imag

es ta

ken

from

Gon

zale

z &

Woo

ds, D

igita

l Im

age

Proc

essi

ng (2

002)

Highpass Filter Comparison

Results of ideal high pass filtering with

D0 = 15

Results of Gaussian high pass filtering with D0 =

15

Results of Butterworth high pass filtering of order

2 with D0 = 15

Imag

es ta

ken

from

Gon

zale

z &

Woo

ds, D

igita

l Im

age

Proc

essi

ng (2

002)

Highpass Filtering ExampleO

rigin

al im

age

Highpass filtering result

Hig

h fr

eque

ncy

emph

asis

resu

lt After histogram

equalisation

Imag

es ta

ken

from

Gon

zale

z &

Woo

ds, D

igita

l Im

age

Proc

essi

ng (2

002)

Band Reject Filters

The ideal band reject filter is shown below, along with Butterworth and Gaussian versions of the filter

Imag

es ta

ken

from

Gon

zale

z &

Woo

ds, D

igita

l Im

age

Proc

essi

ng (2

002)

Ideal BandReject Filter

ButterworthBand Reject

Filter

GaussianBand Reject

Filter

Band Reject Filter Example

Imag

es ta

ken

from

Gon

zale

z &

Woo

ds, D

igita

l Im

age

Proc

essi

ng (2

002) Image corrupted by

sinusoidal noiseFourier spectrum of

corrupted image

Butterworth band reject filter

Filtered image

Magnitude and Phase of DFT

• What is more important?

• Hint: use inverse DFT to reconstruct the image using magnitude or phase only information

magnitude phase

Magnitude and Phase of DFT (cont’d)

Reconstructed image using

magnitude only

(i.e., magnitude determines the

contribution of each component!)

Reconstructed image using

phase only

(i.e., phase determines

which components are present!)

Another example: amplitude vs. phase

Thank You

Recommended