Lecture 4. Image Restoration and Reconstruction
Lecture 4. Image Restoration and Reconstruction
Spring 2008
New Mexico Tech
Image Restoration
03/21/22 2
A Model of Image Degradation/Restoration
Process
► Degradation
Degradation function H
Additive noise ( x, y )
03/21/22 3
A Model of Image Degradation/Restoration
Process
03/21/22 4
A Model of Image Degradation/Restoration
Process
03/21/22 5
Noise Sources
Image acquisition
e.g., light levels, sensor temperature, etc.
Transmission
e.g., lightning or other atmospheric disturbance in wireless
network
03/21/22 6
Noise Models (1)
► White noise
The Fourier spectrum of noise is constant
03/21/22 7
Noise Models (2)
Gaussian noise
Electronic circuit noise, sensor noise due to poor illumination and/or
high temperature
Rayleigh noise
Range imaging
03/21/22 8
Range Imaging (1)
* Tone mapping is a technique used in image processing and computer graphics to map
a set of colours to another; often to approximate the appearance of HDRI in media with a
more limited dynamic range
** bracketing is the general technique of taking several shots of the same subject using
different or the same camera settings
http://en.wikipedia.org/wiki/High_dynamic_range_imaging
http://www.webopedia.com/TERM/H/High_Dynamic_Range_Imaging.html
03/21/22 9
Range Imaging (2)
http://en.wikipedia.org/wiki/High_dynamic_range_imaging
http://www.webopedia.com/TERM/H/High_Dynamic_Range_Imaging.html
03/21/22 10
Range Imaging: Examples (1)
http://en.wikipedia.org/wiki/High_dynamic_range_imaging
Tower Bridge
in Sacramento,
CA
03/21/22 11
Sydney Harbour
Bridge HDRi
Range Imaging: Examples (2) produces greater
detail and fewer
http://en.wikipedia.org/wiki/High_dynamic_range_imaging shadows
03/21/22 12
03/21/22 Old Saint Paul’s Wellinton, New Zealand 13
http://en.wikipedia.org/wiki/Image:HDRI-Example.jpg
03/21/22 14
Noise Models (3)
03/21/22 15
Gaussian Noise (1)
03/21/22 16
Gaussian Noise (2)
( ), ( )
95% of its values will be in the range
( 2 ), ( 2 )
03/21/22 17
Rayleigh Noise
03/21/22 18
Erlang (Gamma) Noise
03/21/22 19
Exponential Noise
03/21/22 20
Uniform Noise
03/21/22 21
Impulse (Salt-and-Pepper) Noise
03/21/22 24
Examples of Noise: Noisy Images(1)
03/21/22 25
Examples of Noise: Noisy Images(2)
03/21/22 26
Periodic Noise
03/21/22 27
An Example of Periodic Noise
03/21/22 28
Estimation of Noise Parameters (1)
The shape of the histogram identifies the closest PDF match
03/21/22 29
Estimation of Noise Parameters (2)
03/21/22 30
Restoration in the Presence of Noise Only
̶ Spatial Filtering
03/21/22 31
Spatial Filtering: Mean Filters (1)
03/21/22 32
Spatial Filtering: Mean Filters (2)
03/21/22 33
Spatial Filtering: Mean Filters (3)
Harmonic mean filter
f ( x, y ) mn
1
( s ,t )S xy g ( s, t )
It works well for salt noise, but fails for pepper noise.
It does well also with other types of noise like Gaussian
noise.
03/21/22 34
Spatial Filtering: Mean Filters (4)
( s ,t )S xy
g ( s, t )Q
03/21/22 36
Spatial Filtering: Example (2)
03/21/22 37
Spatial Filtering: Example (3)
03/21/22 38
Spatial Filtering: Order-Statistic Filters (1)
Median filter
f ( x, y) median g ( s, t )
( s ,t )S xy
Max filter
f ( x, y) max g ( s, t )
( s ,t )S xy
Min filter
f ( x, y) min g ( s, t )
( s ,t )S xy
03/21/22 39
Spatial Filtering: Order-Statistic Filters (2)
Midpoint filter
f ( x, y ) 1 max g ( s, t ) min g ( s, t )
2 ( s ,t )S xy ( s ,t )S xy
03/21/22 40
Spatial Filtering: Order-Statistic Filters (3)
03/21/22 41
03/21/22 42
03/21/22 43
03/21/22 44
Spatial Filtering: Adaptive Filters (1)
Adaptive filters
03/21/22 45
Adaptive Filters:
Adaptive, Local Noise Reduction Filters (1)
S xy : local region
The response of the filter at the center point (x,y) of S xy
is based on four quantities:
(a) g ( x, y ), the value of the noisy image at (x, y );
(b) 2 , the variance of the noise corrupting f ( x, y )
to form g ( x, y);
(c) mL , the local mean of the pixels in S xy ;
(d) L2 , the local variance of the pixels in S xy .
03/21/22 46
Adaptive Filters:
Adaptive, Local Noise Reduction Filters (2)
03/21/22 47
Adaptive Filters:
Adaptive, Local Noise Reduction Filters (3)
03/21/22 48
03/21/22 49
Adaptive Filters:
Adaptive Median Filters (1)
The notation:
zmin minimum intensity value in S xy
zmax maximum intensity value in S xy
zmed median intensity value in S xy
z xy intensity value at coordinates ( x, y)
S max maximum allowed size of S xy
03/21/22 50
Adaptive Filters:
Adaptive Median Filters (2)
The adaptive median-filtering works in two stages:
Stage A:
A1 = zmed zmin ; A2 = zmed zmax
if A1>0 and A2<0, go to stage B
Else increase the window size
if window size S max , repeat stage A; Else output zmed
Stage B:
B1 = z xy zmin ; B2 = z xy zmax
if B1>0 and B2<0, output z xy ; Else output zmed
03/21/22 51
Adaptive Filters:
Adaptive Median Filters (2)
The adaptive median-filtering works in two stages:
Stage A: The median filter
A1 = zmed zmin ; A2 = zmed zmaxoutput is an impulse
or not
if A1>0 and A2<0, go to stage B
Else increase the window size
if window size S max , repeat stage A; Else output zmed
Stage B:
The processed point
B1 = z xy zmin ; B2 = z xy zmax is an impulse or not
if B1>0 and B2<0, output z xy ; Else output zmed
03/21/22 52
Example:
Adaptive Median Filters
03/21/22 53
Periodic Noise Reduction by Frequency
Domain Filtering
Approach
03/21/22 54
Perspective Plots of Bandreject Filters
03/21/22 55
A Butterworth bandreject
filter of order 4, with the
appropriate radius and
width to enclose
completely the noise
impulses
03/21/22 56
Perspective Plots of Notch Filters
03/21/22 57
03/21/22 58
Several interference components are present, the methods discussed
in the preceding sections are not always acceptable because they
remove much image information
The components tend to have broad skirts that carry information
about the interference pattern and the skirts are not always easily
detectable.
03/21/22 59
Optimum Notch Filtering
N (u , v) H NP (u , v)G (u, v)
( x, y ) 1 H NP (u, v)G (u, v)
03/21/22 61
Optimum Notch Filtering: Step 2 (1)
f ( x, y ) g ( x, y ) w( x, y ) ( x, y )
2
1 a b
f ( x s, y t ) f ( x, y )
2
( x, y )
(2a 1)(2b 1) s a t b
03/21/22 63
Assume that w(x,y) remains
essentially constant over the
Optimum
neighborhood gives theNotch Filtering: Step (3)
approximation
w(x+s,
The localy+t) of f ( x, y ):
= w(x,y)
variance
2
1 a b
f ( x s, y t ) f ( x, y )
2
( x, y )
(2a 1)(2b 1) s a t b
2
b g ( x s , y t ) w( x s, y t ) ( x s, y s )
1 a
(2a 1)(2b 1) s a t b g ( x, y ) w( x, y ) ( x, y )
2
b g ( x s , y t ) w( x, y ) ( x s , y s )
1 a
(2a 1)(2b 1) s a t b g ( x, y ) w( x, y ) ( x, y )
03/21/22 64
Optimum Notch Filtering: Step (4)
2
2 ( x, y )
To minimize ( x, y ) , 0
w( x, y )
for w( x, y ), the result is
g ( x, y ) ( x, y ) g ( x, y ) ( x, y )
w( x, y ) 2
2
( x, y ) ( x, y )
03/21/22 65
Optimum Notch Filtering: Example
03/21/22 66
Optimum Notch Filtering: Example
03/21/22 67
Optimum Notch Filtering: Example
03/21/22 68
Optimum Notch Filtering: Example
03/21/22 69
Linear, Position-Invariant Degradations
g ( x, y ) H f ( x , y ) ( x , y )
03/21/22 70
Linear, Position-Invariant Degradations
H is linear
H af1 ( x, y ) bf 2 ( x, y ) aH f1 ( x, y ) bH f 2 ( x, y )
f1 and f 2 are any two input images.
03/21/22 73
Linear, Position-Invariant Degradations
g ( x, y ) f ( , ) h( x , y )d d ( x, y )
h ( x, y ) f ( x, y ) ( x , y )
03/21/22 74
Estimating the Degradation Function
1. Observation
2. Experimentation
3. Mathematical Modeling
03/21/22 75
Mathematical Modeling (1)
k ( u 2 v 2 )5/6
H (u , v ) e
k : a constant that depends on
the nature of the turbulence
03/21/22 76
03/21/22 77
Mathematical Modeling (2)
03/21/22 78
Mathematical Modeling (3)
03/21/22 79
Mathematical Modeling (4)
T
g ( x, y ) f x x0 (t ), y y0 (t ) dt
0
G (u, v) g ( x, y ) e j 2 ( ux vy )
dxdy
T
f x x0 (t ), y y0 (t ) dt e j 2 ( ux vy ) dxdy
0
T
f x x (t ), y y (t ) e j 2 ( ux vy ) dxdy dt
0 0 0
T j 2 ux0 ( t ) vy0 ( t )
F (u , v)e dt
0
T j 2 ux0 ( t ) vy0 ( t )
F (u , v ) e dt
0
03/21/22 80
Mathematical Modeling (4)
T j 2 ux0 ( t ) vy0 ( t )
H (u , v ) e dt
0
T j ua
sin( ua)e
ua
03/21/22 81
Mathematical Modeling (5)
T
sin (ua vb) e j (ua vb )
(ua vb)
03/21/22 82
03/21/22 83
Inverse Filtering
F (u , v) H (u , v) N (u, v)
F (u , v)
H (u , v)
N (u , v)
F (u, v)
H (u , v)
03/21/22 84
Inverse Filtering
N (u , v)
F (u, v) F (u , v)
H (u , v)
03/21/22 85
Inverse Filtering
EXAMPLE
03/21/22 86
Inverse Filtering
One approach is to limit the filter frequencies to values near the origin.
EXAMPLE
k 0.0025, M N 480.
03/21/22 87
The poor performance
of direct inverse
filtering in general
A Butterworth
lowpass
function of
order 10
03/21/22 88
Minimum Mean Square Error (Wiener)
Filtering
N. Wiener (1942)
Objective
Find an estimate of the uncorrupted image such that the mean
square error between them is minimized
e 2 E ( f f ) 2
03/21/22 89
Minimum Mean Square Error (Wiener)
Filtering
H *(u, v) S f (u, v)
F (u, v) 2 G (u, v)
S f (u , v) | H (u , v) | S (u , v)
H *(u, v)
2 G (u , v)
| H (u , v) | S (u , v ) / S f (u, v)
1 | H (u, v) |2
2 G (u, v)
H (u, v) | H (u , v) | S (u, v) / S f (u, v)
03/21/22 90
Minimum Mean Square Error (Wiener)
Filtering
1 | H (u , v ) |2
F (u , v) 2 G (u, v)
H (u , v) | H (u, v) | S (u, v) / S f (u, v)
03/21/22 91
Minimum Mean Square Error (Wiener)
Filtering
2
1 | H (u , v ) |
F (u , v) 2 G (u, v)
H (u , v) | H (u, v) | K
03/21/22 92
Minimum Mean Square Error (Wiener)
Filtering
03/21/22 93
Left:
degradated
image
Middle:
inverse
filtering
Right:
Wiener
filtering
03/21/22 94
Some Measures (1)
| F (u , v ) | 2
SNR u 0 v 0
M 1 N 1
| N (u
u 0 v 0
, v ) |2
03/21/22 95
Some Measures (2)
Root-Mean-Sqaure-Error (RMSE)
M 1 N 1
f ( x, y ) 2
RMSE M 1 N 1
u 0 v 0
f ( x, y ) |2
| f (
u 0 v 0
x , y )
03/21/22 96
Constrained Least Squares Filtering
03/21/22 97
Constrained Least Squares Filtering
H *(u, v)
F (u, v) 2 2
G (u , v )
| H (u , v) | | P (u, v) |
03/21/22 98
Examples
03/21/22 99
Geometric Mean Filter
1
H *(u, v ) | H (u, v) | 2
F (u , v) G (u, v)
2
| H (u , v ) |
2
| H (u, v) | S (u, v) / S f (u, v)
1: inverse filter
=0: parametric Wiener filter
=1/2: geometric mean filter
03/21/22 100
Image Reconstruction from Projection
http://en.wikipedia.org/wiki/Computed_tomography
03/21/22 101
Backprojection
http://www.medilexicon.com/medicaldictionary.php?t=9165
03/21/22 102
Image Reconstruction: Introduction
Intensity is
Soft, uniform proportional to
tissue absorption
Uniform with
higher absorption
Tumor
03/21/22 103
Image Reconstruction: Introduction
03/21/22 104
03/21/22 105
03/21/22 106
Other CTs
http://en.wikipedia.org/wiki/Computed_tomography
03/21/22 107
Other CTs
► Multislice CT (seventh-generation)
03/21/22 108
Projections and the Radon Transform
03/21/22 109
Projections and the Radon Transform
g ( j , k ) f ( x, y ) ( x cos k y sin k j )dxdy
03/21/22 110
Projections and the Radon Transform
f g ( , ) f ( x, y ) ( x cos y sin )dxdy
M 1 N 1
f g ( , ) f ( x, y ) ( x cos y sin )
x 0 y 0
03/21/22 111
Example: Using the Radon transform to obtain
the projection of a circular region
A x2 y2 r 2
f ( x, y )
0 otherwise
03/21/22 112
Example: Using the Radon transform to obtain
the projection of a circular region
g ( , ) f ( x, y ) ( x cos y sin )dxdy
f ( x, y ) ( x )dxdy
f ( , y )dy
r2 2
f ( , y )dy
r2 2
r2 2
2 2
Ady
r
2 A r 2 2 | | r
0 otherwise
03/21/22 113
2 A r 2 2 | | r
g ( )
0 otherwise
03/21/22 114
Sinogram: The Result of Radon Transform
► Sinogram: the
result of Radon
transform is
displayed as an
image with
and as
rectilinear
coordinates
03/21/22 115
Image Reconstruction
f ( x, y ) g ( x cos y sin , )
f ( x, y ) f ( x, y )d
0
f ( x, y ) f ( x, y )
0
03/21/22 116
Examples: Laminogram
03/21/22 117
The Fourier-Slice Theorem
G ( , ) f ( x, y ) ( x cos y sin )e j 2 d dxdy
f ( x, y ) ( x cos y sin )e j 2 d dxdy
f ( x, y )e j 2 ( x cos y sin ) dxdy
03/21/22 118
The Fourier-Slice Theorem
G ( w, ) g ( , )e j 2 d
G ( , ) f ( x, y )e j 2 ( x cos y sin ) dxdy
f ( x, y )e j 2 (ux vy ) dxdy
u w cos ,v w sin
F (u, v) u w cos ,v w sin
F ( w cos , w sin )
Fourier-slice theorem: The Fourier tansform of a projection is a slice of
the 2-D Fourier transform of the region from which the projection was
obtained
03/21/22 119
Illustration of the Fourier-slice theorem
03/21/22 120
Reconstruction Using Parallel-Beam Filtered
Backprojections
f ( x, y ) F (u , v)e j 2 ( ux vy ) dudv
G ( w, 180 ) G ( w, )
f ( x, y ) | w | G ( w, )e j 2 w( x cos y sin ) dwd
0
03/21/22 121
Reconstruction Using Parallel-Beam Filtered
Backprojections
f ( x, y ) | w | G ( w, )e j 2 w ( x cos y sin )
dwd
0
It’s not
| w | G ( w, )e j 2 w dw
integrable 0
x cos y sin
d
Approach:
Window the ramp so it becomes zero outside of a defined frequency
interval. That is, a window band-limits the ramp filter.
03/21/22 122
Hamming / Hann Widow
2 w
c (c 1) cos 0 w ( M 1)
h( w) M 1
0 otherwise
03/21/22 123
The Plot of Hamming Widow
03/21/22 124
Filtered Backprojection
03/21/22 126
Examples: Filtered Backprojection
03/21/22 127
Implementation of Filtered Backprojection in
Spatial Domain
► Fourier transform of the product of two frequency domain
functions is equal to the convolution of the spatial
representation
► Let s(p) denote the inverse Fourier transform of |w|
f ( x, y ) | w | G ( w, )e j 2 w dw
0
x cos y sin
d
s( ) g ( , ) d
0 x cos y sin
g ( , ) s( x cos y sin ) d d
0
03/21/22 128
Reconstruction Using Fan-Beam Filtered
Backprojections
D sin
03/21/22 129
Reconstruction Using Fan-Beam Filtered
Backprojections
Objects are encompassed within a circular area of radius T about
the origin of the plane, or g( , )=0 for | |>T
f ( x, y ) g ( , ) s( x cos y sin )d d
0
1 2 T
g ( , ) s( x cos y sin )d d
2 0 T
x r cos ; y r sin
x cos y sin r cos cos r sin sin
r cos( )
03/21/22 130
Reconstruction Using Fan-Beam Filtered
Backprojections
x r cos ; y r sin
x cos y sin r cos cos r sin sin
r cos( )
1 2 T
f ( x, y ) g ( , ) s r cos( ) d d
2 0 T
D sin
d d D cos d d
03/21/22 131
Reconstruction Using Fan-Beam Filtered
Backprojections
d d D cos d d
1 2 T
f ( x, y ) g ( , ) s r cos( ) d d
2 0 T
1 2 sin 1 (T / D )
g ( D sin , ) s r cos( ) D sin D cos d d
2 sin 1
( T / D )
03/21/22 132
Reconstruction Using Fan-Beam Filtered
Backprojections
1 2 T
f ( x, y) g ( , ) s r cos( ) d d
2 0 T
1 2 sin1 (T / D )
g ( D sin , ) s r cos( ) D sin D cos d d
2 sin 1
( T / D )
1 2 m
f (r , ) p ( , ) s R sin ' D cos d d
2 0 m
2
s ( R sin ) s ( )
R sin
2 1 m d
f (r , )
R 2 m
q ( , ) h ' d
0
2
1
h( ) s ( ), q ( , ) p( , ) D cos
03/21/22 2 sin 133
03/21/22 134
03/21/22 135