3.7 adaptive filtering

32
3.7 Adaptive filtering Joonas Vanninen Antonio Palomino Alarcos

Upload: lynn-nelson

Post on 01-Jan-2016

50 views

Category:

Documents


0 download

DESCRIPTION

3.7 Adaptive filtering. Joonas Vanninen Antonio Palomino Alarcos. Adaptive filtering. Linear filtering does not take into account the local features of the image Causes for example blurring of the edges - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: 3.7 Adaptive filtering

3.7 Adaptive filtering

Joonas VanninenAntonio Palomino Alarcos

Page 2: 3.7 Adaptive filtering

Adaptive filtering

• Linear filtering does not take into account the local features of the image– Causes for example blurring of the edges

• An improvement: change the filter parameters according to the local statistics– Change the shape and the size of the

neighborhood– Suppress the filtering if there are features that we

want to preserve in the neighborhood

Page 3: 3.7 Adaptive filtering

Filters

• The local LMMSE filter• The noise-updating repeated Wiener filter• The adaptive 2D LMS filter• The adaptive rectangular window LMS filter• The adaptive-neighborhood filter

Page 4: 3.7 Adaptive filtering

The local LMMSE filter

• Local Linear Minimum Mean Squared Error filter, also known as the adaptive Wiener filter

• Assumes that the image is corrupted by additive noise• Minimizes the local mean squared error by applying a linear

operator to each pixel in the image• The local mean and variance are estimated from a rectangular

window around the pixel

Page 5: 3.7 Adaptive filtering

LLMMSE estimation

),(),(),(

),(),(),(),(

~2

22

nmnmgnm

nmnmnmnmf g

g

gg

•g is the corrupted image•μg is the local mean•σg

2 is the local variance•ση

2 is the variance•Constant if noise is signal-independent•Varies if noise is signal-dependent•In the latter case it should be estimated locally with the knowledge of the type of the noise

Page 6: 3.7 Adaptive filtering

MSE=1595

MSE=360

MSE=324

Page 7: 3.7 Adaptive filtering

Interpretation of the equation

• If the area processed is uniform, the second term is small– Estimate is near the local mean of the noisy image– Noise is reduced

• If there is a edge in the processing window, the variance of the image is larger than the variance of the noise– Estimate is closer to the actual noisy value– Edge doesn’t get blurred

),(),(),(

),(),(),(),(

~2

22

nmnmgnm

nmnmnmnmf g

g

gg

Page 8: 3.7 Adaptive filtering

A refined version

• If the local variance is high, it is assumed that there is an edge in the processing window

• The edge is assumed to be straight in a small window• The direction of the edge is calculated

– Gradient operator– 8 different directions

• The processing window is divided to two uniform sub-areas over the edge

• The statistics in the sub-area that holds processed pixel are used

• Noise is reduced near the edges without causing blurring

Page 9: 3.7 Adaptive filtering

Sub-areas

Page 10: 3.7 Adaptive filtering

The noise-updating repeated Wiener Filter

• An iterative application of the LLMMSE filter• The variance of noise used in the LLMMSE estimate formula

is updated in each iteration

Q

Qqqp

P

Ppg

gg

new

qnpmnm

nm

QP

nmnm

nm

QPnm

nmnm

),(),(

),(

)12)(12(

1

),(),(

),(

)12)(12(

1

),(

),(1),(

2

)0,0(),(

2

2

2

2

2

2

2

2

22

• The noise is reduced even near the edges

• To avoid blurring, a smaller window size may be choosen for each iteration

Page 11: 3.7 Adaptive filtering

The Adaptative 2D LMS Filter

Page 12: 3.7 Adaptive filtering

Why?

• Wiener filter has to be used with stationary and statistically independent signal and noise models

• Adaptative 2D LMS algorithm circunvent this problem– It takes into account the nonstationarity of the

given image

Page 13: 3.7 Adaptive filtering

2D LMS Algorithm

• Same concept: fixed-window Wiener filter• New idea: filter coefficients vary depending

upon the image characteristics– Algorithm based on the steepest descent method– It tracks the variations in the local statistics

adapting to the changes in the images

Page 14: 3.7 Adaptive filtering

1

0

1

0

),(),(),(~ P

p

P

ql qmpmgqpwnmf

• Estimate of the original pixel value f(m,n):

– Convolution

– wl(p,q) Ξ causal FIR filter

– g(m,n) Ξ noise-corrupted input image

Page 15: 3.7 Adaptive filtering

Updating for the filter coefficients

• New coefficients determined by minimazing MSE between f(m,n) and the estimation

• Steepest descent method:

– μ controls the rate of convergence and filter stability.– Error is estimated using an approximation to the original signal d(m,n)

– d(m,n) obtained by decorrelation from the input image g(m,n)• 2D delay operator of (1,1) samples, use the previous pixel as an estimate

),(~

),( nmfnmdel

21 ),(),( lll eqpwqpw

Page 16: 3.7 Adaptive filtering

Advantages of the Algorithm

• It does not require a priori information about:– Image– Noise statistics– Correlation properties

• It does not require averaging, differentiation and matrix operations

Page 17: 3.7 Adaptive filtering

Image corrupted with additive Gaussian noise

50 100 150 200 250

50

100

150

200

250

Original image

50 100 150 200 250

50

100

150

200

250

Image filtered with adaptive 2D LMS filter

50 100 150 200 250

50

100

150

200

250

MSE=1590

MSE=395

Page 18: 3.7 Adaptive filtering

The Adaptative Rectangular Window LMS Filter

Page 19: 3.7 Adaptive filtering

ARW LMS Algorithm

• Same concept: 2D LMS filter based on standard Wiener filter

• New Idea: use of an adaptative-sized rectangular window

• Additional assumption: image processes have zero mean

Page 20: 3.7 Adaptive filtering

Implementation

• Taking into account that now we have zero mean noise, following estimate is derived:

• σf2 is the variance of the original image (estimated)

• Idea: globally nonstationary process can be considered locally stationary and ergodic over small regions

• Target: to identify the size of a stationary square region for each pixel in the image– Sample statistics can approximate the a posteriori pareameters

needed

Page 21: 3.7 Adaptive filtering

Updating the window size

• Large window It may include pixels form other ensembles

• Small window The statistics needed are poorly estimated

• ARW lengths (Lr and Lc) are varied using a signal activity parameter:

• A similar signal activity parameter is defined in the colum direction

Nr

Nrp

Nc

Ncqrr qnpmg

LrLcnmS 22~),(

1),(

Page 22: 3.7 Adaptive filtering

Updating the window size (II)

TSNN

TSNN

,1

,1

• If S is large N is decremented• If S is small N is incremented

• In order to make this decision, S is compared to a threshold T as follows:

• Threshold is defined as:

• κ controls the rate at which T changes

LT

2

Page 23: 3.7 Adaptive filtering

The adaptive-neighborhood filter

• Uses a variable-size, variable-shape neighborhood determined individually for every pixel

• Neighborhood contains only spatially connected pixels that are similar to the seed

• This way the estimated statistics are likely to be closer to the true statistics of the signal

• Adaptive neighbourhoods should not mix the pixels of an object with the pixels of the background → no blurring of the edges

Page 24: 3.7 Adaptive filtering

Region growing• The absolute difference between each of the 8-

neighbor pixels of the region and the seed is calculated

• If the value is under a threshold T, pixel is included in the region

• The process is iterated until there are no new pixels• Additionally a background region is grown by

expanding the foreground boundary by a prespecified number of pixels

• The regions are grown for each pixel in the image

Page 25: 3.7 Adaptive filtering

•An example of region growing

•The same neighborhood can be used for every pixel in the area with the same gray-value

Page 26: 3.7 Adaptive filtering

Adaptive-neighborhood mean and median filters

• The mean and median values of adaptive neighborhoods can be used to filter noise

• They provide a larger population to compute local statistics than fixed 3 x 3 or 5 x 5 windows

• Edge distortion is pervented because the neighbourhood does not cross object boundaries

Page 27: 3.7 Adaptive filtering

Adaptive-neighborhood noise subtraction (ANNS)

• Used for removing additive signal-independent noise• Estimates the noise value in the seed pixel with an adaptive

neighborhood and subtracts it to obtain an estimate of the original

),(),(),(),(

),(1),(),(

~22

2

nmnmgnmnm

nmnmnmf g

fg

•The local statistics are estimated as in the ARW-LMS –filter

Page 28: 3.7 Adaptive filtering

Implementation

• A maximum foreground limit of Q pixels is set.• At first, the tolerance is set to the full dynamic range• An estimate of the variance of the uncorrupted

signal is calculated from the neighborhood• It is compared to the noise variance, and if σf

2 > 2ση2,

it is assumed that the neighbourhood contains a significant feature

• If so, the tolerance is modified by T = 2 σf2

Page 29: 3.7 Adaptive filtering

Implementation (II)

• If the foreground has only one pixel, the neighborhood is enlarged to include the backround around it (3 x 3)

• Flat regions → σf2 << 2ση

2 → foreground will grow to Q

• Busy regions → σf2 >> 2ση

2 → tolerance will be reduced

Page 30: 3.7 Adaptive filtering

Conclusion• Use of local statistics in an adaptive filter is a powerful

approach to remove noise– while retaining the edges in the images with minimal

distortion• Some of the implicit assumptions may not apply well to the

image or noise processes– It is common to try several previously established

techniques• It is quite difficult to compare the results provided by

different filters– Generally MSE or RMS error is used– In real applications, it is important to obtain an

assessment of the results by a specialist

Page 31: 3.7 Adaptive filtering

Quote

“You can only cure retail but you can prevent wholesale”

Brock Chisholm

Page 32: 3.7 Adaptive filtering

…any question?