SYDE 575: Introduction to Image Processing

Download Report

Transcript SYDE 575: Introduction to Image Processing

SYDE 575: Digital Image
Processing
Restoration – Chapter 5
Wiener Filtering: Sections 5.6-5.8
Image Degradation

Image degradation model:
g(x,y) = f(x,y) * h(x,y) + n(x,y)
Distortion



Noise
Goal: find filter to undo affects of the
degradation (distortion and noise)
h(x,y): linear, shift invariant distortion ,
typically some blur model e.g., PSF of
camera lens
n(x,y): next slide
Image Degradation
• Simple but important example of point noise: white
Gaussian noise (WGN)
– Mean: E[n(x)] = n(x) = 0
– Variance: E[(n(x) – n(x))2] = E[n2(x)] = sn2
– Autocorrelation: Rn(xi,xj) = E[n(xi)n(xj)]
= sn2 when xi = xj and 0 otherwise
i.e., distinct samples of noise are uncorrelated
Terminology: pixel intensities in a WGN image are
independent, identically distributed (i.i.d.) zero mean
Gaussian random variables
Image Restoration


So, a linear, shift-invariant degradation can be
represented by a convolution of the input
image with a distortion plus additive noise
Intuitively, the goal of image restoration in
such a case is to find filters that reverse the
degradation process
g(x,y) * hr(x,y) = f^(x,y)
such that E[ ( f(x,y) – f^(x,y) )2 ] is small
i.e., “minimize the mean squared error (MSE)”
Wiener Filter for Additive Noise
• Long derivation to find the optimal solution for
degradation process for h(x) = d(x) i.e., a solution
that only accounts for additive noise
• Wiener filter optimally satisfies the MSE constraint
for additive noise. In frequency domain:
Hr(u) = Sf(u)/(Sf(u) + Sn(u))
where Sf(u) = |F(u)|2 is power spectrum of signal
and Sn(u) = sn2 is power spectrum of WGN
Insight
H(u) = Sf(u)/(Sf(u) + Sn(u))
= 1/(1 + Sn(u)/Sf(u))
= 1/(1+1/SNR)
• H(u) approaches 1 for large SNR and 0 for
poor SNR, as a function of frequency
Restoration With Distortion and WGN
• Reintroduce LSI distortion and assume h(x)
known
• Again, we would like to estimate f(x), the
original signal, but this time with both h(x) and
additive noise known
Estimating distortion h(x)
• There are a number of ways to estimate the
degradation introduced by h(x):
1. Image Observation
2. Experimentation
3. Modeling
Estimating Degradation Fn:
1. Image Observation
•
•
•
Take subimage with simple structures from
image
Construct estimate of what subimage
should be like prior to degradation
Determine subimage degradation function
hs based on observed subimage gs and
constructed subimage fsest
Hs(u,v) = Gs(u,v)/Fsest(u,v)
Estimating Degradation Fn:
1. Image Observation (cont.)
•
•
Reconstruct complete degradation
function h based on hs
Works based on the assumption of
shift invariance
Estimating Degradation Fn:
2. Experimentation
•
•
•
Useful if equipment similar to equipment
used to acquire degraded image available
Image an impulse (small dot of light) and
adjust settings until the impulse is close to
that produced by the degradation
Use the estimated degradation function to
restore image
Estimating Degradation Fn:
2. Experimentation (cont.)
Source: Gonzalez and Woods
Estimating Degradation Fn:
3. Modeling
•
•
Useful if physical conditions (camera
conditions, environment conditions, etc.) can
be modeled
Example: linear motion blur
–
•
e.g., for L=4 and horizontal motion blur
h(x,y) = [0.25 0.25 0.25 0.25]
Example: assume a model that “fits” images
–
e.g., autocorrelation function
Sf(u) = 2asf2/(a2 + 4p2u2) + mf2d(u)
Estimation by Modelling
L=9, horizontal motion blur
Inverse Filtering

Simple idea:
 Degradation assumed to be created by
multiplying degradation function by
image in frequency domain
 Removing degradation would mean
dividing degraded image by degradation
function
G (u , v )
ˆ
F (u , v ) =
H (u , v )
Inverse Filtering




Problem: What happens when there is
noise?
N (u , v )
ˆ
F (u , v ) = F (u ,v ) +
H (u , v )
If degradation has very small values, N/H
dominates F!
Frequently worse than original degradation
image!
See Lab #4
Inverse Filtering
Source: Gonzalez and Woods
Wiener (Least Squares)
Deconvolution Filtering

Note: textbook refers to only the “Wiener Filter”, but
these course notes make a distinction between



“Wiener filter for additive noise” which assumes that the
distortion does not exist and
“Wiener Deconvolution” which compensates for both
distortion and noise
Textbook’s “Wiener Filter” is the same as the notes
“Wiener Deconvolution”
Wiener Deconvolution Filtering

Expressing in terms of degraded image
2
*
H
1 -1 H
ˆ
F =(
+ )
G
Sn
Sf
Sn
Fˆ
Fˆ
é H *S f
ù
=ê 2
úG
êë H S f + Sn úû
2
é1
H
=ê
2
êë H H + S n / S f



ù
úG
úû
H*: complex
conjugate of H
Sn = |N|2
Sf = |F|2
Wiener Deconvolution Filtering


Power spectrum of undegraded image
often not known
Solution: Replace ratio between noise and
image variance by specified constant K
é1
ù
H
Fˆ = ê
úG
2
êë H H + K úû
2
Wiener Deconvolution Filtering
Source: Gonzalez and Woods