digital image processing week vi

39
Digital Image Processing Week VI Thurdsak LEAUHATONG Image Restoration

Upload: athena-thompson

Post on 02-Jan-2016

45 views

Category:

Documents


0 download

DESCRIPTION

Image Restoration. Digital Image Processing Week VI. Thurdsak LEAUHATONG. The Image Enhancement vs Restoration. The Concept. Enhancement. Manipulate the image so that it is suitable for a specific application. Original Image. Enhanced Image. The Image Enhancement vs Restoration. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Digital Image Processing Week VI

Digital Image Processing Week VI

Thurdsak LEAUHATONG

Image RestorationImage Restoration

Page 2: Digital Image Processing Week VI

• Manipulate the image so that it is suitable for a specific application.

• The Concept

•The Image Enhancement vs Restoration

Enhancement

Original Image Enhanced Image

Page 3: Digital Image Processing Week VI

• Restore a degraded image back to the original image.

• The Concept

•The Image Enhancement vs Restoration

Restoration

Degraded Image Original Image

Page 4: Digital Image Processing Week VI

• Model•The Image Degradation

,f x y

Degradation Fiilter

,H u v

,h x y

, ,F u v H u v

, ,f x y h x y

+

,

,

b x y

B u v

DegradedImage

OriginalImage

BlurredImage

AdditiveNoise

,g x y

, , , ,

, , , ,

g x y f x y h x y b x y

G u v F u v H u v B u v

Page 5: Digital Image Processing Week VI

• Model•The Image Degradation

Degraded Image ,g x y

, , , ,

, , ,

, , , ,

i j

g x y f x y h x y b x y

f x i y j h i j b x y

G u v F u v H u v B u v

Page 6: Digital Image Processing Week VI

•The Image Restoration Process

Restoration

Fiilter

DegradedImage

,g x y

,G u v

,w x y

,W u v

DegradedImage

ˆ , , ,f x y g x y w x y

ˆ , , ,F u v G u v W u v

Page 7: Digital Image Processing Week VI

• The Fourier transform of the additive white noise is constant and equal to .

• Frequency Property•Additive White Noise

0, ,2

FT Nb x y B u v

AdditiveWhiteNoise

0 / 2N

Page 8: Digital Image Processing Week VI

• Frequency Property•Additive White Noise

0

2

N

,B u v

0

2

N

,B u v

The ideal white noise contains all frequencies.

The practical white noise is a band-limited signal.

Page 9: Digital Image Processing Week VI

• Autocorrelation function of white noise

Property of Spatial Domain•Additive White Noise

AdditiveWhiteNoise

0

, , ,

, ,

,2

R x y b x y b x y

b x y b x x y y dx dy

Nx y

Page 10: Digital Image Processing Week VI

Property of Spatial Domain•Additive White Noise

0 ,2

Nx y

,R x y

If drops quickly with x and y, then changes quickly with position.

of additive white noise is impulse function, then the additive noise at a pixel is independent from the other pixels.

,R x y ,b x y

,R x y

Page 11: Digital Image Processing Week VI

• The additive white noise cannot be predicted but can be approximately described in statistical way using the probability density function (PDF).

•Statistic Model of Additive White Noise

1

if

0 otherwise

a z bp z b a

22,2 12

b aa b

Uniform

2 2/21

2z a bp z e

b 2,a b Gaussian

for

for

0 otherwise

a

b

P z a

p z P z b

b a

2 22

,a b

a b

aP bP

a P b P

Salt&Pepper

2 2ln /21

20

z a bp z ebz

z

2 2 2/2 2 2, 1a b b a be e e Lognormal

Page 12: Digital Image Processing Week VI

•Statistic Model of Additive White Noise

2 /2

0 z<a

z a bz a e z ap z b

2 4/ 4,

4

ba b

Rayleigh

0

0 0

azae zp z

z

22

1 1,

a a Exponential

1

1 !

0

b baza z

p z eb

z

22

,b b

a a Erlang

(Gamma)

Page 13: Digital Image Processing Week VI

•Statistic Model of Additive White Noise

Page 14: Digital Image Processing Week VI

•Statistic Model of Additive White Noise

Original image

Histogram

Degraded images

),(),(),( yxyxfyxg

Page 15: Digital Image Processing Week VI

•Statistic Model of Additive White Noise

Original image

Histogram

Degraded images

),(),(),( yxyxfyxg

Page 16: Digital Image Processing Week VI

Periodic Noise

Periodic noise looks like dotsIn the frequencydomain

Page 17: Digital Image Processing Week VI

Estimation of Noise

We cannot use the image histogram to estimate noise PDF.

It is better to use the histogram of one areaof an image that has constant intensity to estimate noise PDF.

Page 18: Digital Image Processing Week VI

Periodic Noise Reduction by Freq. Domain Filtering

Band reject filter Restored image

Degraded image DFT

Periodic noisecan be reduced bysetting frequencycomponentscorresponding to noise to zero.

Page 19: Digital Image Processing Week VI

Band Reject Filters

Use to eliminate frequency components in some bands

Periodic noise from theprevious slide that is Filtered out.

Page 20: Digital Image Processing Week VI

Notch Reject Filters A notch reject filter is used to eliminate some frequency components.

Page 21: Digital Image Processing Week VI

Notch Reject Filter:

Degraded image DFTNotch filter

(freq. Domain)

Restored imageNoise

Page 22: Digital Image Processing Week VI

Example: Image Degraded by Periodic Noise Degraded image

DFT(no shift)

Restored imageNoiseDFT of noise

Page 23: Digital Image Processing Week VI

Chapter 5Image Restoration

Chapter 5Image Restoration

Page 24: Digital Image Processing Week VI

Mean Filters

Arithmetic mean filter or moving average filter (from Chapter 3)

xySts

tsgmn

yxf),(

),(1

),(ˆ

Geometric mean filter

mn

Sts xy

tsgyxf

1

),(

),(),(ˆ

mn = size of moving window

Degradation model:

),(),(),(),( yxyxhyxfyxg

To remove this part

Page 25: Digital Image Processing Week VI

Geometric Mean Filter: Example

Original image

Image corrupted by AWGN

Image obtained

using a 3x3geometric mean filter

Image obtained

using a 3x3arithmetic mean filter

AWGN: Additive White Gaussian Noise

Page 26: Digital Image Processing Week VI

Harmonic and Contraharmonic Filters

Harmonic mean filter

xySts tsg

mnyxf

),( ),(1

),(ˆ

Contraharmonic mean filter

xy

xy

Sts

Q

Sts

Q

tsg

tsg

yxf

),(

),(

1

),(

),(

),(ˆ

mn = size of moving window

Works well for salt noisebut fails for pepper noise

Q = the filter order

Positive Q is suitable for eliminating pepper noise.Negative Q is suitable for eliminating salt noise.

Page 27: Digital Image Processing Week VI

Contraharmonic Filters: Example

Image corrupted by pepper noise with prob. = 0.1

Image corrupted

by salt noise with prob. = 0.1

Image obtained

using a 3x3contra-

harmonic mean filter

With Q = 1.5

Image obtained

using a 3x3contra-

harmonic mean filter

With Q=-1.5

Page 28: Digital Image Processing Week VI

Contraharmonic Filters: Incorrect Use Example

Image corrupted by pepper noise with prob. = 0.1

Image corrupted

by salt noise with prob. = 0.1

Image obtained

using a 3x3contra-

harmonic mean filter

With Q=-1.5

Image obtained

using a 3x3contra-

harmonic mean filterWith Q=1.5

Page 29: Digital Image Processing Week VI

Order-Statistic Filters: Revisit

subimage

Original image

Moving window

Statistic parametersMean, Median, Mode, Min, Max, Etc.

Output image

Page 30: Digital Image Processing Week VI

Order-Statistics FiltersMedian filter

),(median),(ˆ),(

tsgyxfxySts

Max filter

),(max),(ˆ),(

tsgyxfxySts

Min filter

),(min),(ˆ),(

tsgyxfxySts

Midpoint filter

),(min),(max2

1),(ˆ

),(),(tsgtsgyxf

xyxy StsSts

Reduce “dark” noise (pepper noise)

Reduce “bright” noise (salt noise)

Page 31: Digital Image Processing Week VI

Median Filter : How it works

A median filter is good for removing impulse, isolated noise

Degraded image

Salt noise

Pepper noise

Movingwindow

Sorted array

Salt noisePepper noise

Median

Filter output

Normally, impulse noise has high magnitude and is isolated. When we sort pixels in the moving window, noise pixels are usually at the ends of the array.

Page 32: Digital Image Processing Week VI

Median Filter : Example

Image corrupted

by salt-and-pepper

noise with pa=pb= 0.1

Images obtained using a 3x3 median filter

1

4

2

3

Page 33: Digital Image Processing Week VI

Max and Min Filters: Example

Image corrupted by pepper noise with prob. = 0.1

Image corrupted

by salt noise with prob. = 0.1

Image obtained

using a 3x3max filter

Image obtained

using a 3x3min filter

Page 34: Digital Image Processing Week VI

Adaptive Filter

-Filter behavior depends on statistical characteristics of local areas inside mxn moving window

- More complex but superior performance compared with “fixed” filters

Statistical characteristics:

General concept:

xySts

L tsgmn

m),(

),(1

Local mean:

Local variance:

xySts

LL mtsgmn ),(

22 )),((1

2

Noise variance:

Page 35: Digital Image Processing Week VI

Adaptive, Local Noise Reduction FilterPurpose: want to preserve edges

1. If sh2 is zero, No noise

the filter should return g(x,y) because g(x,y) = f(x,y)

2. If sL2 is high relative to sh

2, Edges (should be preserved), the filter should return the value close to g(x,y)

3. If sL2 = sh

2, Areas inside objectsthe filter should return the arithmetic mean value mL

LL

myxgyxgyxf ),(),(),(ˆ2

2

Formula:

Concept:

Page 36: Digital Image Processing Week VI

Adaptive Noise Reduction Filter: Example

Image corrupted by additiveGaussian noise with zero mean

and s2=1000

Imageobtained

using a 7x7arithmeticmean filter

Imageobtained

using a 7x7geometricmean filter

Imageobtained

using a 7x7adaptive

noise reduction

filter

Page 37: Digital Image Processing Week VI

Algorithm: Level A: A1= zmedian – zmin

A2= zmedian – zmax

If A1 > 0 and A2 < 0, goto level BElse increase window size

If window size <= Smax repeat level AElse return zxy

Level B: B1= zxy – zmin

B2= zxy – zmax

If B1 > 0 and B2 < 0, return zxy

Else return zmedian

Adaptive Median Filter

zmin = minimum gray level value in Sxy

zmax = maximum gray level value in Sxy

zmedian = median of gray levels in Sxy

zxy = gray level value at pixel (x,y)Smax = maximum allowed size of Sxy

where

Purpose: want to remove impulse noise while preserving edges

Page 38: Digital Image Processing Week VI

Level A: A1= zmedian – zmin

A2= zmedian – zmax

Else Window is not big enough increase window sizeIf window size <= Smax repeat level A

Else return zxy

zmedian is not an impulse

B1= zxy – zmin

B2= zxy – zmax

If B1 > 0 and B2 < 0, zxy is not an impulse return zxy to preserve original details

Else return zmedian to remove impulse

Adaptive Median Filter: How it works

If A1 > 0 and A2 < 0, goto level B

Level B:

Determine whether zmedian

is an impulse or not

Determine whether zxy

is an impulse or not

Page 39: Digital Image Processing Week VI

Adaptive Median Filter: Example

Image corrupted by salt-and-pepper

noise with pa=pb= 0.25

Image obtained using a 7x7median filter

Image obtained using an adaptivemedian filter with

Smax = 7

More small details are preserved