92
Giacomo Boracchi Politecnico di Milano [email protected] Joint Research Center, ISPRA Image Processing case study: LPA-ICI Denoising 27th October 2009

Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

Embed Size (px)

Citation preview

Page 1: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

Giacomo Boracchi

Politecnico di Milano

[email protected]

Joint Research Center, ISPRA

Image Processing case study:LPA-ICI Denoising

27th October 2009

Page 2: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

Disclaimer

� Most of the material shown in these slides is taken from LASIP (Local Approximation in Signal and Image Processing) laboratory webpage.

� http://www.cs.tut.fi/~lasip/

2

� http://www.cs.tut.fi/~lasip/

� There you can download papers and Matlab sources for most of

implemented algorithms

ISPRA, JRC27th October 2009

Page 3: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

Outline

� Image Formation Model

� Denoising approaches

3

� LPA-ICI Denoising Motivations

� Local Polynomial Approximation

� ICI rule

ISPRA, JRC

� Algorithm Details

27th October 2009

Page 4: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

� Observation model is

Image Formation Model

Sensed image

4

� For the sake of simplicity we will assume

Sensed image

Pixel index

Original (unknown) image

noise.

ISPRA, JRC

� The goal is to obtain , a reliable estimate of , given and the distribution of .

27th October 2009

Page 5: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

Denoising Approaches

� Parametric Approaches

• Transform Domain Filtering, they assume the noisy-free signal is somehow sparse in a suitable domain (e.g Fourier, DCT, Wavelet)

or w.r.t. some dictionary based decomposition)

5

or w.r.t. some dictionary based decomposition)

ISPRA, JRC27th October 2009

Page 6: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

Denoising Approaches

� Parametric Approaches

• Transform Domain Filtering, they assume the noisy-free signal is somehow sparse in a suitable domain (e.g Fourier, DCT, Wavelet)

or w.r.t. some dictionary based decomposition)

6

or w.r.t. some dictionary based decomposition)

� Non Parametric Approaches

• Local Smoothing / Local Approximation

• Non Local Methods

ISPRA, JRC27th October 2009

Page 7: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

Denoising Approaches

� Parametric Approaches

• Transform Domain Filtering, they assume the noisy-free signal is somehow sparse in a suitable domain (e.g Fourier, DCT, Wavelet)

or w.r.t. some dictionary based decomposition)

7

or w.r.t. some dictionary based decomposition)

� Non Parametric Approaches

• Local Smoothing / Local Approximation

• Non Local Methods

ISPRA, JRC27th October 2009

Page 8: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

Denoising Approaches

� Parametric Approaches

• Transform Domain Filtering, they assume the noisy-free signal is somehow sparse in a suitable domain (e.g Fourier, DCT, Wavelet)

or w.r.t. some dictionary based decomposition)

8

or w.r.t. some dictionary based decomposition)

� Non Parametric Approaches

• Local Smoothing / Local Approximation

• Non Local Methods

ISPRA, JRC

Estimating from can be statistically treated as regression of on

27th October 2009

Page 9: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

Non parametric approaches

� Local / Non Local

• Local methods: weights used for the algorithm depends on the

distance between the estimation point and the other

9

distance between the estimation point and the other observation points

ISPRA, JRC27th October 2009

Page 10: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

Non parametric approaches

� Local / Non Local

• Local methods: weights used for the algorithm depends on the

distance between the estimation point and the other

10

distance between the estimation point and the other observation points

• Non Local Methods: the weights are function of the differences of the corresponding signals. The weight used to estimate depends on . Typically on something related to .

ISPRA, JRC

Katkovnik, V., A. Foi, K. Egiazarian, and J. Astola, “From local kernel to nonlocal multiple-model image denoising”, preprint (July 2009), to appear Int. J. Computer Vision.

27th October 2009

Page 11: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

Local vs Non-Local

� Local, weights are determined by the pixel distance (regardless of the image content)

11

ISPRA, JRC

With different weights

27th October 2009

Page 12: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

Local vs Non-Local

� Non Local, weights are determined by the image similarity

12

� Example of observation

ISPRA, JRC27th October 2009

Page 13: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

Local vs Non-Local

� Non Local, weights are determined by the image similarity

13

� Example of observation

ISPRA, JRC27th October 2009

Page 14: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

Local vs Non-Local

� Non Local, weights are determined by the image similarity

14

ISPRA, JRC

With different weights

27th October 2009

Page 15: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

Non parametric approaches

� Pointwise / Multipoint

• Pointwise: the estimation of noise-free signal is computed for the

central point only, and not for all the other points considered

15

central point only, and not for all the other points considered

ISPRA, JRC27th October 2009

Page 16: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

Non parametric approaches

� Pointwise / Multipoint

• Pointwise: the estimation of noise-free signal is computed for the

central point only, and not for all the other points considered

16

central point only, and not for all the other points considered

• Multipoint : the estimation of the noise-free signal is computed for

all the points used by the estimator to estimate .

ISPRA, JRC

Katkovnik, V., A. Foi, K. Egiazarian, and J. Astola, “From local kernel to nonlocal multiple-model image denoising”, preprint (July 2009), to appear Int. J. Computer Vision.

27th October 2009

Page 17: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

Pointwise vs Multipoint

� Pointwise, the estimate is given for the central point only

17

involved

ISPRA, JRC27th October 2009

Page 18: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

Pointwise vs Multipoint

� Pointwise, the estimate is given for the central point only

18

Pixels where

the true signal

is estimated

ISPRA, JRC27th October 2009

Page 19: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

Pointwise vs Multipoint

� Multipoint, the original image is estimated in all the pixels considered in the filtering

19

involved

ISPRA, JRC27th October 2009

Page 20: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

Pointwise vs Multipoint

� Multipoint, the original image is estimated in all the pixels considered in the filtering

20

Pixels where

the true signal

is estimated

ISPRA, JRC27th October 2009

Page 21: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

Disclaimer

� This classification holds for the principles that determine the algorithm design.

21

� Most of the algorithm are implemented combining methods from different approaches.

� Furthermore, some of the most effective denoising algoritms enforce parametric assumptions on image areas adatptively selected

SA-DCT

ISPRA, JRC

• SA-DCT

• BM3D

27th October 2009

Page 22: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

What are we going to see then,

� A Local, pixel-wise denoising algorithm

LPA-ICI : Local Polynomial Approximation using

Intersection of Confidence Interval rule.

22

Intersection of Confidence Interval rule.

� We will consider the denoising as a basic problem, although this

method has been successfully applyied to several other problems such as

• Deblurring

• Interpolation

Enhancement

ISPRA, JRC

• Enhancement

• Demosaicing

• Deblocking

• Inverse Halftoning

27th October 2009

Page 23: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

Why?

� Why to use such an algorithm as a case study for Cuda programming?

• It is Embarrassingly parallel (it is a local pixelwise method).

23

• It is Embarrassingly parallel (it is a local pixelwise method).

• It is simple to implement.

• It is motivated by few clear and easy-to-show assumption.

• It has been successfully applied to several image processing challenges.

ISPRA, JRC27th October 2009

Page 24: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

LPA-ICI basic ideas

� It combines two independent ideas:

• Local Polynomial Approximation (LPA) for designing linear

filters that performs pixelwise polynomial fit on a certain

24

filters that performs pixelwise polynomial fit on a certain neighborhood.

ISPRA, JRC27th October 2009

Page 25: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

LPA-ICI basic ideas

� It combines two independent ideas:

• Local Polynomial Approximation (LPA) for designing linear

filters that performs pixelwise polynomial fit on a certain

25

filters that performs pixelwise polynomial fit on a certain neighborhood.

• Intersection of Confidence Interval rule (ICI) is an adaptation algorithm, used to define the most suited neighborhood where the polynomial assumpions fit better the observations.

ISPRA, JRC27th October 2009

Page 26: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

� Local Pointwise weighted averages: the estimate at is

Local Pointwise Techniques 26

ISPRA, JRC27th October 2009

Page 27: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

Local Pointwise Techniques

� Local Pointwise weighted averages: the estimate at is

27

� Can be interpreted as the 0-th order polynomial that performs least square fit

ISPRA, JRC27th October 2009

Page 28: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

Local Pointwise Techniques

� Local Pointwise weighted averages: the estimate at is

28

� Can be interpreted as the 0-th order polynomial that performs least square fit

ISPRA, JRC

� The weights in the MSE are determined by the averaging window and the parameter scales the window w.r.t. a basic window

27th October 2009

Page 29: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

Local Pointwise Techniques

� Local Pointwise weighted averages: the estimate at is

29

� Can be interpreted as the 0-th order polynomial that performs least square fit

ISPRA, JRC

� The weights in the MSE are determined by the averaging window and the parameter scales the window w.r.t. a basic window

27th October 2009

Page 30: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

Local Pointwise Techniques

� Local Polynomial Approximation

• Determine the polynomial expression (of a fixed order m) that better fits the observation on a fixed pixel neighborhood

30

ISPRA, JRC27th October 2009

Page 31: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

Local Pointwise Techniques

� Local Polynomial Approximation

• Determine the polynomial expression (of a fixed order m) that better fits the observation on a fixed pixel neighborhood

31

• The signal estimate is given by , the value of this polynomial in

ISPRA, JRC

the weights determines the localization of this fit

27th October 2009

Page 32: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

LPA Kernel

� The LPA estimate can be obtained via a convolution with discrete LPA kernels

32

ISPRA, JRC27th October 2009

Page 33: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

LPA Kernel

� The LPA estimate can be obtained via a convolution with discrete LPA kernels

33

ISPRA, JRC27th October 2009

Page 34: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

LPA Kernel

� The LPA estimate can be obtained via a convolution with discrete LPA kernels

34

� Summarizing, LPA estimates can be obtained via a convolution with

discrete kernels which are determined by:

• The order of polynomial fit.

• The support of the polynomial fit.

• The weight of the minimization of the polynomial least square fit.

ISPRA, JRC27th October 2009

Page 35: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

LPA Kernel

� The LPA estimate can be obtained via a convolution with discrete LPA kernels

35

� Summarizing, LPA estimates can be obtained via a convolution with

discrete kernels which are determined by:

• The order of polynomial fit.

• The support of the polynomial fit.

• The weight of the minimization of the polynomial least square fit.

ISPRA, JRC

� This makes LPA a perfect tool for designing adaptive filters.

27th October 2009

Page 36: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

LPA-ICI algorithm: ideal neighborhood

� Ideal in the sense that it defines the support of pointwise Least Square kernel estimators.

36

ISPRA, JRC27th October 2009

Page 37: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

LPA-ICI algorithm: ideal neighborhood

� Ideal in the sense that it defines the support of pointwise Least Square kernel estimators.

37

� Typically, even in simple images, every point has its own different ideal neighborhood.

ISPRA, JRC27th October 2009

Page 38: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

LPA-ICI algorithm: ideal neighborhood

� Ideal in the sense that it defines the support of pointwise Least Square kernel estimators.

38

� Typically, even in simple images, every point has its own different ideal neighborhood.

ISPRA, JRC

� For practical reasons, the ideal neighborhood is assumed starshaped

27th October 2009

Page 39: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

LPA-ICI algorithm: ideal neighborhood

� Ideal in the sense that it defines the support of pointwise Least Square kernel estimators.

39

� Typically, even in simple images, every point has its own different ideal neighborhood.

ISPRA, JRC

� For practical reasons, the ideal neighborhood is assumed starshaped

27th October 2009

Page 40: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

LPA-ICI algorithm: ideal neighborhood

� The ideal neighborhood is built in the discrete image domain using LPA filters having directional supports

40

ISPRA, JRC27th October 2009

Page 41: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

LPA-ICI algorithm: ideal neighborhood

� The ideal neighborhood is built in the discrete image domain using LPA filters having directional supports

41

ISPRA, JRC27th October 2009

Page 42: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

Examples of adaptively selected neighorhoods

� Adaptively selected neighborhoods selected using the LPA-ICI rule

42

ISPRA, JRC27th October 2009

Page 43: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

Neighborhood discretization

� A suitable discretization of this neighborhood is obtained by using a set of directional LPA kernels

43

where determines the orientation of the kernel support, and

Ideal

Neighborhood

Directional

kernels

Discrete Adaptive

Neighborhood

ISPRA, JRC

where determines the orientation of the kernel support, andwhere controls by the scale of kernel support.

27th October 2009

Page 44: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

Neighborhood discretization

� A suitable discretization of this neighborhood is obtained by using a set of directional LPA kernels

44

where determines the orientation of the kernel support, and

Ideal

Neighborhood

Directional

kernels

Discrete Adaptive

Neighborhood

ISPRA, JRC

where determines the orientation of the kernel support, andwhere controls by the scale of kernel support.

� The initial shape optimization problem can be solved by using

standard easy-to-implement varying-scale kernel techniques, such as the ICI rule.

27th October 2009

Page 45: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

Example of LPA Anisotropic Kernels

� Directional Kernel:

• Order along columns: 0. Order along rows:1

• Direction 0

• Scale 1

45

• Scale 1

ISPRA, JRC

rowsColumns

27th October 2009

Page 46: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

Example of LPA Anisotropic Kernels

� Directional Kernel:

• Order along columns: 0. Order along rows:1

• Direction 0

• Scale 3

46

• Scale 3

ISPRA, JRC

rowsColumns

27th October 2009

Page 47: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

Example of LPA Anisotropic Kernels

� Directional Kernel:

• Order along columns: 0. Order along rows:1

• Direction 0

• Scale 6

47

• Scale 6

ISPRA, JRC

rowsColumns

27th October 2009

Page 48: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

Example of LPA Anisotropic Kernels

� Directional Kernel:

• Order along columns: 0. Order along rows:1

• Direction 0

• Scale 6

48

• Scale 6

ISPRA, JRC

rowsColumns

27th October 2009

Page 49: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

Example of LPA Anisotropic Kernels

� Directional Kernel:

• Order along columns: 2. Order along rows: 0

• Direction 0

• Scale 6

49

• Scale 6

ISPRA, JRC

rowsColumns

27th October 2009

Page 50: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

Example of LPA Anisotropic Kernels

� Directional Kernel:

• Order along columns: 2. Order along rows: 2

• Direction 0

• Scale 6

50

• Scale 6

ISPRA, JRC

rowsColumns

27th October 2009

Page 51: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

Example of LPA Anisotropic Kernels

� Directional Kernel:

• Order along columns: 2. Order along rows: 1

• Direction 0

• Scale 8

51

• Scale 8

ISPRA, JRC

rowsColumns

27th October 2009

Page 52: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

Example of LPA Anisotropic Kernels

� Directional Kernel:

• Order along columns: 1. Order along rows: 3

• Direction 0

• Scale 8

52

• Scale 8

ISPRA, JRC

rowsColumns

27th October 2009

Page 53: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

LPA Kernels for derivatives estimation

� Kernels can be defined also for polynomial derivatives:

53

� Also these estimates can be obtaine via a convolutional

ISPRA, JRC27th October 2009

Page 54: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

Example of LPA Anisotropic Kernels

� Directional Kernel: 1°derivative along rows

• Order along columns: 2. Order along rows: 2

• Direction 0

• Scale 6

54

• Scale 6

ISPRA, JRC27th October 2009

Page 55: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

Example of LPA Anisotropic Kernels

� Directional Kernel: 1°derivative along rows

• Order along columns: 2. Order along rows: 2

• Direction 0

• Scale 6 Fourier Domain

55

• Scale 6 Fourier Domain

ISPRA, JRC27th October 2009

Page 56: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

Example of LPA Anisotropic Kernels

� Directional Kernel: 2°derivative along rows

• Order along columns: 2. Order along rows: 2

• Direction 0

• Scale

56

• Scale

ISPRA, JRC27th October 2009

Page 57: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

Example of LPA Anisotropic Kernels

� Directional Kernel: 2°derivative along rows

• Order along columns: 2. Order along rows: 2

• Direction 0

• Scale 6 Fourier Domain

57

• Scale 6 Fourier Domain

ISPRA, JRC27th October 2009

Page 58: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

LPA Benefits

� Unlike many other transforms which start from the continuous domain and then discretized, this technique works directly in the multidimensional discrete domain;

58

� The LPA kernels can be designed of any dimension, non-separable and anisotropic with arbitrary orientation, width and length;

� Any desirable smoothness of the kernel can be set.

� The kernel support can be flexibly shaped to any desirable geometry. In this way a special design can be done for complex form

ISPRA, JRC

geometry. In this way a special design can be done for complex form objects and specific applications.

� Both smoothing and corresponding differentiating directional

kernels can be designed.

27th October 2009

Page 59: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

LPA Benefits

� These kernels are by definition asymmetric, allowing efficient edge adaptation. Traditional symmetric or nearly-symmetric supports tend to produce either so-called ringing artifacts or oversmoothing in the

vicinity of the edges.

59

� The Directional LPA allows to consider several different problems within a unified framework.

� When using LPA one implicitly assumes that the original signal is

well-approximated by a polynomial in a neighborhood of each pixel: this hypothesis suits perfectly pixel-wise parallelization.

ISPRA, JRC

this hypothesis suits perfectly pixel-wise parallelization.

Katkovnik, V., K. Egiazarian, and J. Astola, ”Local Approximation Techniques in Signal and Image Processing”, SPIE Press, Monograph Vol. PM157, September 2006.

Foi, A., ”Anisotropic nonparametric image processing: theory, algorithms and applications,” Ph.D. Thesis, Dip. di Matematica, Politecnico di Milano, April 2005.

27th October 2009

Page 60: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

Adaptiveness

� The choice of the scale parameter is crucial as it controls the amount of smoothing in the estimation.

� Example on lena image

60

� Example on lena image

ISPRA, JRC

� Large corresponds to less noisy output (i.e. lower variance) but

typically it may result in higher bias

� Smaller corresponds to noiser estimates (i.e. higher variance), less

biased.

27th October 2009

Page 61: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

Adaptiveness

� The choice of the scale parameter is crucial as it controls the amount of smoothing in the estimation.

� Example on lena image

61

� Example on lena image

ISPRA, JRC

� Large corresponds to less noisy output (i.e. lower variance) but

typically it may result in higher bias

� Smaller corresponds to noiser estimates (i.e. higher variance), less

biased.

27th October 2009

Page 62: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

Adaptiveness

� The choice of the scale parameter is crucial as it controls the amount of smoothing in the estimation.

� Example on lena image

62

� Example on lena image

ISPRA, JRC

� Large corresponds to less noisy output (i.e. lower variance) but

typically it may result in higher bias

� Smaller corresponds to noiser estimates (i.e. higher variance), less

biased.

27th October 2009

Page 63: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

Bias – Variance Trade Off

� Intiutively the scale parameters controls the trade off between bias and variance in the LPA estimates:

• Bias

63

• Variance

� The following upper bound holds for the mean squared error

ISPRA, JRC

� Furthermore,the following asymptotic expressions hold for bias and

the variance

27th October 2009

Page 64: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

Thus

� In practice this hypothesis are enough for applying the ICI rule to determine the optimal scale

64

ISPRA, JRC27th October 2009

Page 65: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

Thus

� In practice this hypothesis are enough for applying the ICI rule to determine the optimal scale

65

ISPRA, JRC

� The ICI rule is used to determine kernel scale that approximates

27th October 2009

Page 66: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

The ICI rule

� Consider a fixed kernel direction :

� For each pixel , the estimates are computed on a set of

increasing scales

66

increasing scales

� For each estimate we can build a confidence interval as follows

where is a tuining parameter

� The ICI rule yields a pointwise adaptive estimate such that

ISPRA, JRC

in a sense that

Goldenshluger, A., and A. Nemirovski, “On spatial adaptive estimation of nonparametric regression”, Math. Meth. Statistics, vol. 6, pp. 135-170, 1997

27th October 2009

Page 67: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

The ICI rule

� The ICI rule can be state as follows:

Consider the intersection of confidence intervals

67

where .

Then let be the largest of the scale indexes for which

and : then, is defined as and the adaptive

estimate is .

ISPRA, JRC

Goldenshluger, A., and A. Nemirovski, “On spatial adaptive estimation of nonparametric regression”, Math. Meth. Statistics, vol. 6, pp. 135-170, 1997

27th October 2009

Page 68: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

The ICI rule68

ISPRA, JRC

Goldenshluger, A., and A. Nemirovski, “On spatial adaptive estimation of nonparametric regression”, Math. Meth. Statistics, vol. 6, pp. 135-170, 1997

27th October 2009

Page 69: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

Examples of adaptively selected neighorhoods

� Adaptively selected neighborhoods selected using the LPA-ICI rule

69

ISPRA, JRC27th October 2009

Page 70: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

LPA-ICI Denoising Algorithm Details

1. Compute the ICI-selected scales along each direction

2. ICI-selected scales filtering and Update Directional Estimates

70

2. ICI-selected scales filtering and Update Directional Estimates

3. Fusing of directional estimates

ISPRA, JRC27th October 2009

Page 71: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

ICI scale selection - Matlab implementation-

� It is typically faster to perform 2D-convolution - given a kernel direction -

71

ISPRA, JRC

Compute H image

convolutions, one per

each kernel length

Compute the

confidence intervals

For each pixel,

compute the

Intersection of

Confidence Intervals

27th October 2009

Page 72: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

Example ICI selected Scales and Directional Estimates72

ISPRA, JRC27th October 2009

Page 73: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

Example ICI selected Scales and Directional Estimates73

ISPRA, JRC27th October 2009

Page 74: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

Step 2: ICI-selected scales filtering

� Use a median filter or a Weight Order Statistics filter on the ICI selected scales

• This operation is typically performed separately for the scales

74

• This operation is typically performed separately for the scales selected along each direction

• When using WOS, these are directed “orthogonally” to anisotropic LPA-Kernels

� The “old” directional estimates are replaced by the LPA estimates and the standard deviations corresponding to the scales filtered.

ISPRA, JRC

the standard deviations corresponding to the scales filtered.

� In such a way we remove isolated pixels where the ICI selected “the wrong scale”

27th October 2009

Page 75: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

Example ICI selected scales75

ISPRA, JRC27th October 2009

Page 76: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

Example ICI selected scales76

ISPRA, JRC27th October 2009

Page 77: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

Example ICI selected scales77

ISPRA, JRC27th October 2009

Page 78: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

Step 3: Fusing of directional estimates

� For each pixel

• Fuse the directional estimates with a convex linear combinationthe weights are determined by the inverse of the directional

estimates variance

78

estimates variance

ISPRA, JRC

• In such a way, larger weights are assigned to the less noisy estimates

27th October 2009

Page 79: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

Example of Final Estimate

� Directional Estimates Fused Estimate

79

ISPRA, JRC27th October 2009

Page 80: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

Denoising Performance80

ISPRA, JRC

� Details: original image (top left), anisotropic LPA-ICI, ISNR=8.2dB

(top right), TI wavelets (DB4), ISNR=7.4dB (bottom left), TI wavelets (Haar), ISNR=7.8dB (bottom right).

27th October 2009

Page 81: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

Implementation Details

1. Compute the ICI-selected scales along each direction

2. ICI-selected scales filtering and Update Directional Estimates

81

2. ICI-selected scales filtering and Update Directional Estimates

3. Fusing of directional estimates

These instructions will be performed on a Cuda Kernel, and parallelized for each pixel.

ISPRA, JRC

for each pixel.

27th October 2009

Page 82: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

Step 1 + 3 : Compute ICI-selected scales

� For each pixel

• For each LPA kernel direction d

• // initialize the ICI selected scale

− For each scale kernel

82

− For each scale kernel

// Compute the LPA estimate at x and its standard deviation

− // Determine confidence interval

− // Determine Intersection of Confidence Intervals

ISPRA, JRC

− If

− // The ICI selected scale is h-1

− Break

• // fuse the directional estimates

27th October 2009

Page 83: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

Implementation Details

� The parameter determine the width of Confidence Intervals:

• Larger tend to select larger scales

• Smaller tend to select smaller scales

83

� The convolution has to be computed also at image boundaries.

• An efficient and practical solution in this case consist of padding the original image with a value much smaller than 0 (e.g. -10000)

ISPRA, JRC27th October 2009

Page 84: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

Implementation Details

� The parameter determine the width of Confidence Intervals:

• Larger tend to select larger scales

• Smaller tend to select smaller scales

84

� The convolution has to be computed also at image boundaries.

• An efficient and practical solution in this case consist of padding the original image with a value much smaller than 0 (e.g. -10000)

Add PADDING area

ISPRA, JRC27th October 2009

Page 85: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

Implementation Details

� The parameter determine the width of Confidence Intervals:

• Larger tend to select larger scales

• Smaller tend to select smaller scales

85

� The convolution has to be computed also at image boundaries.

• An efficient and practical solution in this case consist of padding the original image with a value much smaller than 0 (e.g. -10000)

Add PADDING area

ISPRA, JRC

Compute convolution

against the padded image

27th October 2009

Page 86: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

Implementation Details

� The parameter determine the width of Confidence Intervals:

• Larger tend to select larger scales

• Smaller tend to select smaller scales

86

� The convolution has to be computed also at image boundaries.

• An efficient and practical solution in this case consist of padding the original image with a value much smaller than 0 (e.g. -10000)

Compute scales on

PADDING free imageAdd PADDING area

ISPRA, JRC

Compute convolution

against the padded image

27th October 2009

Page 87: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

Implementation Details

� The parameter determine the width of Confidence Intervals:

• Larger tend to select larger scales

• Smaller tend to select smaller scales

87

� The convolution has to be computed also at image boundaries.

• An efficient and practical solution in this case consist of padding the original image with a value much smaller than 0 (e.g. -10000)

� The value of the noise standard deviation is assumed known (and here it will be provided). Typically it can be estimated using MAD estimator

ISPRA, JRC

estimator

Donoho, D.L., and I.M. Johnstone, “Ideal spatial adaptation via wavelet shrinkage”, Biometrika, n. 81, pp. 425-455, 1994

27th October 2009

Page 88: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

Implementation Details

� The parameter determine the width of Confidence Intervals:

• Larger tend to select larger scales

• Smaller tend to select smaller scales

88

� The convolution has to be computed also at image boundaries.

• An efficient and practical solution in this case consist of padding the original image with a value much smaller than 0 (e.g. -10000)

� The value of the noise standard deviation is assumed known (and here it will be provided). Typically it can be estimated using MAD estimator

ISPRA, JRC

estimator

� As an error metric you can use RMSE

27th October 2009

Page 89: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

Other Applications

� Deblurring

89

ISPRA, JRC27th October 2009

Page 90: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

Other Applications

� Deblurring

90

ISPRA, JRC

ISNR

27th October 2009

Page 91: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

Other Applications

� Inverse Halftoning

91

ISPRA, JRC27th October 2009

Page 92: Image Processing case study: LPA-ICI Denoisinghome.deib.polimi.it/boracchi/docs/2009_10_27_Cuda.pdfLPA-ICI Denoising 27th ... somehow sparse in a suitable domain (e.g Fourier, DCT,

Other Applications

� Inverse Halftoning

92

ISPRA, JRC

original grayscale image (top left), binary Floyd-Steinberg halftone (top right), anisotropic LPA-

ICI estimate, PSNR=32.4dB (bottom left) and wavelet-based WinHD estimate (Rice Univ.), PSNR=32.1dB (bottom

right)

27th October 2009