syde 575: digital image processing restoration – chapter 5 wiener filtering: sections 5.6-5.8
TRANSCRIPT
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) = sn
2 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 h
s based on observed subimage g
s 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 h
s• 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) + mf
2d(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 vF u v
H u v=
Inverse Filtering
Problem: What happens when there is noise?
( , )ˆ ( , ) ( , )( , )
N u vF 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 image2 *
1
*
2
2
2
1ˆ ( )
ˆ
1ˆ/
n f n
f
f n
n f
H HF G
S S S
H SF G
H S S
HF G
H H S S
-= +
é ù=ê ú
+ê úë ûé ù
=ê ú+ê úë û
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
2
2
1ˆ HF G
H H K
é ù=ê ú
+ê úë û
Wiener Deconvolution Filtering
Source: Gonzalez and Woods