Denoising - cse.sc.eduyiannisr/590/2018/Lectures/09-Denoising.pdf• Salt noise Fail for the pepper...

40
Ioannis Rekleitis Denoising

Transcript of Denoising - cse.sc.eduyiannisr/590/2018/Lectures/09-Denoising.pdf• Salt noise Fail for the pepper...

Page 1: Denoising - cse.sc.eduyiannisr/590/2018/Lectures/09-Denoising.pdf• Salt noise Fail for the pepper noise Q is the order of the 3ilter • positive Q removes pepper noise • negative

Ioannis Rekleitis

Denoising

Page 2: Denoising - cse.sc.eduyiannisr/590/2018/Lectures/09-Denoising.pdf• Salt noise Fail for the pepper noise Q is the order of the 3ilter • positive Q removes pepper noise • negative

ImageDegrada*onandRestora*on

http://fireoracleproductions.com/services__samples

Google image

Image degradation due to •  noise in transmission •  imperfect image acquisition

•  environmental condition •  quality of sensor

CSCE 590: Introduction to Image Processing 2 Slides courtesy of Prof. Yan Tong

Page 3: Denoising - cse.sc.eduyiannisr/590/2018/Lectures/09-Denoising.pdf• Salt noise Fail for the pepper noise Q is the order of the 3ilter • positive Q removes pepper noise • negative

Proper*esofNoise

•  Spatialproperties– Spatiallyperiodicnoise– Spatiallyindependentnoise

•  Frequencyproperties– Whitenoise–noisecontainingallfrequencieswithinabandwidth

CSCE 590: Introduction to Image Processing 3 Slides courtesy of Prof. Yan Tong

Page 4: Denoising - cse.sc.eduyiannisr/590/2018/Lectures/09-Denoising.pdf• Salt noise Fail for the pepper noise Q is the order of the 3ilter • positive Q removes pepper noise • negative

ImageRestora*onwithAddi*veNoise

),(),(),(),(),(),(vuNvuFvuGyxyxfyxg

+=

+= η

Noisemodels:•  Impulsenoise:pepperandsalt•  Continuousnoisemodel:

•  Gaussian,Rayleigh,Gamma,Exponential,Uniform

CSCE 590: Introduction to Image Processing 4 Slides courtesy of Prof. Yan Tong

Page 5: Denoising - cse.sc.eduyiannisr/590/2018/Lectures/09-Denoising.pdf• Salt noise Fail for the pepper noise Q is the order of the 3ilter • positive Q removes pepper noise • negative

ImageRestora*onwithAddi*veNoise

),(),(),(),(),(),(vuNvuFvuGyxyxfyxg

+=

+= η

Noisemodels:•  Impulsenoise:pepperandsalt•  Continuousnoisemodel:

•  Gaussian,Rayleigh,Gamma,Exponential,Uniform

CSCE 590: Introduction to Image Processing 5 Slides courtesy of Prof. Yan Tong

Page 6: Denoising - cse.sc.eduyiannisr/590/2018/Lectures/09-Denoising.pdf• Salt noise Fail for the pepper noise Q is the order of the 3ilter • positive Q removes pepper noise • negative

Some Important Noise Model

2

2

2)(

21)( σ

σπ

zz

ezp−

=

http://www.gergltd.com/cse486/project2/ •  Due to electronic circuit •  Due to the image sensor

•  poor illumination •  high temperature

CSCE 590: Introduction to Image Processing 6 Slides courtesy of Prof. Yan Tong

Page 7: Denoising - cse.sc.eduyiannisr/590/2018/Lectures/09-Denoising.pdf• Salt noise Fail for the pepper noise Q is the order of the 3ilter • positive Q removes pepper noise • negative

Some Important Noise Model

⎪⎩

⎪⎨

<

≥−=

−−

az

azeazbzp

baz

0

)(2)(

2)(

⎪⎩

⎪⎨

<

≥−=

−−

00

0)!1()(

1

z

zebza

zpaz

bb

Rayleigh noise •  range imaging •  Background model for Magnetic Resonance Imaging (MRI) images

Gamma noise •  laser imaging

CSCE 590: Introduction to Image Processing 7 Slides courtesy of Prof. Yan Tong

Page 8: Denoising - cse.sc.eduyiannisr/590/2018/Lectures/09-Denoising.pdf• Salt noise Fail for the pepper noise Q is the order of the 3ilter • positive Q removes pepper noise • negative

Some Important Noise Model

⎪⎪⎩

⎪⎪⎨

=

=

=

Otherwise0

for for

)(bzPazP

zP b

a

⎩⎨⎧

<

≥=

000

)(zzae

zPaz

⎪⎩

⎪⎨⎧ ≤≤−=

otherwise

bzaabzP0

1)(

Exponential noise •  laser imaging

Impulse noise •  salt and pepper noise •  A/D converter error •  bit error in transmission

Uniform noise

CSCE 590: Introduction to Image Processing 8 Slides courtesy of Prof. Yan Tong

Page 9: Denoising - cse.sc.eduyiannisr/590/2018/Lectures/09-Denoising.pdf• Salt noise Fail for the pepper noise Q is the order of the 3ilter • positive Q removes pepper noise • negative

An Example

What is its histogram?

CSCE 590: Introduction to Image Processing 9 Slides courtesy of Prof. Yan Tong

Page 10: Denoising - cse.sc.eduyiannisr/590/2018/Lectures/09-Denoising.pdf• Salt noise Fail for the pepper noise Q is the order of the 3ilter • positive Q removes pepper noise • negative

An Example (cont.)

CSCE 590: Introduction to Image Processing 10 Slides courtesy of Prof. Yan Tong

Page 11: Denoising - cse.sc.eduyiannisr/590/2018/Lectures/09-Denoising.pdf• Salt noise Fail for the pepper noise Q is the order of the 3ilter • positive Q removes pepper noise • negative

An Example (cont.)

CSCE 590: Introduction to Image Processing 11 Slides courtesy of Prof. Yan Tong

Page 12: Denoising - cse.sc.eduyiannisr/590/2018/Lectures/09-Denoising.pdf• Salt noise Fail for the pepper noise Q is the order of the 3ilter • positive Q removes pepper noise • negative

Estimation of Noise Parameters

Take a small stripe of the background, do statistics for the mean and variance.

CSCE 590: Introduction to Image Processing 12 Slides courtesy of Prof. Yan Tong

Page 13: Denoising - cse.sc.eduyiannisr/590/2018/Lectures/09-Denoising.pdf• Salt noise Fail for the pepper noise Q is the order of the 3ilter • positive Q removes pepper noise • negative

Mean Filters for Continuous Noise Models

Arithmetic Mean Filter: a linear filter

∑∈

=xySts

tsgmn

yxf),(

),(1),(ˆ

),( yxxyS

m

n

CSCE 590: Introduction to Image Processing 13 Slides courtesy of Prof. Yan Tong

Page 14: Denoising - cse.sc.eduyiannisr/590/2018/Lectures/09-Denoising.pdf• Salt noise Fail for the pepper noise Q is the order of the 3ilter • positive Q removes pepper noise • negative

Non-linear Mean Filters

Geometric Mean Filter

Harmonic Mean Filter

Contraharmonic Mean Filter

CSCE 590: Introduction to Image Processing 14 Slides courtesy of Prof. Yan Tong

Page 15: Denoising - cse.sc.eduyiannisr/590/2018/Lectures/09-Denoising.pdf• Salt noise Fail for the pepper noise Q is the order of the 3ilter • positive Q removes pepper noise • negative

Non-linear Mean Filters

Geometric Mean Filter

Harmonic Mean Filter

Contraharmonic Mean Filter

mn

Sts xy

tsgyxf

1

),(

),(),(ˆ⎥⎥⎦

⎢⎢⎣

⎡= ∏

∑∈

=

xySts tsgmn

yxf

),( ),(11

1),(ˆ

+

=

xy

xy

Sts

QSts

Q

tsg

tsgyxf

),(

),(

1

),(

),(),(ˆ

Workwellfor•  Continuousnoise• Saltnoise

Failforthepeppernoise

Qistheorderofthe3ilter•  positiveQremovespeppernoise•  negativeQremovessaltnoise•  Specialcases:Q=0,Q=-1

CSCE 590: Introduction to Image Processing 15 Slides courtesy of Prof. Yan Tong

Page 16: Denoising - cse.sc.eduyiannisr/590/2018/Lectures/09-Denoising.pdf• Salt noise Fail for the pepper noise Q is the order of the 3ilter • positive Q removes pepper noise • negative

Mean Filter

Geometric Mean Filter

mn

Sts xy

tsgyxf

1

),(

),(),(ˆ⎥⎥⎦

⎢⎢⎣

⎡= ∏

• Removingthesaltnoise• Failinthepeppernoise

r a b

CSCE 590: Introduction to Image Processing 16 Slides courtesy of Prof. Yan Tong

Page 17: Denoising - cse.sc.eduyiannisr/590/2018/Lectures/09-Denoising.pdf• Salt noise Fail for the pepper noise Q is the order of the 3ilter • positive Q removes pepper noise • negative

An Example

CSCE 590: Introduction to Image Processing 17 Slides courtesy of Prof. Yan Tong

Page 18: Denoising - cse.sc.eduyiannisr/590/2018/Lectures/09-Denoising.pdf• Salt noise Fail for the pepper noise Q is the order of the 3ilter • positive Q removes pepper noise • negative

An Example Pepper noise Salt noise

Q=1.5 Q=-1.5

CSCE 590: Introduction to Image Processing 18 Slides courtesy of Prof. Yan Tong

Page 19: Denoising - cse.sc.eduyiannisr/590/2018/Lectures/09-Denoising.pdf• Salt noise Fail for the pepper noise Q is the order of the 3ilter • positive Q removes pepper noise • negative

A Failed Case with Wrong Sign of Contraharmonic Filter

CSCE 590: Introduction to Image Processing 19 Slides courtesy of Prof. Yan Tong

Page 20: Denoising - cse.sc.eduyiannisr/590/2018/Lectures/09-Denoising.pdf• Salt noise Fail for the pepper noise Q is the order of the 3ilter • positive Q removes pepper noise • negative

Order-Statistic Filters -- Median Filter

Repeating median filter will remove most of the noise while increase image blurring

CSCE 590: Introduction to Image Processing 20 Slides courtesy of Prof. Yan Tong

Page 21: Denoising - cse.sc.eduyiannisr/590/2018/Lectures/09-Denoising.pdf• Salt noise Fail for the pepper noise Q is the order of the 3ilter • positive Q removes pepper noise • negative

Order-Statistic Filters -- Max/Min Filters

•  Find the extreme points •  Remove the targeting impulse noise

CSCE 590: Introduction to Image Processing 21 Slides courtesy of Prof. Yan Tong

Page 22: Denoising - cse.sc.eduyiannisr/590/2018/Lectures/09-Denoising.pdf• Salt noise Fail for the pepper noise Q is the order of the 3ilter • positive Q removes pepper noise • negative

Order-Sta*s*cFilters•  MidpointLilter– Combineorderstatisticsandaveraging– Worksbestforrandomlydistributednoise,likeGaussianoruniformnoise

– Notsuitableforimpulsenoiseandblurtheboundary

• 

⎥⎦⎤

⎢⎣⎡ +=

∈∈)},({min)},({max

21),(ˆ

),(),(tsgtsgyxf

xyxy StsSts

Random noise Salt noise Pepper noise http://www.digimizer.com/manual/m-image-filtermid.php CSCE 590: Introduction to Image Processing 22

Slides courtesy of Prof. Yan Tong

Page 23: Denoising - cse.sc.eduyiannisr/590/2018/Lectures/09-Denoising.pdf• Salt noise Fail for the pepper noise Q is the order of the 3ilter • positive Q removes pepper noise • negative

Order-Sta*s*cFilters

•  Alpha-trimmedmeanLilter– Deleted/2lowestandd/2highestintensityvalues– AbalancebetweenarithmeticmeanLilterandmedianLilter

– Suitableforcombinedsalt-and-pepperandGaussiannoise

∑∈−

=xyStsr tsg

dmnyxf

),(),(1),(ˆ

CSCE 590: Introduction to Image Processing 23 Slides courtesy of Prof. Yan Tong

Page 24: Denoising - cse.sc.eduyiannisr/590/2018/Lectures/09-Denoising.pdf• Salt noise Fail for the pepper noise Q is the order of the 3ilter • positive Q removes pepper noise • negative

Example

CSCE 590: Introduction to Image Processing 24 Slides courtesy of Prof. Yan Tong

Page 25: Denoising - cse.sc.eduyiannisr/590/2018/Lectures/09-Denoising.pdf• Salt noise Fail for the pepper noise Q is the order of the 3ilter • positive Q removes pepper noise • negative

Adap*veFilters

•  AdaptivelocalnoisereductionLilter•  Keyelements:

–  theintensityvalue–  thevarianceofthenoise–  thelocalmeanoftheneighborhood–  thelocalvarianceoftheneighborhood

•  Properties:

–  If,àidealcase

–  Ifislow,preservetheedgeinformation

[ ]LL

myxgyxgyxf −−= ),(),(),(ˆ 2

2

σ

ση

),( yxg2ησ

2Lσ

Lm

02 =ησ ),(),(ˆ yxgyxf =

22 / Lσση),(),(ˆ yxgyxf ≈

CSCE 590: Introduction to Image Processing 25 Slides courtesy of Prof. Yan Tong

Page 26: Denoising - cse.sc.eduyiannisr/590/2018/Lectures/09-Denoising.pdf• Salt noise Fail for the pepper noise Q is the order of the 3ilter • positive Q removes pepper noise • negative

Examples

CSCE 590: Introduction to Image Processing 26 Slides courtesy of Prof. Yan Tong

Page 27: Denoising - cse.sc.eduyiannisr/590/2018/Lectures/09-Denoising.pdf• Salt noise Fail for the pepper noise Q is the order of the 3ilter • positive Q removes pepper noise • negative

Adap*veMedianFilter•  StageA:checkifthemedianvalueisanextremevalue

•  StageB:checkifthecenterpixelisanextremevalue

med

max

maxmed

minmed

output ElseA stagerepeat size windowIf

size window theincrease ElseB stage togo,02 AND01 If

21

zS

AAzzAzzA

<>

−=

−=

med

max

min

output Else

output ,02 AND01 If

2

1

zzBB

zzBzzB

xy

xy

xy

<>

−=

−=

Goal 1: remove salt-and-pepper noise with higher probability

Goal 2: smoothing the noise other than impulses

Goal 3: reduce distortion

CSCE 590: Introduction to Image Processing 27 Slides courtesy of Prof. Yan Tong

Page 28: Denoising - cse.sc.eduyiannisr/590/2018/Lectures/09-Denoising.pdf• Salt noise Fail for the pepper noise Q is the order of the 3ilter • positive Q removes pepper noise • negative

Adaptive Median Filter -- Example

CSCE 590: Introduction to Image Processing 28 Slides courtesy of Prof. Yan Tong

Page 29: Denoising - cse.sc.eduyiannisr/590/2018/Lectures/09-Denoising.pdf• Salt noise Fail for the pepper noise Q is the order of the 3ilter • positive Q removes pepper noise • negative

Mean Filter

Harmonic Mean Filter

∑∈

=

xySts tsgmn

yxf

),( ),(11

1),(ˆ

• Removingthesaltnoise• Failinthepeppernoise

CSCE 590: Introduction to Image Processing 29 Slides courtesy of Prof. Yan Tong

Page 30: Denoising - cse.sc.eduyiannisr/590/2018/Lectures/09-Denoising.pdf• Salt noise Fail for the pepper noise Q is the order of the 3ilter • positive Q removes pepper noise • negative

Mean Filter

Contraharmonic Mean Filter

+

=

xy

xy

Sts

QSts

Q

tsg

tsgyxf

),(

),(

1

),(

),(),(ˆ

Qistheorderofthe3ilter•  positiveQremovespeppernoise•  negativeQremovessaltnoise•  Specialcases:Q=0,Q=-1

CSCE 590: Introduction to Image Processing 30 Slides courtesy of Prof. Yan Tong

Page 31: Denoising - cse.sc.eduyiannisr/590/2018/Lectures/09-Denoising.pdf• Salt noise Fail for the pepper noise Q is the order of the 3ilter • positive Q removes pepper noise • negative

Periodical Noise

Image is corrupted by a set of sinusoidal noise of different frequencies

CSCE 590: Introduction to Image Processing 31 Slides courtesy of Prof. Yan Tong

Page 32: Denoising - cse.sc.eduyiannisr/590/2018/Lectures/09-Denoising.pdf• Salt noise Fail for the pepper noise Q is the order of the 3ilter • positive Q removes pepper noise • negative

Es*matetheDegrada*onFunc*on

• Observation• Experimentation• Mathematicalmodeling

CSCE 590: Introduction to Image Processing 32 Slides courtesy of Prof. Yan Tong

Page 33: Denoising - cse.sc.eduyiannisr/590/2018/Lectures/09-Denoising.pdf• Salt noise Fail for the pepper noise Q is the order of the 3ilter • positive Q removes pepper noise • negative

Estimate Degradation Function - Observation

Assumptions:

•  The degradation function is linear and position-invariant

•  No other knowledge about the degradation function

Estimation by image observation:

•  Extract a subimage with strong signal

•  Perform restoration on the subimage

),(ˆ),(),(vuFvuGvuH

s

ss =

Observed subimage

Restored subimage

degradation function in the subimage

),( vuHApplication: restoring old pictures

Higher signal-to-noise ratio

CSCE 590: Introduction to Image Processing 33 Slides courtesy of Prof. Yan Tong

Page 34: Denoising - cse.sc.eduyiannisr/590/2018/Lectures/09-Denoising.pdf• Salt noise Fail for the pepper noise Q is the order of the 3ilter • positive Q removes pepper noise • negative

Estimate Degradation Function - Experimentation

Assumptions: • A similar equipment is available

• Change the system setting can achieve similar degraded images

AvuGvuH ),(),( =

Observed image

Impulse signal

CSCE 590: Introduction to Image Processing 34 Slides courtesy of Prof. Yan Tong

Page 35: Denoising - cse.sc.eduyiannisr/590/2018/Lectures/09-Denoising.pdf• Salt noise Fail for the pepper noise Q is the order of the 3ilter • positive Q removes pepper noise • negative

Estimation by Modeling

6/522 )(),( vukevuH +−=

Modeling the atmospheric turbulence

CSCE 590: Introduction to Image Processing 35 Slides courtesy of Prof. Yan Tong

Page 36: Denoising - cse.sc.eduyiannisr/590/2018/Lectures/09-Denoising.pdf• Salt noise Fail for the pepper noise Q is the order of the 3ilter • positive Q removes pepper noise • negative

Estimation by Modeling – Motion Blur

Constantvelocityalongxandydirection:

Tattx /)(0 = Tbtty /)(0 =

CSCE 590: Introduction to Image Processing 36 Slides courtesy of Prof. Yan Tong

Page 37: Denoising - cse.sc.eduyiannisr/590/2018/Lectures/09-Denoising.pdf• Salt noise Fail for the pepper noise Q is the order of the 3ilter • positive Q removes pepper noise • negative

Estimation by Modeling – Cont.

∫ −−=T

dttyytxxfyxg0 00 )](),([),(

An example of motion blur

Motion in both x and y direction during acquisition

CSCE 590: Introduction to Image Processing 37 Slides courtesy of Prof. Yan Tong

Page 38: Denoising - cse.sc.eduyiannisr/590/2018/Lectures/09-Denoising.pdf• Salt noise Fail for the pepper noise Q is the order of the 3ilter • positive Q removes pepper noise • negative

Estimation by Modeling – Cont.

∫ +−=T tvytuxj dtevuH0

)]()([2 00),( π

An example of motion blur

∫ +−=T tvytuxj dtevuFvuG0

)]()([2 00),(),( π

CSCE 590: Introduction to Image Processing 38 Slides courtesy of Prof. Yan Tong

Page 39: Denoising - cse.sc.eduyiannisr/590/2018/Lectures/09-Denoising.pdf• Salt noise Fail for the pepper noise Q is the order of the 3ilter • positive Q removes pepper noise • negative

Estimation by Modeling – Example

)(

)()](sin[),( vbuaje

vbuavbuaTvuH +−

+

+= π

ππ

Constant velocity along x and y direction:

Tattx /)(0 = Tbtty /)(0 =

WhatisH(u,v)?

CSCE 590: Introduction to Image Processing 39 Slides courtesy of Prof. Yan Tong

Page 40: Denoising - cse.sc.eduyiannisr/590/2018/Lectures/09-Denoising.pdf• Salt noise Fail for the pepper noise Q is the order of the 3ilter • positive Q removes pepper noise • negative

Ques*ons?

CSCE 590: Introduction to Image Processing 40