Computational Optical Imaging - Optique Numerique...

84
Computational Optical Imaging - Optique Numerique -- Deconvolution -- Winter 2014 Ivo Ihrke

Transcript of Computational Optical Imaging - Optique Numerique...

Page 1: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

Computational Optical Imaging -Optique Numerique

-- Deconvolution --

Winter 2014

Ivo Ihrke

Page 2: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

Deconvolution

Ivo Ihrke

Page 3: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

Outline

Deconvolution Theory

example 1D deconvolution

Fourier method

Algebraic method

─ discretization

─ matrix properties

─ regularization

─ solution methods

Deconvolution Examples

Page 4: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

Applications - Astronomy

BEFORE AFTER

Images courtesy of Robert Vanderbei

Page 5: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

Applications - Microscopy

Images courtesy Meyer Instruments

Page 6: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

Inverse Problem - Definition

forward problem

given a mathematical model M and its parameters m, compute (predict) observations o

inverse problem

given observations o and a mathematical model M, compute the model's parameters

Page 7: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

Inverse Problems – Example Deconvolution

forward problem – convolution

example blur filter

given an image m and a filter kernel k, compute the blurred image o

Page 8: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

Inverse Problems – Example Deconvolution

inverse problem – deconvolution

example blur filter

given a blurred image o and a filter kernel k, compute the sharp image

need to invert

n is noise

Page 9: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

Fourier Solution

Page 10: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

Deconvolution - Theory

deconvolution in Fourier space

convolution theorem ( F is the Fourier transform ):

deconvolution:

problems

division by zero

Gibbs phenomenon

(ringing artifacts)

Page 11: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

A One-Dimensional Example –Deconvolution Spectral

most common: is a low pass filter

, the inverse filter, is high pass

amplifies noise and numerical errors

Page 12: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

A One-Dimensional Example –Deconvolution Spectral

reconstruction is noisy even if data is perfect ! Reason: numerical errors in representation of function

Page 13: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

A One-Dimensional Example –Deconvolution Spectral

spectral view of signal, filter and inverse filter

Page 14: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

A One-Dimensional Example –Deconvolution Spectral

solution: restrict frequency response of high pass filter (clamping)

Page 15: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

A One-Dimensional Example - Deconvolution Spectral

reconstruction with clamped inverse filter

Page 16: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

A One-Dimensional Example –Deconvolution Spectral

spectral view of signal, filter and inverse filter

Page 17: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

A One-Dimensional Example –Deconvolution Spectral

Automatic per-frequency tuning: Wiener Deconvolution- Alternative definition of inverse kernel

- Least squares optimal

- Per-frequency SNR must be known

Page 18: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

Algebraic Solution

Page 19: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

A One-Dimensional Example-Deconvolution Algebraic

alternative: algebraic reconstruction

convolution

discretization: linear combination of basis functions

Page 20: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

A One-Dimensional Example –Deconvolution Algebraic

discretization:

observations are linear combinations of convolved basis functions

linear system with unknowns

often over-determined, i.e. more observations o than degrees of freedom (# basis functions )

linear system

Page 21: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

A One-Dimensional Example –Deconvolution Algebraic

discretization:

observations are linear combinations of convolved basis functions

linear system with unknowns

often over-determined, i.e. more observations o than degrees of freedom (# basis functions )

linear system

unknown

Page 22: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

A One-Dimensional Example –Deconvolution Algebraic

normal equations

solve to obtain solution in a least squares sense

apply to deconvolution

solution is completely broken !

Page 23: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

A One-Dimensional Example –Deconvolution Algebraic

Why ?

analyze distribution of eigenvalues

Remember:

we will check the singular values

Ok, since is SPD (symmetric, positive semi-definite)

non-negative eigenvalues

Singular values are the square root of the eigenvalues

and Matrix is under-

determined

Page 24: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

matrix has a very wide range of singular values!

more than half of the singular values are smaller than machine epsilon ( ) for double precision

A One-Dimensional Example –Deconvolution Algebraic

Log-Plot !

Page 25: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

A One-Dimensional Example –Deconvolution Algebraic

Why is this bad ?

Singular Value Decomposition: U, V are orthonormal, D is diagonal

Inverse of M:

singular values are diagonal elements of D

inversion:

Page 26: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

A One-Dimensional Example –Deconvolution Algebraic

computing model parameters from observations:

again: amplification of noise

potential division by zero

Log-Plot !

Page 27: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

numerical null space

A One-Dimensional Example –Deconvolution Algebraic

inverse problems are often ill-conditioned (have a numerical null-space)

inversion causes amplification of noise

Page 28: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

Well-Posed and Ill-Posed Problems

Definition [Hadamard1902]

a problem is well-posed if

1. a solution exists

2. the solution is unique

3. the solution continually depends on the data

Page 29: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

Well-Posed and Ill-Posed Problems

Definition [Hadamard1902]

a problem is ill-posed if it is not well-posed

─ most often condition (3) is violated

─ if model has a (numerical) null space, parameter choice influences the data in the null-space of the data very slightly, if at all

─ noise takes over and is amplified when inverting the model

Page 30: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

Condition Number

measure of ill-conditionedness: condition number

measure of stability for numerical inversion

ratio between largest and smallest singular value

smaller condition number less problems when inverting linear system

condition number close to one implies near orthogonal matrix

Page 31: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

Truncated Singular Value Decomposition

solution to stability problems: avoid dividing by values close to zero

Truncated Singular Value Decomposition (TSVD)

is called the regularization parameter

Page 32: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

Minimum Norm Solution

Let be the null-space of A and

is the minimumnorm solution

Page 33: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

Regularization

countering the effect of ill-conditioned problems is called regularization

an ill-conditioned problem behaves like a singular(i.e. under-constrained) system

family of solutions exist

impose additional knowledge to pick a favorable solution

TSVD results in minimum norm solution

Page 34: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

Example – 1D Deconvolution

back to our example – apply TSVD

solution is much smoother than Fourier deconvolution

unregularized solution TSVD regularized solution

Page 35: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

Large Scale Problems

consider 2D deconvolution

512x512 image, 256x256 basis functions

least squares problem results in matrix that is 65536x65536 !

even worse in 3D (millions of unknowns)

problem: SVD is

today impractical to compute for systems larger than (takes a couple of hours)

Question: How to compute regularized solutions for large scale systems ?

Intel Xeon 2-core (E5503) @ 2GHz (introduced 2010)

Page 36: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

Explicit Regularization

Answer: modify original problem to include additional optimization goals (e.g. small norm solutions)

minimize modified quadratic form

regularized normal equations:

Page 37: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

Modified Normal Equations

include data term, smoothness term and blending parameter

data Prior information (popular: smoothness)

blending (regularization) parameter

Page 38: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

setting and we have a quadratic optimization problem with data fitting and minimum norm terms

large will result in small value solution, small fits the data well

find good trade-off

Tikhonov Regularization

data fitting minimum norm

regularization parameter

Page 39: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

Tikhonov Regularization - Example

reconstruction for different choices of

small lambda, many oscillations

large lambda, smooth solution (in the limit constant)

Page 40: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

Tikhonov Regularization - Example

Page 41: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

L-Curve criterion [Hansen98]

need automatic way of determining

want solution with small oscillations

also want good data fit

log-log plot of norm of residual (data fitting error) vs. norm of the solution (measure of oscillations in solution)

¸

Page 42: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

L-Curve Criterion

video shows reconstructions for different

start with

L-Curve regularized solution

Page 43: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

L-Curve Criterion

compute L-Curve by solving inverse problem with choices of over a large range, e.g.

point of highest curvature on resulting curve corresponds to optimal regularization parameter

curvature computation

find maximum and use corresponding to compute optimal solution

Page 44: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

L-Curve Criterion – Example 1D Deconvolution

L-curve with automatically selected optimal point

optimal regularization parameter is different for every problem

Page 45: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

L-Curve Criterion –Example 1D Deconvolution

regularized solution (red) with optimal

Page 46: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

Solving Large Linear Systems

we can now regularize large ill-conditioned linear systems

How to solve them ?

Gaussian elimination:

SVD:

direct solution methods are too time-consuming

Solution: approximate iterative solution

Page 47: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

Iterative Solution Methods for Large Linear Systems

stationary iterative methods [Barret94]

Examples

─ Jacobi

─ Gauss-Seidel

─ Successive Over-Relaxation (SOR)

use fixed-point iteration

─ matrix G and vector c are constant throughout iteration

─ generally slow convergence

─ don't use for practical applications

Page 48: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

Iterative Solution Methods for Large Linear Systems

non-stationary iterative methods [Barret94]

conjugate gradients (CG)

─ symmetric, positive definite linear systems ( SPD )

conjugate gradients for the normal equations

short CGLS or CGNR

─ avoid explicit computation of

CG – type methods are good because

─ fast convergence (depends on condition number)

─ regularization built in !

─ number of iterations = regularization parameter

─ behave similar to truncated SVD

Page 49: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

Iterative Solution Methods for Large Linear Systems

iterative solution methods require only matrix-vector multiplications

most efficient if matrix is sparse

sparse matrix means lots of zero entries

back to our hypothetical 65536x65536 matrix

memory consumption for full matrix:

sparse matrices store only non-zero matrix entries

Question: How do we get sparse matrices ?

A

Page 50: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

Iterative Solution Methods for Large Linear Systems

answer: use a discretization with basis functions that have local support, i.e. which are themselves zero over a wide range

for deconvolution the filter kernel should also be locally supported

discretized model:

Page 51: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

Iterative Solution Methods for Large Linear Systems

answer: use a discretization with basis functions that have local support, i.e. which are themselves zero over a wide range

for deconvolution the filter kernel should also be locally supported

discretized model:

will be zero

over a wide

range of values

Page 52: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

Iterative Solution Methods for Large Linear Systems

sparse matrix structure for 1D deconvolution problem

Page 53: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

Inverse Problems – Wrap Up

inverse problems are often ill-posed

if solution is unstable – check condition number

if problem is small use TSVD and Matlab

otherwise use CG if problem is symmetric (positive definite), otherwise CGLS

if convergence is slow try Tikhonov regularization – it's simple

improves condition number and thus convergence

if problem gets large make sure you have a sparse linear system!

if system is sparse, avoid computing explicitly – it is

usually dense

Page 54: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

Example

Coded Aperture Imaging

Page 55: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

Coded Aperture

Motivation

building a camera without a lens

hard to bend high energy rays

─ astronomy, x-rays

high energy rays can be blocked -> pinhole?

pinhole has too much light loss

use multiple pinholes at the same time

how to reconstruct the desired signal?

Page 56: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

Coded Aperture Imaging

Page 57: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

Coded Aperture Imaging

Page 58: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

Coded Aperture Imaging

Page 59: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

Coded Aperture Imaging

Page 60: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

Coded Aperture Imaging

Page 61: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

Coded Aperture Imaging

Page 62: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

Coded Aperture Imaging

Page 63: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

Reconstruction by Inversion

acquisition:

inversion:

the mask needs to be invertible

even if it is there might be some numerical problems

(condition number of M)

Page 64: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

An Example

[http://www.paulcarlisle.net/old/codedaperture.html]

original image

larger aperture

single pinhole

multiple pinholes

Page 65: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

coding pattern:

,

MURA Code

Simulated coded

aperture image

Page 66: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

Reconstruction by Inverse Filtering

decoding pattern:

compute convolution between captured image and D

A

0 0 0 0 0

1 1 0 0 1

1 0 1 1 0

1 0 1 1 0

1 1 0 0 1

D

+ - - - -+ + - - ++ - + + -+ - + + -+ + - - +

reconstructed image

Page 67: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

Computational Photography Example

Hardware-based Stabilization of Deconvolution

(Flutter Shutter Camera)

Slides by Ramesh Raskar

Page 68: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

Input Image

Page 69: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

Rectified Crop

Deblurred Result

Page 70: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

Page 71: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

Page 72: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

Page 73: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

Traditional Camera

Shutter is OPEN

Page 74: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

Flutter Shutter Camera

Shutter is OPEN and CLOSED

Page 75: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014Comparison of Blurred Images

Page 76: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

Implementation

Completely Portable

Page 77: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

Lab Setup

Page 78: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

Blurring ==

Convolution

Traditional Camera: Box Filter

Sync Function

Zeros !

Log space

Page 79: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

Flutter Shutter: Coded Filter

Preserves High Frequencies!!!

Page 80: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

Comparison

Page 81: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

Inverse Filter Unstable

Inverse Filter stable

Page 82: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

Short Exposure Long Exposure Coded Exposure

Ground TruthMatlab Lucy

Flutter Shutter

Page 83: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

References

[Barret94] - Barret et al. “Templates for the solution of linear systems: Building Blocks for Iterative Methods”, 2nd edition, 1994

[Hansen98] – Per-Christian Hansen “Rank-Deficient and Discrete Ill-Posed Problems”, 1998

[Raskar06] - Ramesh Raskar, Amit Agrawal, and Jack Tumblin, Coded Exposure Photography: Motion Deblurring using Fluttered Shutter, ACM SIGGRAPH 2006

Page 84: Computational Optical Imaging - Optique Numerique ...giana.mmci.uni-saarland.de/.../lecture02_deconvolution.pdfLarge Linear Systems iterative solution methods require only matrix-vector

Ivo Ihrke / Winter 2014

Exercise

Implement the MURA pattern

Convolve an image with the pattern

normalized, range [0,1]

Add noise

Deconvolve using inverse mask

Compute RMS error to original image

Plot noise level vs. RMS error for different runs