Nonlocal methods for image processing - UCLAlvese/285j.1.09f/NonlocalMethods_main.slides.pdf ·...

29
Nonlocal methods for image processing Nonlocal methods for image processing Lecture note, Xiaoqun Zhang Oct 30, 2009 1/29

Transcript of Nonlocal methods for image processing - UCLAlvese/285j.1.09f/NonlocalMethods_main.slides.pdf ·...

Page 1: Nonlocal methods for image processing - UCLAlvese/285j.1.09f/NonlocalMethods_main.slides.pdf · Nonlocal methods for image processing ... Applications to Image Processing, UCLA CAM

Nonlocal methods for image processing

Nonlocal methods for image processing

Lecture note, Xiaoqun Zhang

Oct 30, 2009

1/29

Page 2: Nonlocal methods for image processing - UCLAlvese/285j.1.09f/NonlocalMethods_main.slides.pdf · Nonlocal methods for image processing ... Applications to Image Processing, UCLA CAM

Nonlocal methods for image processing

Outline

1 Local smoothing Filters

2 Nonlocal means filter

3 Nonlocal operators

4 Applications

5 References

2/29

Page 3: Nonlocal methods for image processing - UCLAlvese/285j.1.09f/NonlocalMethods_main.slides.pdf · Nonlocal methods for image processing ... Applications to Image Processing, UCLA CAM

Nonlocal methods for image processing

General Model

v(x) = u(x) + n(x), x ∈ Ω

v(x) observed image

u(x) true image

n(x) i.i.d gaussian noise (white noise)

Gaussian kernel

x→ Gh(x) =1

4πh2e−|x|2

4h2

3/29

Page 4: Nonlocal methods for image processing - UCLAlvese/285j.1.09f/NonlocalMethods_main.slides.pdf · Nonlocal methods for image processing ... Applications to Image Processing, UCLA CAM

Nonlocal methods for image processing

Local smoothing Filters

Outline

1 Local smoothing Filters

2 Nonlocal means filter

3 Nonlocal operatorsDenoising by nonlocal functionalsInverse problems by nonlocal regularizationNonlocal regularization with Bregmanized methods

4 ApplicationsCompressive samplingDeconvolutionWavelet Inpainting

5 References

4/29

Page 5: Nonlocal methods for image processing - UCLAlvese/285j.1.09f/NonlocalMethods_main.slides.pdf · Nonlocal methods for image processing ... Applications to Image Processing, UCLA CAM

Nonlocal methods for image processing

Local smoothing Filters

Linear low-pass filter

Idea: average in a local spatial neighborhood

GFh(v)(x) = Gh ∗ v(x) =1

C(x)

∫y∈Ω

v(y) exp‖y−x‖2

4h2 dy

where C(x) = 4πh2

Pro: work well for harmonic function (homogenous region)Con: perform poorly on singular part, namely edge and texture

5/29

Page 6: Nonlocal methods for image processing - UCLAlvese/285j.1.09f/NonlocalMethods_main.slides.pdf · Nonlocal methods for image processing ... Applications to Image Processing, UCLA CAM

Nonlocal methods for image processing

Local smoothing Filters

Anisotropic filter

Idea: average only in the direction orthogonal toDv(x)(∂v(x)

∂x , ∂v(y)∂y ).

AFh(v)(x) =1

C(x)

∫tv(x+ f

Dv(x)⊥

|Dv(x)|) exp

−t2h2 dt

where C(x) = 4πh2.Pro: Avoid blurring effect of Gaussian filter, maintaining edges.Con: perform poorly on flat region, worse there than a Gaussianblur.

6/29

Page 7: Nonlocal methods for image processing - UCLAlvese/285j.1.09f/NonlocalMethods_main.slides.pdf · Nonlocal methods for image processing ... Applications to Image Processing, UCLA CAM

Nonlocal methods for image processing

Local smoothing Filters

Neighboring filter

Spatial neighborhood

Bρ(x) = y ∈ Ω|‖y − x‖ ≤ ρ

Gray-level neighborhood

B(x, h) = y ∈ Ω|‖v(y)− v(x)‖ ≤ ρ

for a given image v. Yaroslavsky filter

Y NFh,ρ =1

C(x)

∫Bρ(x)

u(y)e−|u(y)−u(x)|2

4h2 dy

Bilateral(SUSAN) filter

SUSANh,ρ =1

C(x)

∫u(y)e−

|u(y)−u(x)|2

4h2 e− |y−x|

2

4ρ2 dy

Behave like weighted heat equation, enhancing the edges7/29

Page 8: Nonlocal methods for image processing - UCLAlvese/285j.1.09f/NonlocalMethods_main.slides.pdf · Nonlocal methods for image processing ... Applications to Image Processing, UCLA CAM

Nonlocal methods for image processing

Local smoothing Filters

Denoising example

8/29

Page 9: Nonlocal methods for image processing - UCLAlvese/285j.1.09f/NonlocalMethods_main.slides.pdf · Nonlocal methods for image processing ... Applications to Image Processing, UCLA CAM

Nonlocal methods for image processing

Nonlocal means filter

Outline

1 Local smoothing Filters

2 Nonlocal means filter

3 Nonlocal operatorsDenoising by nonlocal functionalsInverse problems by nonlocal regularizationNonlocal regularization with Bregmanized methods

4 ApplicationsCompressive samplingDeconvolutionWavelet Inpainting

5 References

9/29

Page 10: Nonlocal methods for image processing - UCLAlvese/285j.1.09f/NonlocalMethods_main.slides.pdf · Nonlocal methods for image processing ... Applications to Image Processing, UCLA CAM

Nonlocal methods for image processing

Nonlocal means filter

Nonlocal mean filter1

Idea: Take advantage of high degree of redundancy of naturalimages.

1A. Buades, B. Coll, and J-M. Morel. 2005

10/29

Page 11: Nonlocal methods for image processing - UCLAlvese/285j.1.09f/NonlocalMethods_main.slides.pdf · Nonlocal methods for image processing ... Applications to Image Processing, UCLA CAM

Nonlocal methods for image processing

Nonlocal means filter

Denoising formula

NLM(v)(x) :=1

C(x)

∫Ωw(x, y)v(y)dy,

where

w(x, y) = exp−Ga ∗ (||v(x+ ·)− v(y + ·)||2)(0)2h2

0

,

C(x) =∫

Ωwv(x, y)dy

11/29

Page 12: Nonlocal methods for image processing - UCLAlvese/285j.1.09f/NonlocalMethods_main.slides.pdf · Nonlocal methods for image processing ... Applications to Image Processing, UCLA CAM

Nonlocal methods for image processing

Nonlocal means filter

Weight from clean image

12/29

Page 13: Nonlocal methods for image processing - UCLAlvese/285j.1.09f/NonlocalMethods_main.slides.pdf · Nonlocal methods for image processing ... Applications to Image Processing, UCLA CAM

Nonlocal methods for image processing

Nonlocal means filter

Weight from noisy image

13/29

Page 14: Nonlocal methods for image processing - UCLAlvese/285j.1.09f/NonlocalMethods_main.slides.pdf · Nonlocal methods for image processing ... Applications to Image Processing, UCLA CAM

Nonlocal methods for image processing

Nonlocal means filter

Example

14/29

Page 15: Nonlocal methods for image processing - UCLAlvese/285j.1.09f/NonlocalMethods_main.slides.pdf · Nonlocal methods for image processing ... Applications to Image Processing, UCLA CAM

Nonlocal methods for image processing

Nonlocal means filter

Comparison with other methods

15/29

Page 16: Nonlocal methods for image processing - UCLAlvese/285j.1.09f/NonlocalMethods_main.slides.pdf · Nonlocal methods for image processing ... Applications to Image Processing, UCLA CAM

Nonlocal methods for image processing

Nonlocal operators

Outline

1 Local smoothing Filters

2 Nonlocal means filter

3 Nonlocal operatorsDenoising by nonlocal functionalsInverse problems by nonlocal regularizationNonlocal regularization with Bregmanized methods

4 ApplicationsCompressive samplingDeconvolutionWavelet Inpainting

5 References

16/29

Page 17: Nonlocal methods for image processing - UCLAlvese/285j.1.09f/NonlocalMethods_main.slides.pdf · Nonlocal methods for image processing ... Applications to Image Processing, UCLA CAM

Nonlocal methods for image processing

Nonlocal operators

Nonlocal operators2/Graph based Regularization

Given a nonnegative and symmetric weight function w(x, y) foreach pair of points (x, y) ∈ Ω× Ω:

Nonlocal gradient of an image u(x):

∇wu(x, y) = (u(y)− u(x))√w(x, y) : Ω× Ω→ Ω

Nonlocal divergence of a gradient filed p(x, y) : Ω×Ω→ R isdefined by

< ∇wu, p >= − < u, divwp >,∀u(x), p(x, y)

=⇒ divwp(x) =∫

Ω(p(x, y)− p(y, x))

√w(x, y)dy.

Nonlocal functionals of u:

JNL/H1(f) =14

∫Ω|∇wu(x)|2 :

14

∫x

∫y|∇wu(x, y)|2

JNL/TV (f) =∫

Ω|∇wu(x)|1 :

∫x

√∫y|∇wu(x, y)|2.

2G. Gilboa and S. Osher, 2007

17/29

Page 18: Nonlocal methods for image processing - UCLAlvese/285j.1.09f/NonlocalMethods_main.slides.pdf · Nonlocal methods for image processing ... Applications to Image Processing, UCLA CAM

Nonlocal methods for image processing

Nonlocal operators

Denoising by nonlocal functionals

Nonlocal H1 regularization by non-local means

Model:min JNL/H1(u) + µ2 ||u− f ||

2

Euler-Lagrange equation: Lw(u)u+ µ(u− f) = 0, where Lwis unnormalized graph laplacian :

Lw(u) =∫

Ωw(x, y)(u(x)− u(y)).

We can replace Lw(u) by normalized graph laplacian3

L0w =

1C(x)

Lw = Id− NLMw(u).

Semi-explicit iteration: for a time stepτ > 0, s = 1 + τ + τµ, α1 = τ

s , α2 = τµs :

uk+1 = (1− α1)uk + α1NLMw(uk) + α2f.3When N →∞ and h0 → 0, then L0

w converges to the continuous manifoldLaplace - Beltrami operator.

18/29

Page 19: Nonlocal methods for image processing - UCLAlvese/285j.1.09f/NonlocalMethods_main.slides.pdf · Nonlocal methods for image processing ... Applications to Image Processing, UCLA CAM

Nonlocal methods for image processing

Nonlocal operators

Denoising by nonlocal functionals

Nonlocal TV regularization by Chambolle’s algorithm

Model: minu JNL/TV,w(u) + µ2 ||u− f ||

2

Extension of Chambolle’s projection method for Nonlocal TV:

infu

sup||p||≤1

∫Ω×Ω

< ∇wu, p > +µ

2||u− f ||2,

where the solution can be solved by a projected solutionu∗ = f − 1

µ ÷w p∗. and the dual variable p∗ is obtained by

sup||p||≤1

∫Ω×Ω

< ∇wu, p > +1

2µ||divwp||2.

Algorithm:

pn+1 =pn + τ∇w(divwp

n − µf)1 + τ |∇w(divwpn − µf)|

, τ > 0

19/29

Page 20: Nonlocal methods for image processing - UCLAlvese/285j.1.09f/NonlocalMethods_main.slides.pdf · Nonlocal methods for image processing ... Applications to Image Processing, UCLA CAM

Nonlocal methods for image processing

Nonlocal operators

Inverse problems by nonlocal regularization

Deblurring by Nonlocal Means4

Problem: f = Au+ n, A linear operator, n Gaussian noise. Idea:Use initial blurry and noisy image f to compute the weight.

JNLM,w(f) := min ||u− NLMfu||2 +λ

2||Au− f ||2 (1)

which is equivalent to

JNLM,w(f) := min ||L0wf

(u)||2 +λ

2||Au− f ||2 (2)

where L0wf

is the normalized graph laplacian with the weightcomputed from f .Gradient descents flow:

((L0wf

)∗L0wf

)u+ λA∗(Au− f) = 0

4A. Buades, B. Coll, and J-M. Morel. 200620/29

Page 21: Nonlocal methods for image processing - UCLAlvese/285j.1.09f/NonlocalMethods_main.slides.pdf · Nonlocal methods for image processing ... Applications to Image Processing, UCLA CAM

Nonlocal methods for image processing

Nonlocal operators

Inverse problems by nonlocal regularization

Image recovery via nonlocal operators

Idea: Use a deblurred image to compute the weight.1 Preprocessing:

Compute a deblurred image via a fast method:

u0 = min12||Au− f ||2 + δ||u||2 ⇐⇒ u0 = (A∗A+ δ)−1A∗f.

where δ is chosen optimally by respecting the condition

σ2 = ||Au0 − f ||2

where σ2 is the noise level in blurry image.Compute the nonlocal weight w0 by using u0 as a referenceimage (set h0 = σ2||(A∗A+ δ)−1A∗||2.)

2 Nonlocal regularization with the fixed weight w0:

min Jw0(u) +λ

2||Au− f ||2

by gradient descent.21/29

Page 22: Nonlocal methods for image processing - UCLAlvese/285j.1.09f/NonlocalMethods_main.slides.pdf · Nonlocal methods for image processing ... Applications to Image Processing, UCLA CAM

Nonlocal methods for image processing

Nonlocal operators

Inverse problems by nonlocal regularization

Nonlocal regularization for inverse problems

Idea: nonlocal weight updating during nonlocal regularizationby operator splitting.

Model :

minuJw(u)(u) +

λ

2||Au− v||2

Approximated Algorithm:

vk+1 = uk + 1

µA∗(f −Auk)

wk+1 = w(vk+1)(optional)uk+1 = arg min JNL/TV,wk+1 + λµ

2 ||u− vk+1||2

(3)

where uk+1 is solved by Chamobelle’s method for NLTV.

22/29

Page 23: Nonlocal methods for image processing - UCLAlvese/285j.1.09f/NonlocalMethods_main.slides.pdf · Nonlocal methods for image processing ... Applications to Image Processing, UCLA CAM

Nonlocal methods for image processing

Nonlocal operators

Nonlocal regularization with Bregmanized methods

Nonlocal regularization with Bregmanized methods

With/without weight updating:

Algorithm:

fk+1 = fk + f −Aukvk+1 = uk + 1

µA∗(fk+1 −Auk)

wk+1 = w(vk+1)(optional)uk+1 = arg min JNL/TV,wk+1 + λµ

2 ||u− vk+1||2

(4)

23/29

Page 24: Nonlocal methods for image processing - UCLAlvese/285j.1.09f/NonlocalMethods_main.slides.pdf · Nonlocal methods for image processing ... Applications to Image Processing, UCLA CAM

Nonlocal methods for image processing

Applications

Outline

1 Local smoothing Filters

2 Nonlocal means filter

3 Nonlocal operatorsDenoising by nonlocal functionalsInverse problems by nonlocal regularizationNonlocal regularization with Bregmanized methods

4 ApplicationsCompressive samplingDeconvolutionWavelet Inpainting

5 References

24/29

Page 25: Nonlocal methods for image processing - UCLAlvese/285j.1.09f/NonlocalMethods_main.slides.pdf · Nonlocal methods for image processing ... Applications to Image Processing, UCLA CAM

Nonlocal methods for image processing

Applications

Compressive sampling

Compressive sampling : Au = RFu

True Image Initial guess

TV NLTV

Figure: Data: 30% random Fourier measurements

25/29

Page 26: Nonlocal methods for image processing - UCLAlvese/285j.1.09f/NonlocalMethods_main.slides.pdf · Nonlocal methods for image processing ... Applications to Image Processing, UCLA CAM

Nonlocal methods for image processing

Applications

Deconvolution

Deconvolution: Au = k ∗ u

True Image Blurry and noisy Image

Fix weight Update weight

Figure: 9× 9 box average blur kernel, σ = 3

26/29

Page 27: Nonlocal methods for image processing - UCLAlvese/285j.1.09f/NonlocalMethods_main.slides.pdf · Nonlocal methods for image processing ... Applications to Image Processing, UCLA CAM

Nonlocal methods for image processing

Applications

Wavelet Inpainting

Wavelet Inpainting: Au = RWu

Original Received, PSNR= 17.51

TV, PSNR=28.64 NLTV, PSNR= 36.06

Figure: Block loss(including low-low frequencies loss). For both TV and NLTV, theinitial guess is the received image

27/29

Page 28: Nonlocal methods for image processing - UCLAlvese/285j.1.09f/NonlocalMethods_main.slides.pdf · Nonlocal methods for image processing ... Applications to Image Processing, UCLA CAM

Nonlocal methods for image processing

References

Outline

1 Local smoothing Filters

2 Nonlocal means filter

3 Nonlocal operatorsDenoising by nonlocal functionalsInverse problems by nonlocal regularizationNonlocal regularization with Bregmanized methods

4 ApplicationsCompressive samplingDeconvolutionWavelet Inpainting

5 References

28/29

Page 29: Nonlocal methods for image processing - UCLAlvese/285j.1.09f/NonlocalMethods_main.slides.pdf · Nonlocal methods for image processing ... Applications to Image Processing, UCLA CAM

Nonlocal methods for image processing

References

References

A Review of Image Denoising Algorithms, with a New One, A.Buades, B. Coll, J. M. Morel Multiscale Modeling andSimulation, Vol. 4, No. 2. (2005), pp. 490-530.Guy Gilboa and Stanley Osher, Nonlocal Operators withApplications to Image Processing, UCLA CAM report, July2007Image Recovery via Nonlocal Operators, Journal of ScientificComputing, Yifei Lou, Xiaoqun Zhang, Stanley Osher, AndreaBertozziXiaoqun Zhang, Martin Burger, Xavier Bresson and StanleyOsher, Bregmanized Nonlocal Regularization forDeconvolution and Sparse Reconstruction, UCLA CAMReport, January 2009Xiaoqun Zhang and Tony F. Chan, Wavelet Inpainting byNonlocal Total Variation, UCLA CAM Report, July 2009Miyoun Jung and Luminita A. Vese, Image Restoration viaNonlocal Mumford-Shah Regularizers, UCLA CAM Report,February 2009

29/29