Lecture 4 Filtering in the Frequency Domain Lin ZHANG, PhD School - - PowerPoint PPT Presentation

lecture 4 filtering in the frequency domain
SMART_READER_LITE
LIVE PREVIEW

Lecture 4 Filtering in the Frequency Domain Lin ZHANG, PhD School - - PowerPoint PPT Presentation

Lecture 4 Filtering in the Frequency Domain Lin ZHANG, PhD School of Software Engineering Tongji University Spring 2016 Lin ZHANG, SSE, 2016 Outline Background From Fourier series to Fourier transform Properties of the Fourier


slide-1
SLIDE 1

Lin ZHANG, SSE, 2016

Lecture 4 Filtering in the Frequency Domain

Lin ZHANG, PhD School of Software Engineering Tongji University Spring 2016

slide-2
SLIDE 2

Lin ZHANG, SSE, 2016

Outline

  • Background
  • From Fourier series to Fourier transform
  • Properties of the Fourier transform
  • Discrete Fourier transforms
  • The basics of filtering in the frequency domain
  • Image smoothing using frequency domain filters
  • Image sharpening using frequency domain filters
slide-3
SLIDE 3

Lin ZHANG, SSE, 2016

Background

  • Fourier analysis (Fourier series and Fourier

transforms) is quite useful in many engineering fields

  • Linear image filtering can be performed in the

frequency domain

  • A working knowledge of the Fourier analysis can help

us have a thorough understanding of the image filtering

slide-4
SLIDE 4

Lin ZHANG, SSE, 2016

Background

  • Jean Baptiste Joseph Fourier was born in 1768, in

France

  • 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”

21 March 1768 – 16 May 1830

slide-5
SLIDE 5

Lin ZHANG, SSE, 2016

Outline

  • Background
  • From Fourier series to Fourier transform
  • Properties of the Fourier transform
  • Discrete Fourier transforms
  • The basics of filtering in the frequency domain
  • Image smoothing using frequency domain filters
  • Image sharpening using frequency domain filters
slide-6
SLIDE 6

Lin ZHANG, SSE, 2016

Fourier Series

  • For any periodic function f(t), how to extract the

component of f at a specific frequency?

is composed of the following components

slide-7
SLIDE 7

Lin ZHANG, SSE, 2016

Fourier Series

  • For any periodic function f(t), how to extract the

component of f at a specific frequency?

slide-8
SLIDE 8

Lin ZHANG, SSE, 2016

Fourier Series

  • For any periodic function f(t), how to extract the

component of f at a specific frequency?

slide-9
SLIDE 9

Lin ZHANG, SSE, 2016

Fourier Series

Fourier Series Any periodic function can be expressed as a sum of sines and cosines of different frequencies each multiplied by a different coefficient

 

1

( ) cos sin 2

n n n

a f t a n t b n t  

 

  

more details

  • For any periodic function f(t), how to extract the

component of f at a specific frequency?

slide-10
SLIDE 10

Lin ZHANG, SSE, 2016

Fourier Series

For a periodic function , with period T

( ) f t

Fourier Series

 

1

( ) cos sin 2

n n n

a f t a n t b n t  

 

  

where

2 2 2 2

2 2 ( )cos 2 ( )sin

T T n T T n

T a f t n tdt T b f t n tdt T    

 

  

 

2 2

2 ( )

T T

a f t dt T

 

, Redundant!

slide-11
SLIDE 11

Lin ZHANG, SSE, 2016

Fourier Transforms

2

( ) ( )

j t

F f t e dt



  

  Fourier transform of f(t) (maybe is not periodic) is defined as Inverse Fourier transform

2

( ) ( )

j t

f t F e d



 

 

  How to get these formulas? Let’s start the story from Fourier series to Fourier transform…

slide-12
SLIDE 12

Lin ZHANG, SSE, 2016

From Fourier Series to Fourier Transforms

According to Euler formula

cos sin

j

e j

   

Easy to have

cos ,sin 2 2

jn t jn t jn t jn t

e e e e n t n t j

   

 

 

    

Then, Fourier series become

 

1

( ) cos sin 2

n n n

a f t a n t b n t  

 

  

slide-13
SLIDE 13

Lin ZHANG, SSE, 2016

From Fourier Series to Fourier Transforms

According to Euler formula Easy to have

cos ,sin 2 2

jn t jn t jn t jn t

e e e e n t n t j

   

 

 

    

Then, Fourier series become

1 1

( ) 2 2 2 2 2 2

jn t jn t jn t jn t n n n jn t jn t n n n n n

a e e e e f t a jb a a jb a jb e e

            

                     

 

Then, let

, , 2 2 2

n n n n n n

a a jb a jb c c d     

 

1

( ) (1)

jn t jn t n n n

f t c c e d e

    

  

Then,

cos sin

j

e j

   

slide-14
SLIDE 14

Lin ZHANG, SSE, 2016

From Fourier Series to Fourier Transforms

   

2 2 2 2 2 2 2 2 2 2

1 ( ) , 1 1 ( ) cos sin ( ) (2) 1 1 ( ) cos sin ( )

T T T T jn t T T n T T jn t T T n

c f t dt T c f t n t j n t dt f t e dt T T d f t n t j n t dt f t e dt T T

 

   

     

      

    

We can see that

n n

d c 

Thus,

1 1 1

(3)

jn t jn t jn t n n n n n n

d e c e c e

           

 

  

slide-15
SLIDE 15

Lin ZHANG, SSE, 2016

From Fourier Series to Fourier Transforms

 

1 1 1 1 1

( ) (according to (1)) (according to (3))

jn t jn t n n n j t jn t jn t n n n n j t jn t jn t n n n n jn t n n

f t c c e d e c e c e d e c e c e c e c e

                      

         

     

,where is defined by (2)

n

c

This is the Fourier series in complex form How about a non-periodic function?

slide-16
SLIDE 16

Lin ZHANG, SSE, 2016

From Fourier Series to Fourier Transforms

( ) f t

is a non‐periodic function

( ) ( ), [ / 2, / 2]

T

f t f t if t T T   

We make a new function which is periodic and the period is T

( )

T

f t

If , becomes

T   ( )

T

f t

( ) f t

According to Fourier series

2 2

1 ( ) , ( )

T jn t jn t T T n n T n

f t c e c f t e dt T

     

 

 

Let

n

s n 

2 2 2 2

1 1 ( ) ( ) ( )

n n n n

T T js t js t js t js t T T T T T n n

f t f t e dt e f t e dt e T T

       

             

   

slide-17
SLIDE 17

Lin ZHANG, SSE, 2016

From Fourier Series to Fourier Transforms

2 2

1 ( ) ( )

n n

T js t js t T T T n

f t f t e dt e T

   

      

 

when T  

2 2

1 ( ) lim ( ) lim ( )

n n

T js t js t T T T T T n

f t f t f t e dt e T

     

       

 

1

2

n n

s s s T  

     2 T s   

2 2 2 2

( ) lim ( ) 2 1 lim ( ) 2

n n n n

T js t js t T T s n T js t js t T T s n

s f t f t e dt e f t e dt e s  

           

               

   

slide-18
SLIDE 18

Lin ZHANG, SSE, 2016

From Fourier Series to Fourier Transforms

2 2

1 ( ) lim ( ) 2

n n

T js t js t T T s n

f t f t e dt e s 

     

       

 

when

( 0) T s    

n

s s  s ds

, , 

 

1 ( ) ( ) 2

jst jst

f t f t e dt e ds 

    

 

( ) F s ( ) ( ) 1 ( ) ( ) 2

jst jst

F s f t e dt f t F s e ds 

    

      

 

Denote by Fourier transform Inverse Fourier transform

slide-19
SLIDE 19

Lin ZHANG, SSE, 2016

From Fourier Series to Fourier Transforms ( ) ( ) 1 ( ) ( ) 2

jst jst

F s f t e dt f t F s e ds 

    

      

 

s here actually is the angular frequency In the signal processing domain, we usually use another form by substituting s by , where is the frequency (measured by Herz)

2 s   

2 2

( ) ( ) ( ) ( )

j t j t

F f t e dt f t F e d

 

  

    

      

 

slide-20
SLIDE 20

Lin ZHANG, SSE, 2016

  • Fourier transform is complex in general

Related Concepts to Fourier Transform

( ) ( )cos(2 ) ( )sin(2 ) ( ) ( ) F f t t dt j f t t dt R jI     

   

   

 

( ) F 

( )

( ) ( )

j

F F e      where

2 2 1/2

( ) ( ) ( ( ) ( )) , ( ) atan 2 ( ) I F R I u R          In polar form, it can be expressed as Fourier Spectrum Phase Angle

2 2 2

( ) ( ) ( ) ( ) P F R I        is called the power spectrum

slide-21
SLIDE 21

Lin ZHANG, SSE, 2016

Related Concepts to Fourier Transform

Implementation Tips 1) For computing the image’s Fourier transform, you can use fft2() 2) ifft2() can compute the inverse Fourier transform 3) abs() can compute the Fourier spectrum 4) angle() can compute the phase angle

slide-22
SLIDE 22

Lin ZHANG, SSE, 2016

Outline

  • Background
  • From Fourier series to Fourier transform
  • Properties of the Fourier transform
  • Discrete Fourier transforms
  • The basics of filtering in the frequency domain
  • Image smoothing using frequency domain filters
  • Image sharpening using frequency domain filters
slide-23
SLIDE 23

Lin ZHANG, SSE, 2016

Symmetry Properties of the Fourier Transform

Real f(t) Fourier transform

( ) F 

Symmetry of general complex conjugate symmetric 

*

( ) ( ) F F    

( ) F 

even

  • dd
  • nly real
  • nly imaginary

even

  • dd

 

( ) ( ) f t f t  

 

( ) ( ) f t f t   

 

( ) ( ) F F    

 

( ) ( ) F F     

Proof?

slide-24
SLIDE 24

Lin ZHANG, SSE, 2016

Impulse Function

  • Impulse (Dirac) function
  • Considered as an infinitely high, infinitely thin spike at the
  • rigin, with total area one under the spike
  • It physically represents an idealized point mass or point

charge Paul Adrien Maurice Dirac (Aug. 08, 1902—Oct. 20, 1984)

slide-25
SLIDE 25

Lin ZHANG, SSE, 2016

Impulse Function

  • Impulse (Dirac) function

( ) 0, ( ) 1 t t t dt  

 

        Definition 1: Definition 2: ( ) ( ) (0) f t t dt f 

 

Sift property: ( ) ( ) ( ) f t t t dt f t 

 

 

f(t) ( ) t  t0 t Cannot be computed using normal integral methods!

slide-26
SLIDE 26

Lin ZHANG, SSE, 2016

Impulse Function

  • Impulse (Dirac) function

The Dirac delta function can be seen as the limit of the sequence of zero‐centered normal distributions

2 2

1 ( ) lim

x a a

x e a  

 

slide-27
SLIDE 27

Lin ZHANG, SSE, 2016

Impulse Function

  • The Fourier transform of function

 

 

( ) 1 t   

Proof:

 

2 2 2

= ( ) | 1

j t j t j t

F t e dt e e

  

 

     

  

Similarly, we have

 

2

( )

j t

t t e



   Why?

slide-28
SLIDE 28

Lin ZHANG, SSE, 2016

Fourier Transform of f(t) = 1

  • The Fourier transform of the function 1 is

   

1    

Proof:

2 2

( ) ( ) | 1

  

  

  

   

j t j t

f t e d e

slide-29
SLIDE 29

Lin ZHANG, SSE, 2016

Fourier Transform of

  • The Fourier transform of the function is

 

2

jat

a e            

Proof:

 

2 2 2

= | 2

j t j t jat a

a f t e d e e

   

   

  

        

jat

e

jat

e

slide-30
SLIDE 30

Lin ZHANG, SSE, 2016

Fourier Transform of

  • The Fourier transform of the function is

 

2 2 sin 2 a a at j                       

Proof:

cos sin , cos sin

jat jat

e at j at e at j at

   

sinat sinat

sin 2

jat jat

e e at j

 

slide-31
SLIDE 31

Lin ZHANG, SSE, 2016

Fourier Transform of

  • The Fourier transform of the function is

 

2 2 sin 2 a a at j                       

Proof:

sinat sinat

 

2 2 2

( ) 2 1 2 2 2 2

jat jat j t jat j t jat j t

e e F e dt j e e dt e e dt j a a j

  

      

          

                   

  

slide-32
SLIDE 32

Lin ZHANG, SSE, 2016

Fourier Transform of

  • The Fourier transform of the function is

 

2 2 cos 2 a a at                       

cosat cosat

Can you work it

  • ut?
slide-33
SLIDE 33

Lin ZHANG, SSE, 2016

Why Study Fourier Transform?

  • Observe the image in the frequency domain; has some

related applications, e.g., de‐noising and phase‐based image matching; directly manipulating the image in the frequency domain

  • We can make use of Fourier transform to compute the

convolution efficiently; thanks to FFT

The underlying theory is the convolution theorem!

slide-34
SLIDE 34

Lin ZHANG, SSE, 2016

Convolution Theorem

  • Still remember the convolution? (Lecture 3)

For 1D continuous case, it is defined as

( )* ( ) ( ) ( ) f t h t f h t d   

 

 

  • Convolution theorem
  • The Fourier transform of a convolution is the point‐wise

product of Fourier transforms

 

( ) ( ), ( ( )) ( ) f t F h t H       if then

 

( )* ( ) ( ) ( ) f t h t F H      Proof:

slide-35
SLIDE 35

Lin ZHANG, SSE, 2016

Convolution Theorem  

       

2 2 2 ( ) 2 2 2 2

( )* ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( )

j t j t j x j x j j j

f t h t f h t d e dt f h t e dt d f h x e dx d f h x e dx e d f H e d H f e d H F

       

                 

                           

        

         

 (Let ) x t   

slide-36
SLIDE 36

Lin ZHANG, SSE, 2016

Revisit Gaussian Filter

In spatial domain

2 2 2 2

1 ( , ) exp 2 2 x y G x y           

In frequency domain

2 2 2 2 2 2

( ) ( ) ( , ) exp exp 2 1 2 u v u v u v                                 

The Fourier transform of a Gaussian function is also of a Gaussian shape in the frequency domain

slide-37
SLIDE 37

Lin ZHANG, SSE, 2016

Revisit Gaussian Filter

Gaussian filter is a low‐pass filter Consider the 1D case

( ) f x if filtered by

2 2

1 ( ) exp 2 2 x g x          

What will happen to the frequency components of f(x) ?

 

2 2

( )* ( ) ( ) ( ) ( ) exp 1 2 ( ) FT f x g x F G F F                               

  • 4
  • 2

2 4 0.2 0.4 0.6 0.8 1

w magnitude

slide-38
SLIDE 38

Lin ZHANG, SSE, 2016

Revisit Gaussian Filter

smoothed – original

  • riginal

smoothed (5x5 Gaussian) Why does this work?

slide-39
SLIDE 39

Lin ZHANG, SSE, 2016

Outline

  • Background
  • From Fourier series to Fourier transform
  • Properties of the Fourier transform
  • Discrete Fourier transforms
  • The basics of filtering in the frequency domain
  • Image smoothing using frequency domain filters
  • Image sharpening using frequency domain filters
slide-40
SLIDE 40

Lin ZHANG, SSE, 2016

Discrete Fourier Transform (DFT) in 1D Case

Given a discrete sequence with M points Regard it as a periodic signal, thus its basis frequency is For its frequency components, the frequencies are,

1 1

[ , ...., ]

M

f f f f

1 M

 

1 2 1 , ,... 1,2,..., M M M M M M 

1 1 2

( ) ( ) , 1,2,...,

M j ux M x

F u f x e u M

   

 

Its DFT is computed as Usually, we write it as,

1 1 2

( ) ( ) , 0,1,2,..., 1

M j ux M x

F u f x e u M

   

  

slide-41
SLIDE 41

Lin ZHANG, SSE, 2016

Discrete Fourier Transform (DFT) in 1D Case

Thus, f’s DFT also has M points and

1 1

[ , ...., ]

M

F F F F

1 2 /

( ) ( ) , 0,1,2,..., 1

M j ux M x

F u f x e u M

   

  

For DFT, there is a fast algorithm for computation, FFT (Fast Fourier Transform)

1 2 /

1 ( ) ( ) , 0,1,2,..., 1

M j ux M u

f x F u e x M M

  

  

IDFT

slide-42
SLIDE 42

Lin ZHANG, SSE, 2016

Discrete Fourier Transform (DFT) in 2D Case

1 1 2 ( / / )

( , ) ( , ) , 0,1,..., 1; 0,1,..., 1

M N j ux M vy N x y

F u v f x y e where u M v N

      

    



2 ( ) 2 ( )

( , ) ( , ) ( , ) ( , )

j ux vy j ux vy

F u v f x y e dxdy f x y F u v e dudv

            

 

   

In continuous case In discrete case

1 1 2 ( / / )

1 ( , ) ( , ) , 0,1,..., 1; 0,1,..., 1

M N j ux M vy N u v

f x y F u v e MN where x M y N

     

    



slide-43
SLIDE 43

Lin ZHANG, SSE, 2016

Some Notes on DFT Visualization

  • For DFT, the origin is not at the center of the matrix
  • Assume the original spectrum is divided into four quadrants;

the small gray‐filled squares in the corners represent positions of low frequencies

  • Due to the symmetries of the spectrum the quadrant

positions can be swapped diagonally and the low frequencies locations appear in the middle of the image

  • riginal spectrum

low frequencies in corners shifted spectrum with the origin at (M/2, N/2)

slide-44
SLIDE 44

Lin ZHANG, SSE, 2016

Some Notes on DFT Visualization

l h h h l l l h

slide-45
SLIDE 45

Lin ZHANG, SSE, 2016

Some Notes on DFT Visualization

  • For visualization, we usually rearrange the DFT matrix

to make its low frequencies at the center of the rectangle; it equals to

( , )( 1)x y f x y

 ( , )( 1) ( / 2, / 2)

x y

f x y F u M v N

   

Implementation Tips In Matlab, it can simply implemented by using fftshift

slide-46
SLIDE 46

Lin ZHANG, SSE, 2016

DFT Visualization Samples

  • Since each field of the Fourier transform is a complex

number, we cannot show Fourier map in a single figure; instead, magnitude and phase maps are shown separately

im = imread('im.bmp'); figure; imshow(im,[]); imfft = abs(fft2(im)); imfftlog = log10(1+imfft); figure; imshow(imfftlog,[]); imfftshifted = fftshift(imfftlog); figure; imshow(imfftshifted,[]);

slide-47
SLIDE 47

Lin ZHANG, SSE, 2016

DFT Visualization Samples

  • An example

Original image Spectrum without using fftshift Spectrum using fftshift

slide-48
SLIDE 48

Lin ZHANG, SSE, 2016

DFT Visualization Samples

DFT DFT Any relationship?

slide-49
SLIDE 49

Lin ZHANG, SSE, 2016

Outline

  • Background
  • From Fourier series to Fourier transform
  • Properties of the Fourier transform
  • Discrete Fourier transforms
  • The basics of filtering in the frequency domain
  • Image smoothing using frequency domain filters
  • Image sharpening using frequency domain filters
slide-50
SLIDE 50

Lin ZHANG, SSE, 2016

The Basics of Filtering in the Frequency Domain

To filter an image in the frequency domain:

1. Compute F(u,v), the DFT of the image 2. Multiply F(u,v) by a filter function H(u,v) 3. Compute the inverse DFT of the result

slide-51
SLIDE 51

Lin ZHANG, SSE, 2016

Directly Filtering in the Frequency Domain

1. Given an image f(x, y) of size , set P = 2M and Q = 2N 2. Form a padded image, of size by appending the necessary number of zeros to f(x, y) 3. Multiply by to center its transform 4. Compute F(u, v) of 5. Generate a filter function H(u, v) of the size 6. Get the modified Fourier transform 7. Obtain the processed image 8. Obtain the final result g(x, y) by extracting the region from the top, left corner of M N  ( , )

p

f x y

P Q 

( 1)x y

( , )

p

f x y

( , )

p

f x y P Q  ( , ) ( , ) ( , ) G u v F u v H u v 

1

( , ) ( ( , ))( 1)x y

p

g x y G u v

 

   ( , )

p

g x y

M N 

slide-52
SLIDE 52

Lin ZHANG, SSE, 2016

Directly Filtering in the Frequency Domain—Example

( , ) f x y ( , )

p

f x y ( , ) F u v ( , ) H u v ( , )

p

g x y ( , ) g x y

Source codes are available on our course website

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

slide-53
SLIDE 53

Lin ZHANG, SSE, 2016

Convolution via Fourier Transform

1. Given an image f(x, y) of size , and a spatial filter h(x, y)

  • f size ; set P >= A+C-1 and Q >=B+D-1

2. Form a padded image of size by appending the necessary number of zeros to f(x, y); form a padded filter

  • f size in a similar way

3. Compute the DFT F(u, v) of the image, and H(u, v) of the filter 4. Get the modified Fourier transform 5. Obtain the processed image 6. Obtain the final result g(x, y) by extracting the central region from A B 

p

f

P Q  ( , ) ( , ) ( , ) G u v F u v H u v 

1

( , ) ( ( , ))

p

g x y G u v

  ( , )

p

g x y

A B  C D 

p

h

P Q 

slide-54
SLIDE 54

Lin ZHANG, SSE, 2016

Convolution via Fourier Transform—Example

( , ) f x y ( , )

p

f x y ( , ) h x y ( , ) G u v ( , )

p

h x y ( , ) F u v ( , ) H u v ( , )

p

g x y

( , ) g x y Source codes are available on our course website

slide-55
SLIDE 55

Lin ZHANG, SSE, 2016

Some Tips on Filtering via Fourier Transform

  • When the filter kernel is small, it’s better to implement

the filtering in the spatial domain; otherwise, you can realize the filtering via the Fourier transform

  • In practice, when padding the images or filters, it’s

better to make it has a size which is the power of 2; this criterion is based on the computer architecture

slide-56
SLIDE 56

Lin ZHANG, SSE, 2016

Outline

  • Background
  • From Fourier series to Fourier transform
  • Properties of the Fourier transform
  • Discrete Fourier transforms
  • The basics of filtering in the frequency domain
  • Image smoothing using frequency domain filters
  • Image sharpening using frequency domain filters
slide-57
SLIDE 57

Lin ZHANG, SSE, 2016

Smoothing is Low‐Pass Filtering

  • Image smoothing actually is performing a low‐pass

filtering to the image

  • Edges and other sharp intensity transitions, such as

noise, in an image contribute significantly to the high frequency content of its Fourier transform

  • Three commonly used low‐pass filtering techniques
  • Ideal low‐pass filters
  • Butterworth low‐pass filters
  • Gaussian low‐pass filters
slide-58
SLIDE 58

Lin ZHANG, SSE, 2016

Ideal Low‐Pass Filter

  • Simply cut off all high frequency components that are

within a specified distance D0 from the origin of the transform

  • Its drawback is that the filtering result has obvious ringing

artifacts

  • Ideal low‐pass filter is rarely used in practice
slide-59
SLIDE 59

Lin ZHANG, SSE, 2016

The transfer function for the ideal low pass filter can be given as: where D(u,v) is the distance of (u, v) to the frequency centre (0, 0) and it is given as:

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

2 2 1/2

( , ) [ ] D u v u v  

Ideal Low‐Pass Filter

slide-60
SLIDE 60

Lin ZHANG, SSE, 2016

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

Ideal Low‐Pass Filter

slide-61
SLIDE 61

Lin ZHANG, SSE, 2016 Original image 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

Ideal Low‐Pass Filter

slide-62
SLIDE 62

Lin ZHANG, SSE, 2016

Butterworth Low‐pass Filters

  • It was proposed by the British engineer Stephen

Butterworth

  • Filter order can change the shape of the Butterworth

filter; for high order values, the Butterworth filter approaches the ideal filter; for low order values, it approaches the Gaussian filter

slide-63
SLIDE 63

Lin ZHANG, SSE, 2016

Butterworth Low‐pass Filters

n

D v u D v u H

2 0]

/ ) , ( [ 1 1 ) , (  

  • The transfer function of a Butterworth low‐pass filter
  • f order n with cutoff frequency at distance D0 from

the origin is defined as:

slide-64
SLIDE 64

Lin ZHANG, SSE, 2016 Original image 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

Butterworth Low‐pass Filters

slide-65
SLIDE 65

Lin ZHANG, SSE, 2016

Butterworth Low‐pass Filters

Original image Filtering result of Butterworth

Source codes are available on course website

slide-66
SLIDE 66

Lin ZHANG, SSE, 2016

Gaussian Low‐pass Filters

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

2 2

2 / ) , (

) , (

D v u D

e v u H

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

slide-67
SLIDE 67

Lin ZHANG, SSE, 2016

Gaussian Lowpass Filters

Original image 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

slide-68
SLIDE 68

Lin ZHANG, SSE, 2016

Low‐pass Filtering Examples

A low pass Gaussian filter is used to connect broken text

slide-69
SLIDE 69

Lin ZHANG, SSE, 2016

Low‐pass Filtering Examples

Gaussian filters used to remove blemishes in a photograph for publishing

slide-70
SLIDE 70

Lin ZHANG, SSE, 2016

Outline

  • Background
  • From Fourier series to Fourier transform
  • Properties of the Fourier transform
  • Discrete Fourier transforms
  • The basics of filtering in the frequency domain
  • Image smoothing using frequency domain filters
  • Image sharpening using frequency domain filters
slide-71
SLIDE 71

Lin ZHANG, SSE, 2016

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 filters are precisely the reverse of low pass

filters, so, 1 ( , )  

HP LP

H H u v

slide-72
SLIDE 72

Lin ZHANG, SSE, 2016

Ideal High‐Pass Filters

The ideal high pass filter is given as: where D0 is the cut off distance as before

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

slide-73
SLIDE 73

Lin ZHANG, SSE, 2016 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

Ideal High‐Pass Filters

slide-74
SLIDE 74

Lin ZHANG, SSE, 2016

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

n

v u D D v u H

2

)] , ( / [ 1 1 ) , (  

slide-75
SLIDE 75

Lin ZHANG, SSE, 2016 Results of Butterworth high pass filtering of

  • rder 2 with

D0 = 15 Results of Butterworth high pass filtering of

  • rder 2 with

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

Butterworth High Pass Filters

slide-76
SLIDE 76

Lin ZHANG, SSE, 2016

Original image Filtering result of Butterworth high‐pass filtering

Source codes are available on course website

Butterworth High Pass Filters

slide-77
SLIDE 77

Lin ZHANG, SSE, 2016

Gaussian High Pass Filters

The Gaussian high pass filter is given as: where D0 is the cut off distance as before

2 2

2 / ) , (

1 ) , (

D v u D

e v u H

 

slide-78
SLIDE 78

Lin ZHANG, SSE, 2016 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

Gaussian High Pass Filters

slide-79
SLIDE 79

Lin ZHANG, SSE, 2016

Highpass Filter Comparison

Results of ideal high pass filtering with D0 = 15

slide-80
SLIDE 80

Lin ZHANG, SSE, 2016

Highpass Filter Comparison

Results of Butterworth high pass filtering of

  • rder 2 with D0 = 15
slide-81
SLIDE 81

Lin ZHANG, SSE, 2016

Highpass Filter Comparison

Results of Gaussian high pass filtering with D0 = 15

slide-82
SLIDE 82

Lin ZHANG, SSE, 2016

Fast Fourier Transform

  • The reason that Fourier based techniques have

become so popular is the development of the Fast Fourier Transform (FFT) algorithm

  • Allows the Fourier transform to be carried out in a

reasonable amount of time

  • Reduces the amount of time required to perform a

Fourier transform by a factor of 100 – 600 times!

slide-83
SLIDE 83

Lin ZHANG, SSE, 2016

Fourier Domain Filtering & Spatial Domain Filtering

  • 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

slide-84
SLIDE 84

Lin ZHANG, SSE, 2016

Summary

In this lecture we examined image filtering in the frequency domain

  • Background
  • From Fourier series to Fourier transform
  • Properties of the Fourier transform
  • Discrete Fourier transforms
  • The basics of filtering in the frequency domain
  • Image smoothing using frequency domain filters
  • Image sharpening using frequency domain filters
slide-85
SLIDE 85

Lin ZHANG, SSE, 2016

Thanks for your attention