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

Lecture 4

This document discusses convolution and Fourier convolution. It begins by defining the instrument response function and point spread function, and how they relate to the imaging model. It then describes convolution integrals and proves the convolution theorem - that convolution in real space is equivalent to multiplication in Fourier space. It provides examples of convolutions and Fourier filtering, explaining how manipulating the Fourier transform of an image allows changing its information content.

Uploaded by

nctgayaranga
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
87 views

Lecture 4

This document discusses convolution and Fourier convolution. It begins by defining the instrument response function and point spread function, and how they relate to the imaging model. It then describes convolution integrals and proves the convolution theorem - that convolution in real space is equivalent to multiplication in Fourier space. It provides examples of convolutions and Fourier filtering, explaining how manipulating the Fourier transform of an image allows changing its information content.

Uploaded by

nctgayaranga
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 36

Convolution

Fourier Convolution

Outline
 Review linear imaging model
 Instrument response function vs Point spread function
 Convolution integrals
• Fourier Convolution
• Reciprocal space and the Modulation transfer function
 Optical transfer function
 Examples of convolutions
 Fourier filtering
 Deconvolution
 Example from imaging lab
• Optimal inverse filters and noise

22.058 - lecture 4, Convolution and Fourier Convolution


Instrument Response Function
The Instrument Response Function is a conditional mapping, the form of the map
depends on the point that is being mapped.

IRF(x, y | x0 , y0 )  S (x  x0 ) (y  y0 )

This is often given the symbol h(r|r’).

Of course we want the entire output from the whole object function,
 
E(x, y)    I(x, y)S (x  x0 ) (y  y0 )dxdydx0dy0
 
 
E(x, y)    I(x, y)IRF(x, y | x0 , y0 )dxdydx0 dy0
 
and so we need to know the IRF at all points.

22.058 - lecture 4, Convolution and Fourier Convolution


Space Invariance

Now in addition to every point being mapped independently onto the detector,
imaging that the form of the mapping does not vary over space (is independent of
r0). Such a mapping is called isoplantic. For this case the instrument response
function is not conditional.
IRF(x, y | x0 , y0 )  PSF(x  x0 , y  y0 )

The Point Spread Function (PSF) is a spatially invariant approximation of the IRF.

22.058 - lecture 4, Convolution and Fourier Convolution


Space Invariance
Since the Point Spread Function describes the same blurring over the entire sample,
IRF(x, y | x0 , y0 )  PSF(x  x0 , y  y0 )

The image may be described as a convolution,


E(x, y)   I (x0 , y0 )PSF(x  x0 , y  y0 )dx0 dy0

or,

Image(x, y)  Object(x, y)  PSF(x, y) noise

22.058 - lecture 4, Convolution and Fourier Convolution


Convolution Integrals
Let’s look at some examples of convolution integrals,

f (x)  g(x)  h(x)   g(x')h(x  x' )dx'

So there are four steps in calculating a convolution integral:

#1. Fold h(x’) about the line x’=0


#2. Displace h(x’) by x
#3. Multiply h(x-x’) * g(x’)
#4. Integrate

22.058 - lecture 4, Convolution and Fourier Convolution


Convolution Integrals
Consider the following two functions:

#1. Fold h(x’) about the line x’=0

#2. Displace h(x’) by x x

22.058 - lecture 4, Convolution and Fourier Convolution


Convolution Integrals

22.058 - lecture 4, Convolution and Fourier Convolution


Convolution Integrals
Consider the following two functions:

22.058 - lecture 4, Convolution and Fourier Convolution


Convolution Integrals

22.058 - lecture 4, Convolution and Fourier Convolution


Some Properties of the Convolution
commutative:

f gg f

associative:
f  (g  h)  ( f  g)  h

multiple convolutions can be carried out in any order.


distributive:

f  (g  h)  f  g  f  h

22.058 - lecture 4, Convolution and Fourier Convolution


Convolution Integral

Recall that we defined the convolution integral as,



f g  f (x)g(x'x)dx


One of the most central results of Fourier Theory is the convolution


theorem (also called the Wiener-Khitchine theorem.

 f  g  F(k) G(k)

where,
f (x)  F(k)
g(x)  G(k)

22.058 - lecture 4, Convolution and Fourier Convolution


Convolution Theorem

 f  g  F(k) G(k)

In other words, convolution in real space is equivalent to


multiplication in reciprocal space.

22.058 - lecture 4, Convolution and Fourier Convolution


Convolution Integral Example

We saw previously that the convolution of two top-hat functions


(with the same widths) is a triangle function. Given this, what is
the Fourier transform of the triangle function?

?
15 15

10 10

5 5

-3 -2 -1 1 2 3 -3 -2 -1 1 2 3

22.058 - lecture 4, Convolution and Fourier Convolution


Proof of the Convolution Theorem


f g  f (x)g(x'x)dx

The inverse FT of f(x) is,
1 
f (x)   F(k)eikx dk
2 

and the FT of the shifted g(x), that is g(x’-x)

1 
g(x'x)   G(k' )eik'(x'x )dk'
2 

22.058 - lecture 4, Convolution and Fourier Convolution


Proof of the Convolution Theorem
So we can rewrite the convolution integral,

f g  f (x)g(x'x)dx

as,
1   
f g  dx  F(k)eikx dk  G(k' )eik'( x' x )dk'
4 2   

change the order of integration and extract a delta function,

1  
ik'x' 1

f g  dkF(k)  dk'G(k')e  eix(k k')dx
2   2 
  
  (kk')

22.058 - lecture 4, Convolution and Fourier Convolution


Proof of the Convolution Theorem
1  
1 
f g  dkF(k)  dk'G(k')eik'x'  eix(k k')dx
2   2 
  
  (kk')

or,
1  
f g  dkF(k)  dk'G(k')eik'x' (k  k')
2  

Integration over the delta function selects out the k’=k value.
1 
f g  dkF(k)G(k)eikx'
2 

22.058 - lecture 4, Convolution and Fourier Convolution


Proof of the Convolution Theorem

1 
f g  dkF(k)G(k)eikx'
2 

This is written as an inverse Fourier transformation. A Fourier


transform of both sides yields the desired result.

 f  g  F(k) G(k)

22.058 - lecture 4, Convolution and Fourier Convolution


Fourier Convolution

22.058 - lecture 4, Convolution and Fourier Convolution


Reciprocal Space

real space reciprocal space

22.058 - lecture 4, Convolution and Fourier Convolution


Filtering

We can change the information content in the image by


manipulating the information in reciprocal space.

Weighting function in k-space.

22.058 - lecture 4, Convolution and Fourier Convolution


Filtering

We can also emphasis the high frequency components.

Weighting function in k-space.

22.058 - lecture 4, Convolution and Fourier Convolution


Modulation transfer function

i(x, y)  o(x, y)  PSF(x, y)  noise


   
I(k , k )  O(k x , k y ) MTF(kx , k y ) noise
 x y

 
E(x, y)    I(x, y)S (x  x0 ) (y  y0 )dxdydx0 dy0
 
 
E(x, y)    I(x, y)IRF(x, y | x0 , y0 )dxdydx0 dy0
 
22.058 - lecture 4, Convolution and Fourier Convolution
Optics with lens
‡ Input bit mapped image
sharp = Import @" sharp . bmp" D;

Shallow @InputForm @sharp DD

Graphics @Raster @<< 4>> D, Rule @<< 2>> DD

s = sharp @@1 , 1 DD;

Dimensions @s D

8480 , 640 <

ListDensityPlot @s , 8PlotRange ÆAll , Mesh ÆFalse <D

22.058 - lecture 4, Convolution and Fourier Convolution


Optics with lens
crop = Take @s , 8220 , 347 <, 864 , 572 , 4 <D;

‡ look at artifact in vertical dimension


rot = Transpose @crop D;
120
line = rot @@20 DD;
100
ListPlot @line , 8PlotRange ÆAll , PlotJoined ÆTrue <D

80 120

100
60
80

40 60

40
20

20 40 60 80 100 120
0
0 20 40 60 80 100 120 Ö Graphics Ö

22.058 - lecture 4, Convolution and Fourier Convolution


Optics with lens
120 ListPlot @RotateLeft @Abs @ftline D, 64 D, 8PlotJoined Æ

100 15

80 12.5

10
60
7.5
40
5

20 40 60 80 100 120 2.5

ü Fourier transform of vertical line to show modulation


20 40 60 80 100 120

ftline = Fourier @line D; Ö Graphics Ö


ListPlot @RotateLeft @Abs @ftline D, 64 D, 8PlotRange ÆAll , PlotJoined ÆTrue <D

1000

800

600

400

200

20 40 60 80 100 120

Ö Graphics Ö
22.058 - lecture 4, Convolution and Fourier Convolution
Optics with lens
2D FT
ftcrop = Fourier @crop D;

120
120

100
100

80
80

60
60

40
40

20
20

0
0
0 20 40 60 80 100 120
0 20 40 60 80 100 120

22.058 - lecture 4, Convolution and Fourier Convolution


Optics with lens
Projections
1000

800

120 600

400
100
200

80
20 40 60 80 100 120

60

40 1000

800
20
600

0
400
0 20 40 60 80 100 120

200

20 40 60 80 100 120

22.058 - lecture 4, Convolution and Fourier Convolution


Optics with lens
Projections
xprojection = Fourier @RotateLeft @rotft @@64 DD, 64 DD;

300

120
250

200
100
150

80
100

50
60

20 40 60 80 100 120
40
200

20
150

0
100
0 20 40 60 80 100 120

50

20 40 60 80 100 120

22.058 - lecture 4, Convolution and Fourier Convolution


Optics with pinhole

22.058 - lecture 4, Convolution and Fourier Convolution


120 120

100 100

80 80

60 60

40 40

20 20

0 0
0 20 40 60 80 100 120 0 20 40 60 80 100 120

22.058 - lecture 4, Convolution and Fourier Convolution


2D FT

120
120

100
100

80
80

60
60

40
40

20
20

0
0
0 20 40 60 80 100 120
0 20 40 60 80 100 120

22.058 - lecture 4, Convolution and Fourier Convolution


Optics with pinhole
Projections
1200

1000

800
120
600

100 400

200
80
20 40 60 80 100 120

60

1400
40
1200

1000
20
800

600
0
0 20 40 60 80 100 120 400

200

20 40 60 80 100 120

22.058 - lecture 4, Convolution and Fourier Convolution


Projections

300

250 250

200
200
150
150
100
100
50

20 40 60 80 100 120
20 40 60 80 100 120
200

150 200

150
100

100
50

20 40 60 80 100 120
20 40 60 80 100 120

22.058 - lecture 4, Convolution and Fourier Convolution


Deconvolution to determine MTF of Pinhole

1200

1000

800 MTF = Abs @pinhole Dê Abs @image D;


600
ListPlot @MTF, 8PlotRange ÆAll , PlotJoined ÆTrue <
400 10

200
8

20 40 60 80 100 120
6

1000
4

800
2

600
20 40 60 80 100 120
400
Ö Graphics Ö
200

20 40 60 80 100 120

22.058 - lecture 4, Convolution and Fourier Convolution


FT to determine PSF of Pinhole
MTF = Abs @pinhole Dê Abs @image D;

ListPlot @MTF, 8PlotRange ÆAll , PlotJoined ÆTrue <D


10

20 40 60 80 100 120

Ö Graphics Ö PSF = Fourier @RotateLeft @MTF, 64 DD;

ListPlot @RotateLeft @Abs @PSF D, 64 D, 8PlotRange ÆAll , PlotJoined ÆTrue <D

20 40 60 80 100 120
22.058 - lecture 4, Convolution
Ö Graphics Öand Fourier Convolution
Filtered FT to determine PSF of Pinhole
MTF = Abs @pinhole Dê Abs @image D;

ListPlot @MTF, 8PlotRange ÆAll , PlotJoined ÆTrue <D


10
1.5
8
1.25

6 1

0.75
4
0.5
2 0.25

20 40 60 80 100 120 20 40 60 80 100 120

Filter
Ö Graphics= Table
Ö @Exp @- Abs @x - 64 Dê 15 D, 8x , 0 , 128 <D êê N;

ListPlot @Filter , 8PlotRange ÆAll , PlotJoined ÆTrue <D


1

0.8

0.6

0.4

0.2

20 40 60 80 100 120
22.058 - lectureÖ4, Convolution and Fourier Convolution
Ö Graphics

You might also like