Professional Documents
Culture Documents
Image Restoration
Image Restoration
2021
Degraded images
6/22/2021 3
Image restoration
6/22/2021 5
Image restoration
6/22/2021 6
A Model of Image Degradation/Restoration
Process
► Given g(x,y), some knowledge about H, and some
knowledge about the noise term, the objective is to
produce an estimate of the original image.
▪ The more that is known about H and the noise term the closer the
estimate can be
► Various types of restoration filters are used to accomplish
this. Degraded
Image
Estimated
Input Image Image
6/22/2021 7
Image degradation/restoration process
6/22/2021 8
Noise Models
✓ Image acquisition
e.g., light levels, sensor temperature, etc.
✓ Transmission
e.g., lightning or other atmospheric disturbance in wireless
network
6/22/2021 9
Noise Models (1)
► White noise
▪ The Fourier spectrum of noise is constant
6/22/2021 10
Noise Models (2)
➢ Gaussian noise
Electronic circuit noise, sensor noise due to poor illumination and/or
high temperature
➢ Rayleigh noise
Range imaging
6/22/2021 11
Range Imaging (1)
http://en.wikipedia.org/wiki/High_dynamic_range_imaging
http://www.webopedia.com/TERM/H/High_Dynamic_Range_Imaging.html
6/22/2021 12
Range Imaging (2)
http://en.wikipedia.org/wiki/High_dynamic_range_imaging
http://www.webopedia.com/TERM/H/High_Dynamic_Range_Imaging.html
6/22/2021 13
Range Imaging: Examples (1)
http://en.wikipedia.org/wiki/High_dynamic_range_imaging
Tower Bridge in
Sacramento,
CA
6/22/2021 14
Sydney Harbour
Bridge HDRi
Range Imaging: Examples (2) produces greater
detail and fewer
http://en.wikipedia.org/wiki/High_dynamic_range_imaging shadows
6/22/2021 15
6/22/2021 Old Saint Paul’s Wellinton, New Zealand 16
http://en.wikipedia.org/wiki/Image:HDRI-Example.jpg
6/22/2021 17
Noise Models (3)
6/22/2021 18
Gaussian Noise (1)
6/22/2021 19
Gaussian Noise (2)
( − ), ( + )
▪ 95% of its values will be in the range
( − 2 ), ( + 2 )
6/22/2021 20
Rayleigh Noise
4
The basic shape of this PDF is skewed to the right
6/22/2021
– Can be useful in approximating skewed histograms 21
Erlang (Gamma) Noise
6/22/2021 22
Exponential Noise
6/22/2021 23
Uniform Noise
6/22/2021 24
Impulse (Salt-and-Pepper) Noise
6/22/2021 25
6/22/2021 26
Examples of Noise: Original Image
6/22/2021 27
Examples of Noise: Noisy Images(1)
6/22/2021 28
Examples of Noise: Noisy Images(2)
6/22/2021 29
Periodic Noise
6/22/2021 30
An Example of Periodic Noise
6/22/2021 31
Estimation of Noise Parameters
► By inspection
▪ Histogram in spatial domain
▪ Fourier spectrum (e.g. frequency spikes for periodic noise)
► By calibration
▪ If access to the sensor: collect data for a flat environment
▪ If only images: Estimate PDF from small, near-constant image
patches
6/22/2021 32
Estimation of Noise Parameters
6/22/2021 33
Estimation of Noise Parameters
6/22/2021 34
Estimation of Noise Parameters
6/22/2021 36
Restoration in the Presence of Noise Only
̶ Spatial Filtering
6/22/2021 37
Spatial Filtering: Mean Filters (1)
6/22/2021 38
Spatial Filtering: Mean Filters (2)
6/22/2021 39
Spatial Filtering: Mean Filters (3)
Harmonic mean filter
mn
f ( x, y) =
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.
6/22/2021 40
Spatial Filtering: Mean Filters (4)
6/22/2021 42
Spatial Filtering: Example (2)
6/22/2021 43
Spatial Filtering: Example (3)
6/22/2021 44
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
6/22/2021 45
6/22/2021 46
6/22/2021 47
Periodic Noise Reduction by Frequency
Domain Filtering
Approach
6/22/2021 48
Perspective Plots of Bandreject Filters
6/22/2021 49
A Butterworth bandreject
filter of order 4, with the
appropriate radius and
width to enclose
completely the noise
impulses
6/22/2021 50
Bandpass Filters
6/22/2021 51
Perspective Plots of Notch Filters
• Reject or pass specific conjugate impulse pairs (around a center frequency)
• They appear in symmetric pairs about the origin
6/22/2021 52
6/22/2021 53
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.
6/22/2021 54
Optimum Notch Filtering
f ( x, y )
N (u, v) = H NP (u , v)G (u , v)
( x, y ) = −1 H NP (u, v)G (u, v)
6/22/2021 56
Optimum Notch Filtering: Step 2 (1)
f ( x, y ) = g ( x, y ) − w( x, y ) ( x, y )
a b 2
1 f ( x + s , y + t ) − f ( x, y )
( x, y ) =
2
(2a + 1)(2b + 1) s =− a t =− b
6/22/2021 58
Assume that w(x,y) remains
essentially constant over the
Optimum
neighborhood gives theNotch Filtering: Step (3)
approximation
w(x+s,
The localy+t) = w(x,y)
variance of f ( x, y ):
a b 2
1 f ( x + s , y + t ) − f ( x, y )
( x, y ) =
2
(2a + 1)(2b + 1) s =− a t =− b
b g ( x + s , y + t ) − w( x + s , y + t ) ( x + s , y + s )
2
1 a
=
(2a + 1)(2b + 1) s =− a t =− b − g ( x, y ) − w( x, y ) ( x, y )
b g ( x + s , y + t ) − w( x, y ) ( x + s , y + s )
2
1 a
=
(2a + 1)(2b + 1) s =− a t =− b − g ( x, y ) − w( x, y ) ( x, y )
6/22/2021 59
Optimum Notch Filtering: Step (4)
2
( x, y )
To minimize ( x, y ) ,
2
=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
( x, y ) − ( x, y )
2
6/22/2021 60
Optimum Notch Filtering: Example
6/22/2021 61
Optimum Notch Filtering: Example
6/22/2021 62
Optimum Notch Filtering: Example
6/22/2021 63
Optimum Notch Filtering: Example
6/22/2021 64
Linear, Position-Invariant Degradations
g ( x , y ) = H f ( x , y ) + ( x, y )
6/22/2021 65
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.
= H f ( , ) ( x − , y − ) d d
Superposition (or
− − Fredholm)
integral of the
= H f ( , ) ( x − , y − ) d d first kind
− −
= f ( , ) H ( x − , y − ) d d Impulse
− −
response
6/22/2021 67
Linear, Position-Invariant Degradations
6/22/2021 68
Linear, Position-Invariant Degradations
g ( x, y ) = f ( , )h( x − , y − ) d d + ( x, y )
− −
= h ( x, y ) f ( x , y ) + ( x, y )
G (u , v) = H (u, v) F (u, v) + N (u , v)
6/22/2021 69
Estimating the Degradation Function
1. Observation
2. Experimentation
3. Mathematical Modeling
6/22/2021 70
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
6/22/2021 71
6/22/2021 72
Mathematical Modeling (2)
6/22/2021 73
Mathematical Modeling (3)
6/22/2021 74
Mathematical Modeling (4)
g ( x, y ) = f x − x0 (t ), y − y0 (t ) dt
T
0
G (u , v) = g ( x, y ) e − j 2 ( ux + vy )
dxdy
− −
= f x − x0 (t ), y − y0 (t ) dt e − j 2 (ux + vy ) dxdy
T
− −
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
6/22/2021 75
Mathematical Modeling (4)
T − j 2 ux0 ( t ) + vy0 ( t )
H (u, v) = e dt
0
T
= sin( ua)e − j ua
ua
6/22/2021 76
Mathematical Modeling (5)
T
= sin (ua + vb) e − j (ua + vb )
(ua + vb)
6/22/2021 77
6/22/2021 78
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)
6/22/2021 79
Inverse Filtering
N (u, v)
F (u, v) = F (u, v) +
H (u, v)
6/22/2021 80
Inverse Filtering
EXAMPLE
H (u, v) = e
, k = 0.0025
6/22/2021 81
Inverse Filtering
One approach is to limit the filter frequencies to values near the origin.
EXAMPLE
H (u, v) = e
k = 0.0025, M = N = 480.
6/22/2021 82
The poor performance
of direct inverse
filtering in general
A Butterworth
lowpass
function of
order 10
6/22/2021 83
Drawback of Inverse Filtering
6/22/2021 84
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
e2 = E ( f − f )2
6/22/2021 85
Minimum Mean Square Error (Wiener)
Filtering
H *(u, v)
= G (u , v)
| H (u, v) | + S (u, v ) / S f (u , v)
2
1 | H (u , v) |2
= G (u , v)
H (u, v) | H (u, v) | + S (u, v) / S f (u, v)
2
6/22/2021 86
Minimum Mean Square Error (Wiener)
Filtering
1 | H (u , v) |2
F (u , v) = G (u , v)
H (u , v) | H (u , v) | + S (u , v) / S f (u , v)
2
H (u , v) : degradation function
H *(u , v): complex conjugate of H (u, v)
| H (u , v) |2 = H *(u , v) H (u , v)
S (u , v) =| N (u , v) |2 = power spectrum of the noise
S f (u , v) =| F (u , v) |2 = power spectrum of the undegraded image
6/22/2021 87
Minimum Mean Square Error (Wiener)
Filtering
1 | H (u, v) |2
F (u, v) = G (u, v)
H (u, v) | H (u, v) | + K
2
6/22/2021 88
Minimum Mean Square Error (Wiener)
Filtering
6/22/2021 89
Left:
degradated
image
Middle:
inverse
filtering
Right:
Wiener
filtering
6/22/2021 90
Some Measures (1)
| F (u , v ) |2
SNR = u =0 v =0
M −1 N −1
| N (u
u =0 v =0
, v ) |2
6/22/2021 91
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 (
u =0 v =0
x , y ) − f ( x , y ) | 2
6/22/2021 92