22.058 - lecture 4, Convolution and Fourier Convolution
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
admission.edhole.com
22.058 - lecture 4, Convolution and Fourier Convolution
Instrument Response FunctionThe Instrument Response Function is a conditional mapping, the form of the map depends on the point that is being mapped.
This is often given the symbol h(r|r’).
Of course we want the entire output from the whole object function,
and so we need to know the IRF at all points.
IRF(x,y | x0 , y0 ) S (x x0 )(y y0 )
E(x,y)
I(x,y)S (x x0 )(y y0 ) dxdydx0dy0
E(x,y)
I(x,y)IRF(x, y | x0 ,y0 )dxdydx0dy0
admission.edhole.com
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.
The Point Spread Function (PSF) is a spatially invariant approximation of the IRF.
IRF(x,y | x0 , y0 ) PSF(x x0 ,y y0 )
admission.edhole.com
22.058 - lecture 4, Convolution and Fourier Convolution
Space Invariance
Since the Point Spread Function describes the same blurring over the entire sample,
The image may be described as a convolution,
or,
IRF(x,y | x0 , y0 ) PSF(x x0 ,y y0 )
E(x,y) I (x0 ,y0 )PSF(x x0 ,y y0 )dx0dy0
Image(x, y) Object(x,y) PSF(x,y)noise
admission.edhole.com
22.058 - lecture 4, Convolution and Fourier Convolution
Convolution Integrals
Let’s look at some examples of convolution integrals,
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
f (x) g(x) h(x)
g(x ')h(x x' )dx'
admission.edhole.com
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
admission.edhole.com
22.058 - lecture 4, Convolution and Fourier Convolution
Convolution Integrals
admission.edhole.com
22.058 - lecture 4, Convolution and Fourier Convolution
Convolution Integrals
Consider the following two functions:
admission.edhole.com
22.058 - lecture 4, Convolution and Fourier Convolution
Convolution Integrals
admission.edhole.com
22.058 - lecture 4, Convolution and Fourier Convolution
Some Properties of the Convolution
commutative:
associative:
multiple convolutions can be carried out in any order.
distributive:
f gg f
f (g h) ( f g) h
f (gh) f g f h
admission.edhole.com
22.058 - lecture 4, Convolution and Fourier Convolution
Recall that we defined the convolution integral as,
One of the most central results of Fourier Theory is the convolution theorem (also called the Wiener-Khitchine theorem.
where,
Convolution Integral
f g f (x)g(x ' x)dx
f g F(k)G(k)
f (x) F(k)
g(x) G(k)
admission.edhole.com
22.058 - lecture 4, Convolution and Fourier Convolution
Convolution Theorem
In other words, convolution in real space is equivalent to multiplication in reciprocal space.
f g F(k)G(k)
admission.edhole.com
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?
-3 -2 -1 1 2 3
5
10
15
=
-3 -2 -1 1 2 3
5
10
15 ?
admission.edhole.com
22.058 - lecture 4, Convolution and Fourier Convolution
Proof of the Convolution Theorem
The inverse FT of f(x) is,
and the FT of the shifted g(x), that is g(x’-x)
f g f (x)g(x ' x)dx
f (x) 1
2F(k)eikxdk
g(x ' x) 1
2G(k ' )eik '(x ' x )dk '
admission.edhole.com
22.058 - lecture 4, Convolution and Fourier Convolution
Proof of the Convolution Theorem
So we can rewrite the convolution integral,
as,
change the order of integration and extract a delta function,
f g f (x)g(x ' x)dx
f g1
42 dx F(k)eikxdk
G(k ' )eik '(x ' x )dk '
f g1
2dkF(k) dk 'G(k ')eik 'x'
12
eix(k k ')dx
(k k ')
admission.edhole.com
22.058 - lecture 4, Convolution and Fourier Convolution
Proof of the Convolution Theorem
or,
Integration over the delta function selects out the k’=k value.
f g1
2dkF(k) dk 'G(k ')eik 'x'
12
eix(k k ')dx
(k k ')
f g1
2dkF(k) dk 'G(k ')eik 'x '(k k ')
f g1
2dkF(k)G(k)eikx'
admission.edhole.com
22.058 - lecture 4, Convolution and Fourier Convolution
Proof of the Convolution Theorem
This is written as an inverse Fourier transformation. A Fourier transform of both sides yields the desired result.
f g1
2dkF(k)G(k)eikx'
f g F(k)G(k)
admission.edhole.com
22.058 - lecture 4, Convolution and Fourier Convolution
Fourier Convolution
admission.edhole.com
22.058 - lecture 4, Convolution and Fourier Convolution
Reciprocal Space
real space reciprocal space
admission.edhole.com
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.
admission.edhole.com
22.058 - lecture 4, Convolution and Fourier Convolution
Filtering
We can also emphasis the high frequency components.
Weighting function in k-space.
admission.edhole.com
22.058 - lecture 4, Convolution and Fourier Convolution
Modulation transfer function
i(x, y) o(x,y) PSF(x,y) noise
I(kx ,ky ) O(kx ,ky )MTF(kx ,ky ) noise
E(x,y)
I(x,y)S (x x0 )(y y0 ) dxdydx0dy0
E(x,y)
I(x,y)IRF(x, y | x0 ,y0 )dxdydx0dy0
admission.edhole.com
22.058 - lecture 4, Convolution and Fourier Convolution
Optics with lens‡ Input bit mapped image
sharp =Import @"sharp. bmp"D;
Shallow @InputForm@sharpDD
Graphics@Raster@<<4>>D, Rule@<<2>>DD
s =sharp@@1, 1DD;
Dimensions@sD
8480, 640<
ListDensityPlot @s, 8PlotRange ÆAll , MeshÆFalse <Dadmission.edhole.com
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;
line =rot @@20DD;
ListPlot @line , 8PlotRange ÆAll , PlotJoined ÆTrue<D
20 40 60 80 100 120
40
60
80
100
120
Ö Graphics Ö0 20 40 60 80 100 1200
20
40
60
80
100
120
admission.edhole.com
22.058 - lecture 4, Convolution and Fourier Convolution
Optics with lens
20 40 60 80 100 120
40
60
80
100
120
üFourier transform of vertical line to show modulation
ftline =Fourier @line D;
ListPlot @RotateLeft @Abs@ftline D, 64D, 8PlotJoined ÆTrue<D
20 40 60 80 100 120
2.5
5
7.5
10
12.5
15
Ö Graphics ÖListPlot @RotateLeft @Abs@ftline D, 64D, 8PlotRange ÆAll , PlotJoined ÆTrue<D
20 40 60 80 100 120
200
400
600
800
1000
Ö Graphics Öadmission.edhole.com
22.058 - lecture 4, Convolution and Fourier Convolution
Optics with lens
2D FT
0 20 40 60 80 100 1200
20
40
60
80
100
120
ftcrop =Fourier @crop D;
0 20 40 60 80 100 1200
20
40
60
80
100
120
admission.edhole.com
22.058 - lecture 4, Convolution and Fourier Convolution
Optics with lens
Projections
0 20 40 60 80 100 1200
20
40
60
80
100
120
20 40 60 80 100 120
200
400
600
800
1000
20 40 60 80 100 120
200
400
600
800
1000
admission.edhole.com
22.058 - lecture 4, Convolution and Fourier Convolution
Optics with lens
Projections
0 20 40 60 80 100 1200
20
40
60
80
100
120
xprojection = Fourier @RotateLeft @rotft @@64DD, 64DD;
20 40 60 80 100 120
50
100
150
200
250
300
20 40 60 80 100 120
50
100
150
200
admission.edhole.com
22.058 - lecture 4, Convolution and Fourier Convolution
Optics with pinhole
admission.edhole.com
22.058 - lecture 4, Convolution and Fourier Convolution
0 20 40 60 80 100 1200
20
40
60
80
100
120
0 20 40 60 80 100 1200
20
40
60
80
100
120
admission.edhole.com
22.058 - lecture 4, Convolution and Fourier Convolution
2D FT
0 20 40 60 80 100 1200
20
40
60
80
100
120
0 20 40 60 80 100 1200
20
40
60
80
100
120
admission.edhole.com
22.058 - lecture 4, Convolution and Fourier Convolution
Optics with pinhole
Projections
0 20 40 60 80 100 1200
20
40
60
80
100
120
20 40 60 80 100 120
200
400
600
800
1000
1200
20 40 60 80 100 120
200
400
600
800
1000
1200
1400
admission.edhole.com
22.058 - lecture 4, Convolution and Fourier Convolution
Projections
20 40 60 80 100 120
50
100
150
200
250
300
20 40 60 80 100 120
50
100
150
200
20 40 60 80 100 120
100
150
200
250
20 40 60 80 100 120
100
150
200
admission.edhole.com
22.058 - lecture 4, Convolution and Fourier Convolution
Deconvolution to determine MTF of Pinhole
20 40 60 80 100 120
200
400
600
800
1000
20 40 60 80 100 120
200
400
600
800
1000
1200
MTF=Abs@pinhole DêAbs@imageD;
ListPlot @MTF, 8PlotRange ÆAll , PlotJoined ÆTrue<D
20 40 60 80 100 120
2
4
6
8
10
Ö Graphics Ö
admission.edhole.com
22.058 - lecture 4, Convolution and Fourier Convolution
FT to determine PSF of PinholeMTF=Abs@pinhole DêAbs@imageD;
ListPlot @MTF, 8PlotRange ÆAll , PlotJoined ÆTrue<D
20 40 60 80 100 120
2
4
6
8
10
Ö Graphics Ö PSF=Fourier @RotateLeft @MTF, 64DD;
ListPlot @RotateLeft @Abs@PSFD, 64D, 8PlotRange ÆAll , PlotJoined ÆTrue<D
20 40 60 80 100 120
1
2
3
4
5
6
7
Ö Graphics Ö
admission.edhole.com
22.058 - lecture 4, Convolution and Fourier Convolution
Filtered FT to determine PSF of PinholeMTF=Abs@pinhole DêAbs@imageD;
ListPlot @MTF, 8PlotRange ÆAll , PlotJoined ÆTrue<D
20 40 60 80 100 120
2
4
6
8
10
Ö Graphics ÖFilter = Table @Exp@-Abs@x - 64Dê15D, 8x, 0, 128<DêêN;
ListPlot @Filter , 8PlotRange ÆAll , PlotJoined ÆTrue<D
20 40 60 80 100 120
0.2
0.4
0.6
0.8
1
Ö Graphics Ö
20 40 60 80 100 120
0.25
0.5
0.75
1
1.25
1.5
admission.edhole.com
Recommended