Image Restoration
Image Restoration
degradation/restoration process
g(x,y)=f(x,y)*h(x,y)+h(x,y)
G(u,v)=F(u,v)H(u,v)+N(u,v)
Noise models 雜訊模型
◼ Source of noise
◼ Image acquisition (digitization)
◼ Image transmission
◼ Spatial properties of noise
◼ Statistical behavior of the gray-level values of
pixels
◼ Noise parameters, correlation with the image
◼ Frequency properties of noise
◼ Fourier spectrum
◼ Ex. white noise (a constant Fourier spectrum)
Noise probability density
functions
◼ Noises are taken as random variables
◼ Random variables
◼ Probability density function (PDF)
Gaussian noise
◼ Math. tractability in spatial and frequency
domain
◼ Electronic circuit noise and sensor noise
1 − ( z − ) 2 / 2 2
p( z ) = e
2
mean variance
Note:
p( z)dz = 1
−
Gaussian noise (PDF)
Variance: =
2
12
Uniform PDF
Impulse (salt-and-pepper)
nosie
◼ Quick transients, such as faulty switching during
imaging
Pa for z = a
p ( z ) = Pb for z = b
0 otherwise
Its histogram:
0 255
Periodic noise
◼ Arise from electrical or electromechanical
interference during image acquisition
◼ Spatial dependence
◼ Observed in the frequency domain
Sinusoidal noise:
Complex conjugate
pair in frequency
domain
Estimation of noise parameters
◼ Periodic noise
◼ Observe the frequency spectrum
◼ Random noise with unknown PDFs
◼ Case 1: imaging system is available
◼ Capture images of “flat” environment
◼ Case 2: noisy images available
◼ Take a strip from constant area
◼ Draw the histogram and observe it
◼ Measure the mean and variance
Observe the histogram
Gaussian uniform
Measure the mean and variance
◼ Histogram is an estimate of PDF
= zi p ( zi )
zi S
2 = ( zi − ) 2 p ( zi )
zi S
Gaussian: ,
Uniform: a, b
Outline
◼ A model of the image degradation / restoration
process
◼ Noise models
◼ Restoration in the presence of noise only – spatial
filtering
◼ Periodic noise reduction by frequency domain
filtering
◼ Linear, position-invariant degradations
◼ Estimating the degradation function
◼ Inverse filtering
Additive noise only
g(x,y)=f(x,y)+h(x,y)
G(u,v)=F(u,v)+N(u,v)
Spatial filters for de-noising
additive noise
◼ Skills similar to image enhancement
◼ Mean filters
◼ Order-statistics filters
◼ Adaptive filters
Mean filters
◼ Arithmetic mean
ˆf ( x, y ) = 1
g ( s, t )
mn ( s ,t )S xy
Window centered at (x,y)
◼ Geometric mean
1/ mn
ˆf ( x, y ) = g ( s, t )
( s ,t )S xy
original Noisy
Gaussian
=0
=20
Arith. Geometric
mean mean
Mean filters (cont.)
◼ Harmonic mean filter
mn
fˆ ( x, y ) =
1
( s ,t )S xy g ( s, t )
◼ Contra-harmonic mean filter
g ( s ,
( s ,t )S xy
t ) Q +1
fˆ ( x, y ) =
g ( s , t ) Q
Contra- Contra-
harmonic harmonic
Q=1.5 Q=-1.5
Wrong sign in contra-harmonic filtering
Q=-1.5 Q=1.5
Order-statistics filters
◼ Based on the ordering(ranking) of pixels
◼ Suitable for unipolar or bipolar noise (salt and
pepper noise)
◼ Median filters
◼ Max/min filters
◼ Midpoint filters
◼ Alpha-trimmed mean filters
Order-statistics filters
◼ Median filter
fˆ ( x, y ) = median{g ( s, t )}
( s ,t )S xy
◼ Max/min filters
fˆ ( x, y) = max {g ( s, t )}
( s ,t )S xy
fˆ ( x, y ) = min {g ( s, t )}
( s ,t )S xy
bipolar 3x3
Noise Median
Pa = 0.1 Filter
Pb = 0.1 Pass 1
3x3 3x3
Median Median
Filter Filter
Pass 2 Pass 3
Pepper Salt
noise noise
Max Min
filter filter
Order-statistics filters (cont.)
◼ Midpoint filter
ˆf ( x, y ) = 1 max {g ( s, t )} + min {g ( s, t )}
2 ( s ,t )S xy ( s ,t )S xy
5x5 5x5
Arith. Mean Geometric
filter mean
5x5 5x5
Median Alpha-trim.
filter Filter
d=5
Adaptive filters
◼ Adapted to the behavior based on the
statistical characteristics of the image inside
the filter region Sxy
◼ Improved performance v.s increased
complexity
◼ Example: Adaptive local noise reduction filter
Adaptive local noise reduction
filter
◼ Simplest statistical measurement
◼ Mean and variance
◼ Known parameters on local region Sxy
◼ g(x,y): noisy image pixel value
◼ 2h: noise variance (assume known a prior)
◼ mL : local mean
◼ 2L : local variance
Adaptive local noise reduction
filter (cont.)
◼ Analysis: we want to do
◼ If 2h is zero, return g(x,y)
◼ If 2L> 2h , return value close to g(x,y)
◼ If 2L= 2h , return the arithmetic mean mL
◼ Formula
ˆf ( x, y) = g ( x, y) − h g ( x, y) − m
2
L 2 L
Gaussian Arith.
noise
=0 mean
2=1000 7x7
Geometric
mean
7x7
adaptive
Outline
◼ A model of the image degradation / restoration
process
◼ Noise models
◼ Restoration in the presence of noise only – spatial
filtering
◼ Periodic noise reduction by frequency domain
filtering
◼ Linear, position-invariant degradations
◼ Estimating the degradation function
◼ Inverse filtering
Periodic noise reduction
◼ Pure sine wave
◼ Appear as a pair of impulse (conjugate) in the
frequency domain
f ( x, y) = A sin( u0 x + v0 y)
A u0 v0 u0 v0
F (u, v) = − j (u − , v − ) − (u + ,v + )
2 2 2 2 2
Periodic noise reduction (cont.)
◼ Bandreject filters
◼ Bandpass filters
◼ Notch filters
◼ Optimum notch filtering
Bandreject filters
* Reject an isotropic frequency
bandreject
Bandpass filters
◼ Hbp(u,v)=1- Hbr(u,v)
−1 G (u , v) H bp (u , v)
Notch filters
◼ Reject(or pass) frequencies in predefined
neighborhoods about a center frequency
ideal
Butterworth Gaussian
Horizontal
Scan lines
Notch
DFT pass
Notch Notch
pass reject
Outline
◼ A model of the image degradation / restoration
process
◼ Noise models
◼ Restoration in the presence of noise only – spatial
filtering
◼ Periodic noise reduction by frequency domain
filtering
◼ Linear, position-invariant degradations
◼ Estimating the degradation function
◼ Inverse filtering
A model of the image
degradation /restoration process
g(x,y)=f(x,y)*h(x,y)+h(x,y)
G(u,v)=F(u,v)H(u,v)+N(u,v)
◼ Linear system
◼ H[af1(x,y)+bf2(x,y)]=aH[f1(x,y)]+bH[f2(x,y)]
◼ Position(space)-invariant system
◼ H[f(x,y)]=g(x,y)
◼ H[f(x-a, y-b)]=g(x-a, y-b)
◼ c.f. 1-D signal
◼ LTI (linear time-invariant system)
Linear, position-invariant
degradation model
◼ Linear system theory is ready
◼ Non-linear, position-dependent system
◼ May be general and more accurate
◼ Difficult to solve compuatationally
◼ Image restoration: find H(u,v) and apply
inverse process
◼ Image deconvolution
Estimating the degradation
function
◼ Estimation by Image observation
◼ Estimation by experimentation
◼ Estimation by modeling
Estimation by image
observation
◼ Take a window in the image
◼ Simple structure
◼ Strong signal content
◼ Estimate the original image in the window
known
Gs (u, v)
H s (u, v) =
Fˆs (u, v)
estimate
Estimation by experimentation
◼ If the image acquisition system is ready
◼ Obtain the impulse response
original k=0.0025
k=0.001 k=0.00025
Estimation by modeling (2)
◼ Derive a mathematical model
◼ Ex. Motion of image
T
g ( x, y ) = f ( x − x0 (t ), y − y0 (t ))dt
0
=> Fˆ (u , v ) = G (u , v) = F (u , v) + N (u , v )
H (u , v) H (u , v)
Cut Cut
Outside Outside
70% 85%