eecs 556 –image processing– w 09 spectral estimation...

46
EECS 556 – Image Processing– W 09 Spectral Estimation and Wiener Filtering Removing noise with Wiener filters Spectral estimation Does autocorrelation suffice?

Upload: lelien

Post on 06-Mar-2018

217 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: EECS 556 –Image Processing– W 09 Spectral Estimation …web.eecs.umich.edu/~silvio/teaching/EECS556_2009/lectures/lecture... · Spectral Estimation and Wiener Filtering ... •

EECS 556 – Image Processing– W 09

Spectral Estimation and Wiener Filtering

• Removing noise with Wiener filters• Spectral estimation• Does autocorrelation suffice?

Page 2: EECS 556 –Image Processing– W 09 Spectral Estimation …web.eecs.umich.edu/~silvio/teaching/EECS556_2009/lectures/lecture... · Spectral Estimation and Wiener Filtering ... •

What is image processing?

Image processing is the application of 2D signal processing methods to images

• Image representation and modeling

• Image enhancement

• Image restoration/image filtering

• Compression(computer vision)

Page 3: EECS 556 –Image Processing– W 09 Spectral Estimation …web.eecs.umich.edu/~silvio/teaching/EECS556_2009/lectures/lecture... · Spectral Estimation and Wiener Filtering ... •

Filtering methods: Wiener filter

• The Wiener filter (and its relatives) are formulated based on random process principles

• random variables, random vectors, random processes

• 2nd‐order properties, through LSI systems

Page 4: EECS 556 –Image Processing– W 09 Spectral Estimation …web.eecs.umich.edu/~silvio/teaching/EECS556_2009/lectures/lecture... · Spectral Estimation and Wiener Filtering ... •

Random processes

• An infinite collection of random variables is called a random process.

• In the context of imaging problems, random processes are often called random fields

• If x[n,m] denotes a random field, ∀[n,m],  x[n,m] is a random variabledefined over a common probability space.

Page 5: EECS 556 –Image Processing– W 09 Spectral Estimation …web.eecs.umich.edu/~silvio/teaching/EECS556_2009/lectures/lecture... · Spectral Estimation and Wiener Filtering ... •

Random processes• The behavior of a random process is specified completely by all of its joint distribution functions.

• mean function: 

• auto‐correlation function:

• auto‐covariance function:

Page 6: EECS 556 –Image Processing– W 09 Spectral Estimation …web.eecs.umich.edu/~silvio/teaching/EECS556_2009/lectures/lecture... · Spectral Estimation and Wiener Filtering ... •

Wide‐sense stationary (WSS)

• A random process x[n,m] is called wide‐sense stationary (WSS) if:– the mean function is a constant

– the auto‐correlation function depends only on the difference in spatial coordinates:

Page 7: EECS 556 –Image Processing– W 09 Spectral Estimation …web.eecs.umich.edu/~silvio/teaching/EECS556_2009/lectures/lecture... · Spectral Estimation and Wiener Filtering ... •

Random processes in freq domain

• DSFT of the auto‐correlation function

= power spectrum or power spectral density of the random process

Page 8: EECS 556 –Image Processing– W 09 Spectral Estimation …web.eecs.umich.edu/~silvio/teaching/EECS556_2009/lectures/lecture... · Spectral Estimation and Wiener Filtering ... •

Pairs of random processes

• Consider both input and output images for LSI systems

• Analyze multiple random processes simultaneously

• Cross‐correlation function:

Page 9: EECS 556 –Image Processing– W 09 Spectral Estimation …web.eecs.umich.edu/~silvio/teaching/EECS556_2009/lectures/lecture... · Spectral Estimation and Wiener Filtering ... •

cross power spectrum

• DSFT of the cross‐correlation function:

• Properties of cross power spectrum: – Linearity

Page 10: EECS 556 –Image Processing– W 09 Spectral Estimation …web.eecs.umich.edu/~silvio/teaching/EECS556_2009/lectures/lecture... · Spectral Estimation and Wiener Filtering ... •

Random processes through LSI systems

• What happens to the cross‐correlation of jointly distributed random processes w[n,m] and x[n,m] after being passed through filters?

• If the inputs x[n,m] and w[n,m] are jointly WSS

Page 11: EECS 556 –Image Processing– W 09 Spectral Estimation …web.eecs.umich.edu/~silvio/teaching/EECS556_2009/lectures/lecture... · Spectral Estimation and Wiener Filtering ... •

Special case 1

• If WSS input  WSS output

Page 12: EECS 556 –Image Processing– W 09 Spectral Estimation …web.eecs.umich.edu/~silvio/teaching/EECS556_2009/lectures/lecture... · Spectral Estimation and Wiener Filtering ... •

The noncausal Wiener filter

• A classic method for attempting to remove noise from images

• Developed (for 1D applications) by Norbert Wiener in the 1930’s and 1940’s.

• Useful if 2nd order statistics of signal and noise are known

•Norbert Wiener (1894‐1964)   Pure and applied  mathematician.

Page 13: EECS 556 –Image Processing– W 09 Spectral Estimation …web.eecs.umich.edu/~silvio/teaching/EECS556_2009/lectures/lecture... · Spectral Estimation and Wiener Filtering ... •

Noise removal problem

• Problem:

• y[n,m] = observed (noisy) image

• w[n,m] = additive random noise

• s[n,m] = true but unknown underlying image

• Goal: Recover s[n,m] from y[n,m].

Page 14: EECS 556 –Image Processing– W 09 Spectral Estimation …web.eecs.umich.edu/~silvio/teaching/EECS556_2009/lectures/lecture... · Spectral Estimation and Wiener Filtering ... •

Noise removal problem

• Convenient solution:  use linear shift‐invariant filtering

• How should we choose this filter?– find h[n,m] such that h[n,m] ** y[n,m] close to s[n,m]

– Find a metric to compare s[n,m] with  s^[n,m]

Page 15: EECS 556 –Image Processing– W 09 Spectral Estimation …web.eecs.umich.edu/~silvio/teaching/EECS556_2009/lectures/lecture... · Spectral Estimation and Wiener Filtering ... •

Minimizing MSE

• Typically: choose the filter h[n,m] that minimizes the mean squared error:

An optimal filter can be found under these assumptions:

Page 16: EECS 556 –Image Processing– W 09 Spectral Estimation …web.eecs.umich.edu/~silvio/teaching/EECS556_2009/lectures/lecture... · Spectral Estimation and Wiener Filtering ... •

Minimizing MSE

• Typically: choose the filter h[n,m] that minimizes the mean squared error:

An optimal filter can be found under these assumptions:• noise and signal are jointly WSS,

• auto‐correlation function of the noise w[n,m] is known

• auto‐correlation function of the true signal s[n,m] is known

• cross‐correlation function between w and s is known

Page 17: EECS 556 –Image Processing– W 09 Spectral Estimation …web.eecs.umich.edu/~silvio/teaching/EECS556_2009/lectures/lecture... · Spectral Estimation and Wiener Filtering ... •

Minimizing MSE

Page 18: EECS 556 –Image Processing– W 09 Spectral Estimation …web.eecs.umich.edu/~silvio/teaching/EECS556_2009/lectures/lecture... · Spectral Estimation and Wiener Filtering ... •

Minimizing MSE

Page 19: EECS 556 –Image Processing– W 09 Spectral Estimation …web.eecs.umich.edu/~silvio/teaching/EECS556_2009/lectures/lecture... · Spectral Estimation and Wiener Filtering ... •

Minimizing MSE

Page 20: EECS 556 –Image Processing– W 09 Spectral Estimation …web.eecs.umich.edu/~silvio/teaching/EECS556_2009/lectures/lecture... · Spectral Estimation and Wiener Filtering ... •

Minimizing MSE

Page 21: EECS 556 –Image Processing– W 09 Spectral Estimation …web.eecs.umich.edu/~silvio/teaching/EECS556_2009/lectures/lecture... · Spectral Estimation and Wiener Filtering ... •

Minimizing MSE

Page 22: EECS 556 –Image Processing– W 09 Spectral Estimation …web.eecs.umich.edu/~silvio/teaching/EECS556_2009/lectures/lecture... · Spectral Estimation and Wiener Filtering ... •

NoncausalWiener filter

Minimizing MSE

Page 23: EECS 556 –Image Processing– W 09 Spectral Estimation …web.eecs.umich.edu/~silvio/teaching/EECS556_2009/lectures/lecture... · Spectral Estimation and Wiener Filtering ... •

NoncausalWiener filter

If the signal s[n,m] and the noise w[n,m] are zero‐mean and uncorrelated (standard assumption)

Page 24: EECS 556 –Image Processing– W 09 Spectral Estimation …web.eecs.umich.edu/~silvio/teaching/EECS556_2009/lectures/lecture... · Spectral Estimation and Wiener Filtering ... •
Page 25: EECS 556 –Image Processing– W 09 Spectral Estimation …web.eecs.umich.edu/~silvio/teaching/EECS556_2009/lectures/lecture... · Spectral Estimation and Wiener Filtering ... •
Page 26: EECS 556 –Image Processing– W 09 Spectral Estimation …web.eecs.umich.edu/~silvio/teaching/EECS556_2009/lectures/lecture... · Spectral Estimation and Wiener Filtering ... •
Page 27: EECS 556 –Image Processing– W 09 Spectral Estimation …web.eecs.umich.edu/~silvio/teaching/EECS556_2009/lectures/lecture... · Spectral Estimation and Wiener Filtering ... •
Page 28: EECS 556 –Image Processing– W 09 Spectral Estimation …web.eecs.umich.edu/~silvio/teaching/EECS556_2009/lectures/lecture... · Spectral Estimation and Wiener Filtering ... •

NoncausalWiener filter• Typically: choose the filter h[n,m] that minimizes the mean squared error:

Wiener filter can be found under these assumptions:• noise and signal are jointly WSS,

• auto‐correlation function of the noise w[n,m] is known

• auto‐correlation function of the true signal s[n,m] is known

• cross‐correlation function between w and s is known

• Or equivalently knowledge of the signal power spectrum and the noise power spectrum is given

Page 29: EECS 556 –Image Processing– W 09 Spectral Estimation …web.eecs.umich.edu/~silvio/teaching/EECS556_2009/lectures/lecture... · Spectral Estimation and Wiener Filtering ... •

Spectral estimation

• Model the spectra based on knowledge of how an imaging system works – hard 

• We must estimate spectra from noisy measurements

Page 30: EECS 556 –Image Processing– W 09 Spectral Estimation …web.eecs.umich.edu/~silvio/teaching/EECS556_2009/lectures/lecture... · Spectral Estimation and Wiener Filtering ... •

Periodogram

• Given a (finite‐extent) realization of a random process x[n,m], the periodogram is defined as

• Smoothing is required to reduce the effect of measurement noise

the normalized squared magnitude of its Fourier transform

Page 31: EECS 556 –Image Processing– W 09 Spectral Estimation …web.eecs.umich.edu/~silvio/teaching/EECS556_2009/lectures/lecture... · Spectral Estimation and Wiener Filtering ... •

Periodogram• If R has a small central core surrounded by zeros

• safely window out the “noise” in the tails:

Page 32: EECS 556 –Image Processing– W 09 Spectral Estimation …web.eecs.umich.edu/~silvio/teaching/EECS556_2009/lectures/lecture... · Spectral Estimation and Wiener Filtering ... •

Spectral estimation via autocorrelation

• Idea: Given a realization (or several realizations) of a random process x[n,m], estimate its auto‐correlation function 

• For a WSS random process, the auto‐correlation function is the correlation between any pixel and another pixel that is [n,m]  away:

Page 33: EECS 556 –Image Processing– W 09 Spectral Estimation …web.eecs.umich.edu/~silvio/teaching/EECS556_2009/lectures/lecture... · Spectral Estimation and Wiener Filtering ... •

The strong law of large numbers

• Random variables Zn– independent and identically distributed rv

– mean E[Z]

• Estimated mean converges to E[Z] as N goes to ∞

Page 34: EECS 556 –Image Processing– W 09 Spectral Estimation …web.eecs.umich.edu/~silvio/teaching/EECS556_2009/lectures/lecture... · Spectral Estimation and Wiener Filtering ... •

Use the strong law of large numbers

Page 35: EECS 556 –Image Processing– W 09 Spectral Estimation …web.eecs.umich.edu/~silvio/teaching/EECS556_2009/lectures/lecture... · Spectral Estimation and Wiener Filtering ... •

The strong law of large numbers

• Similarly, if (Xn, Yn) are independent and identically distributed pairs of random variables with correlation E[XY ]

• By considering all pairs of pixels with separation n,m

Page 36: EECS 556 –Image Processing– W 09 Spectral Estimation …web.eecs.umich.edu/~silvio/teaching/EECS556_2009/lectures/lecture... · Spectral Estimation and Wiener Filtering ... •
Page 37: EECS 556 –Image Processing– W 09 Spectral Estimation …web.eecs.umich.edu/~silvio/teaching/EECS556_2009/lectures/lecture... · Spectral Estimation and Wiener Filtering ... •

Designing autocorrelations functions in Matlab

• Design WSS random process y[n,m]  with a given desired autocorrelation function Ry

– Create a white Gaussian random process x[n,m] using randn.m

– convolve x[n,m] with an filter with h[n,m]

x[n,m] y[n,m]

Page 38: EECS 556 –Image Processing– W 09 Spectral Estimation …web.eecs.umich.edu/~silvio/teaching/EECS556_2009/lectures/lecture... · Spectral Estimation and Wiener Filtering ... •

– choose h such that we obtain the desired Ry‐ how?

– Take FT on both sides:

Designing autocorrelations functions in Matlab

It must = to any integer of pi for every wx wyif we want zero‐phase filters….

Page 39: EECS 556 –Image Processing– W 09 Spectral Estimation …web.eecs.umich.edu/~silvio/teaching/EECS556_2009/lectures/lecture... · Spectral Estimation and Wiener Filtering ... •

2nd‐order statistics

• Autocorrelation is important but does not uniquely determine the properties of a random process

Page 40: EECS 556 –Image Processing– W 09 Spectral Estimation …web.eecs.umich.edu/~silvio/teaching/EECS556_2009/lectures/lecture... · Spectral Estimation and Wiener Filtering ... •

2nd‐order statistics

• Autocorrelation is important but does not uniquely determine the properties of a random process

Page 41: EECS 556 –Image Processing– W 09 Spectral Estimation …web.eecs.umich.edu/~silvio/teaching/EECS556_2009/lectures/lecture... · Spectral Estimation and Wiener Filtering ... •
Page 42: EECS 556 –Image Processing– W 09 Spectral Estimation …web.eecs.umich.edu/~silvio/teaching/EECS556_2009/lectures/lecture... · Spectral Estimation and Wiener Filtering ... •

2nd‐order statistics

• X = white Gaussian noise 

• h[n,m] = separable filter  = g(n)g(m) 

• g(n) = [1 1 1 1 1].

x[n,m] y[n,m]

Page 43: EECS 556 –Image Processing– W 09 Spectral Estimation …web.eecs.umich.edu/~silvio/teaching/EECS556_2009/lectures/lecture... · Spectral Estimation and Wiener Filtering ... •

2nd‐order statistics

x[n,m] y[n,m]

25

Page 44: EECS 556 –Image Processing– W 09 Spectral Estimation …web.eecs.umich.edu/~silvio/teaching/EECS556_2009/lectures/lecture... · Spectral Estimation and Wiener Filtering ... •

2nd‐order statistics

where x[n,m] is an i.i.d. Bernoulli random process:

Why is Rz = Ry?    [Class exercise!]

Page 45: EECS 556 –Image Processing– W 09 Spectral Estimation …web.eecs.umich.edu/~silvio/teaching/EECS556_2009/lectures/lecture... · Spectral Estimation and Wiener Filtering ... •

EECS 556 – Image Processing– W 09

Next lecture

• Intro restoration

Page 46: EECS 556 –Image Processing– W 09 Spectral Estimation …web.eecs.umich.edu/~silvio/teaching/EECS556_2009/lectures/lecture... · Spectral Estimation and Wiener Filtering ... •