digital image processing week vi

Post on 02-Jan-2016

46 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

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

Digital Image Processing Week VI

Thurdsak LEAUHATONG

Image RestorationImage Restoration

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

• The Concept

•The Image Enhancement vs Restoration

Enhancement

Original Image Enhanced Image

• Restore a degraded image back to the original image.

• The Concept

•The Image Enhancement vs Restoration

Restoration

Degraded Image Original Image

• 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

• 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

•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

• 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

• 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.

• 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

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

• 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

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

•Statistic Model of Additive White Noise

•Statistic Model of Additive White Noise

Original image

Histogram

Degraded images

),(),(),( yxyxfyxg

•Statistic Model of Additive White Noise

Original image

Histogram

Degraded images

),(),(),( yxyxfyxg

Periodic Noise

Periodic noise looks like dotsIn the frequencydomain

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.

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.

Band Reject Filters

Use to eliminate frequency components in some bands

Periodic noise from theprevious slide that is Filtered out.

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

Notch Reject Filter:

Degraded image DFTNotch filter

(freq. Domain)

Restored imageNoise

Example: Image Degraded by Periodic Noise Degraded image

DFT(no shift)

Restored imageNoiseDFT of noise

Chapter 5Image Restoration

Chapter 5Image Restoration

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

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

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.

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

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

Order-Statistic Filters: Revisit

subimage

Original image

Moving window

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

Output image

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)

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.

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

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

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:

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:

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

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

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

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

top related