syde 575: digital image processing restoration – chapter 5 wiener filtering: sections 5.6-5.8

21
SYDE 575: Digital Image Processing Restoration – Chapter 5 Wiener Filtering: Sections 5.6-5.8

Upload: sibyl-mccoy

Post on 04-Jan-2016

261 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: SYDE 575: Digital Image Processing Restoration – Chapter 5 Wiener Filtering: Sections 5.6-5.8

SYDE 575: Digital Image Processing

Restoration – Chapter 5

Wiener Filtering: Sections 5.6-5.8

Page 2: 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

Page 3: SYDE 575: Digital Image Processing Restoration – Chapter 5 Wiener Filtering: Sections 5.6-5.8

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

Page 4: SYDE 575: Digital Image Processing Restoration – Chapter 5 Wiener Filtering: Sections 5.6-5.8

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)”

Page 5: SYDE 575: Digital Image Processing Restoration – Chapter 5 Wiener Filtering: Sections 5.6-5.8

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

Page 6: SYDE 575: Digital Image Processing Restoration – Chapter 5 Wiener Filtering: Sections 5.6-5.8

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

Page 7: SYDE 575: Digital Image Processing Restoration – Chapter 5 Wiener Filtering: Sections 5.6-5.8

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

Page 8: SYDE 575: Digital Image Processing Restoration – Chapter 5 Wiener Filtering: Sections 5.6-5.8

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

Page 9: SYDE 575: Digital Image Processing Restoration – Chapter 5 Wiener Filtering: Sections 5.6-5.8

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)

Page 10: SYDE 575: Digital Image Processing Restoration – Chapter 5 Wiener Filtering: Sections 5.6-5.8

Estimating Degradation Fn:1. Image Observation (cont.)

• Reconstruct complete degradation function h based on h

s• Works based on the assumption of

shift invariance

Page 11: SYDE 575: Digital Image Processing Restoration – Chapter 5 Wiener Filtering: Sections 5.6-5.8

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

Page 12: SYDE 575: Digital Image Processing Restoration – Chapter 5 Wiener Filtering: Sections 5.6-5.8

Estimating Degradation Fn:2. Experimentation (cont.)

Source: Gonzalez and Woods

Page 13: SYDE 575: Digital Image Processing Restoration – Chapter 5 Wiener Filtering: Sections 5.6-5.8

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)

Page 14: SYDE 575: Digital Image Processing Restoration – Chapter 5 Wiener Filtering: Sections 5.6-5.8

Estimation by Modelling

L=9, horizontal motion blur

Page 15: SYDE 575: Digital Image Processing Restoration – Chapter 5 Wiener Filtering: Sections 5.6-5.8

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=

Page 16: SYDE 575: Digital Image Processing Restoration – Chapter 5 Wiener Filtering: Sections 5.6-5.8

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

Page 17: SYDE 575: Digital Image Processing Restoration – Chapter 5 Wiener Filtering: Sections 5.6-5.8

Inverse Filtering

Source: Gonzalez and Woods

Page 18: SYDE 575: Digital Image Processing Restoration – Chapter 5 Wiener Filtering: Sections 5.6-5.8

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”

Page 19: SYDE 575: Digital Image Processing Restoration – Chapter 5 Wiener Filtering: Sections 5.6-5.8

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

Page 20: SYDE 575: Digital Image Processing Restoration – Chapter 5 Wiener Filtering: Sections 5.6-5.8

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

é ù=ê ú

+ê úë û

Page 21: SYDE 575: Digital Image Processing Restoration – Chapter 5 Wiener Filtering: Sections 5.6-5.8

Wiener Deconvolution Filtering

Source: Gonzalez and Woods