153
Computational Photography and Image Manipulation CMPT 469 / 985, Fall 2019 Week 12 Deconvolution and Noise 1

Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Computational Photography and Image ManipulationCMPT 469 / 985, Fall 2019

Week 12

Deconvolution and Noise

1

Page 2: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Slide credits

• Slides thanks to Ioannis Gkioulekas along with his acknowledgements.

2

Page 3: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Why are our images blurry?

• Lens imperfections.

• Camera shake.

• Scene motion.

• Depth defocus.

Page 4: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Lens imperfections

object distance D focus distance D’

• Ideal lens: An point maps to a point at a certain plane.

Page 5: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Lens imperfections

object distance D focus distance D’

• Ideal lens: An point maps to a point at a certain plane.• Real lens: A point maps to a circle that has non-zero minimum radius among all planes.

Page 6: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Lens imperfections

object distance D focus distance D’

• Ideal lens: An point maps to a point at a certain plane.• Real lens: A point maps to a circle that has non-zero minimum radius among all planes.

Shift-invariant blur.

blur kernel

Page 7: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Lens imperfectionsWhat causes lens imperfections?• Aberrations.

• Diffraction.

large aperture

small aperture

(Important note: Oblique aberrations like coma and distortion are not shift-invariant blur and we do not consider them here!)

Page 8: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Lens as an optical low-pass filter

object distance D focus distance D’

Point spread function (PSF): The blur kernel of a lens.• “Diffraction-limited” PSF: No aberrations, only diffraction. Determined by aperture shape.

diffraction-limited PSF of a circular

aperture

blur kernel

Page 9: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Lens as an optical low-pass filter

object distance D focus distance D’

Point spread function (PSF): The blur kernel of a lens.• “Diffraction-limited” PSF: No aberrations, only diffraction. Determined by aperture shape.

Optical transfer function (OTF): The Fourier transform of the PSF. Equal to aperture shape.

diffraction-limited PSF of a circular

aperture

blur kernel

diffraction-limited OTF of a circular

aperture

Page 10: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Lens as an optical low-pass filter

image from a perfect lens

*

imperfect lens PSF

=

image from imperfect lens

x * c = b

Page 11: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Lens as an optical low-pass filter

image from a perfect lens

*

imperfect lens PSF

=

image from imperfect lens

x * c = b

If we know c and b, can we recover x?

Page 12: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Deconvolution

x * c = b

After division, just do inverse Fourier transform:

Reminder: convolution is multiplication in Fourier domain:

F(x) . F(c) = F(b)Deconvolution is division in Fourier domain:

F(xest) = F(b) \ F(c)

xest = F-1 ( F(b) \ F(c) )

Page 13: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Deconvolution

• When we divide by zero, we amplify the high frequency noise

• The OTF (Fourier of PSF) is a low-pass filter

b = c * x + n

• The measured signal includes noise

noise term

zeros at high frequencies

Page 14: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Naïve deconvolution

* =

b * c-1 = xest

-1

Even tiny noise can make the results awful.• Example for Gaussian of σ = 0.05

Page 15: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Wiener Deconvolution

noise-dependent damping factor

Apply inverse kernel and do not divide by zero:

|F(c)|2

xest = F-1 ( ⋅ ) |F(c)|2 + 1/SNR(ω)

F(b)

F(c)

• Derived as solution to maximum-likelihood problem under Gaussian noise assumption• Requires noise of signal-to-noise ratio at each frequency

SNR(ω) =signal variance at ω

noise variance at ω

Page 16: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Wiener Deconvolution

noise-dependent damping factor

Apply inverse kernel and do not divide by zero:

|F(c)|2

xest = F-1 ( ⋅ ) |F(c)|2 + 1/SNR(ω)

F(b)

F(c)

Intuitively:• When SNR is high (low or no noise), just divide by kernel.• When SNR is low (high noise), just set to zero.

Page 17: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Deconvolution comparisons

naïve deconvolution Wiener deconvolution

Page 18: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Deconvolution comparisons

σ = 0.01 σ = 0.05 σ = 0.01

Page 19: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Derivation

𝑥 = 𝑐 ∗ 𝑥 + 𝑛Noise n is assumed to be zero-mean and independent of signal x.

Sensing model:

Page 20: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Derivation

𝑏 = 𝑐 ∗ 𝑥 + 𝑛Noise n is assumed to be zero-mean and independent of signal x.

Sensing model:

Fourier transform:

𝐵 = 𝐶 ⋅ 𝑋 + 𝑁

Page 21: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Derivation

Noise n is assumed to be zero-mean and independent of signal x.

Sensing model:

Fourier transform:

Problem statement: Find function H(ω) that minimizes expected error in Fourier domain.

Convolution becomes multiplication.

min𝐻

𝐸 𝑋 − 𝐻 ෨𝐵2

𝑏 = 𝑐 ∗ 𝑥 + 𝑛

𝐵 = 𝐶 ⋅ 𝑋 + 𝑁

Page 22: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

DerivationReplace B and re-arrange loss:

min𝐻

𝐸 1 + 𝐻𝐶 𝑋 − 𝐻𝑁 2

min𝐻

1 − 𝐻𝐶 2𝐸 𝑋 2 − 2 1 − 𝐻𝐶 𝐸 𝑋𝑁 + 𝐻 2𝐸 𝑁 2

Expand the squares:

Page 23: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

DerivationWhen handling the cross terms:• Can I write the following?

𝐸 𝑋𝑁 = 𝐸 𝑋 𝐸 𝑁

Page 24: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

DerivationWhen handling the cross terms:• Can I write the following?

𝐸 𝑋𝑁 = 𝐸 𝑋 𝐸 𝑁

Yes, because X and N are assumed independent.

• What is this expectation product equal to?

Page 25: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

DerivationWhen handling the cross terms:• Can I write the following?

𝐸 𝑋𝑁 = 𝐸 𝑋 𝐸 𝑁

Yes, because X and N are assumed independent.

• What is this expectation product equal to?

Zero, because N has zero mean.

Page 26: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

DerivationReplace B and re-arrange loss:

min𝐻

𝐸 1 + 𝐻𝐶 𝑋 − 𝐻𝑁 2

min𝐻

1 − 𝐻𝐶 2𝐸 𝑋 2 − 2 1 − 𝐻𝐶 𝐸 𝑋𝑁 + 𝐻 2𝐸 𝑁 2

Expand the squares:

cross-term is zero

min𝐻

1 − 𝐻𝐶 2𝐸 𝑋 2 + 𝐻 2𝐸 𝑁 2

Simplify:

How do we solve this optimization problem?

Page 27: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

DerivationDifferentiate loss with respect to H, set to zero, and solve for H:

𝜕loss

𝜕𝐻= 0

⇒ −2 1 − 𝐻𝐶 𝐸 𝑋 2 + 2𝐻𝐸 𝑁 2 = 0

⇒ 𝐻 =𝐶𝐸 𝑋 2

𝐶2𝐸 𝑋 2 + 𝐸 𝑁 2

Divide both numerator and denominator with 𝐸 𝑋 2 , extract factor 1/C, and done!

Page 28: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Wiener Deconvolution

noise-dependent damping factor

Apply inverse kernel and do not divide by zero:

|F(c)|2

xest = F-1 ( ⋅ ) |F(c)|2 + 1/SNR(ω)

F(b)

F(c)

• Derived as solution to maximum-likelihood problem under Gaussian noise assumption• Requires estimate of signal-to-noise ratio at each frequency

SNR(ω) =signal variance at ω

noise variance at ω

Page 29: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Natural image and noise spectraNatural images tend to have spectrum that scales as 1 / ω2

• This is a natural image statistic

Page 30: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Natural image and noise spectraNatural images tend to have spectrum that scales as 1 / ω2

• This is a natural image statistic

Noise tends to have flat spectrum, σ(ω) = constant• We call this white noise

What is the SNR?

Page 31: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Natural image and noise spectraNatural images tend to have spectrum that scales as 1 / ω2

• This is a natural image statistic

Noise tends to have flat spectrum, σ(ω) = constant• We call this white noise

Therefore, we have that: SNR(ω) = 1 / ω2

Page 32: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Wiener Deconvolution

amplitude-dependent damping factor

Apply inverse kernel and do not divide by zero:

|F(c)|2

xest = F-1 ( ⋅ )|F(c)|2 + ω2

F(b)

F(c)

• Derived as solution to maximum-likelihood problem under Gaussian noise assumption• Requires noise of signal-to-noise ratio at each frequency

SNR(ω) =1

ω2

Page 33: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Wiener Deconvolution

gradient regularization

For natural images and white noise, it can be re-written as the minimization problem

minx ‖b – c ∗ x‖2 + ‖∇x‖2

How can you prove this equivalence?

• Convert to Fourier domain and repeat the proof for Wiener deconvolution.• Intuitively: The ω2 term in the denominator of the special Wiener filter is the square of

the Fourier transform of ∇x, which is i⋅ω.

Page 34: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Deconvolution comparisons

blurry input gradient regularizationnaive deconvolution original

Page 35: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Deconvolution comparisons

blurry input gradient regularizationnaive deconvolution original

Page 36: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

… and a proof-of-concept demonstration

noisy input gradient regularizationnaive deconvolution

Page 37: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Question

Can we undo lens blur by deconvolving a PNG or JPEG image without any preprocessing?

Page 38: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Question

Can we undo lens blur by deconvolving a PNG or JPEG image without any preprocessing?• All the blur processes we discuss today happen optically (before capture by the sensor).• Blur model is accurate only if our images are linear.

Are PNG or JPEG images linear?

Page 39: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Question

Can we undo lens blur by deconvolving a PNG or JPEG image without any preprocessing?• All the blur processes we discuss today happen optically (before capture by the sensor).• Blur model is accurate only if our images are linear.

Are PNG or JPEG images linear?• No, because of gamma encoding.• Before deblurring, you must linearize your images.

Page 40: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

The importance of linearity

blurry input deconvolution after linearization

deconvolution without linearization

original

Page 41: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Different gradient regularizations

minx ‖b – c ∗ x‖2 + ‖∇x‖2

minx ‖b – c ∗ x‖2 + ‖∇x‖1

minx ‖b – c ∗ x‖2 + ‖∇x‖0.8

• L2 gradient regularization (Tikhonov regularization, same as Wiener deconvolution)

• L1 gradient regularization (sparsity regularization, same as total variation)

• Ln<1 gradient regularization (fractional regularization)

All of these are motivated by natural image statistics. Active research area.

Page 42: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Comparison of gradient regularizations

inputsquared gradient

regularizationfractional gradient

regularization

Page 43: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

High quality images using cheap lenses

[Heide et al., “High-Quality Computational Imaging Through Simple Lenses,” TOG 2013]

Page 44: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Deconvolution

* =

x * c = b

If we know b and c, can we recover x?

?

How do we measure this?

Page 45: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

PSF calibration

Take a photo of a point source

Image of PSF

Image with sharp lens Image with cheap lens

Page 46: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Deconvolution

* =

x * c = b

If we know b and c, can we recover x?

?

Page 47: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Blind deconvolution

* =

x * c = b

If we know b, can we recover x and c?

? ?

Page 48: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Camera shake

Page 49: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Camera shake as a filter

image from static camera

*

PSF from camera motion

=

image from shaky camera

x * c = b

If we know b, can we recover x and c?

Page 50: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Multiple possible solutions

How do we detect this

one?

Page 51: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Use prior information

Among all the possible pairs of images and blur kernels, select the ones where:

• The image “looks like” a natural image.

• The kernel “looks like” a motion PSF.

Page 52: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Use prior information

Among all the possible pairs of images and blur kernels, select the ones where:

• The image “looks like” a natural image.

• The kernel “looks like” a motion PSF.

Page 53: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Shake kernel statisticsGradients in natural images follow a characteristic “heavy-tail” distribution.

sharp natural image

blurry natural image

Can be approximated by ‖∇x‖0.8

Page 54: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Use prior information

Among all the possible pairs of images and blur kernels, select the ones where:

• The image “looks like” a natural image.

• The kernel “looks like” a motion PSF.

Gradients in natural images follow a characteristic “heavy-tail” distribution.

Shake kernels are very sparse, have continuous contours, and are always positive

How do we use this information for blind deconvolution?

Page 55: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Regularized blind deconvolution

Solve regularized least-squares optimization

minx,b ‖b – c ∗ x‖2 + ‖∇x‖0.8 + ‖c‖1

What does each term in this summation correspond to?

Page 56: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Regularized blind deconvolution

natural image prior

Solve regularized least-squares optimization

minx,b ‖b – c ∗ x‖2 + ‖∇x‖0.8 + ‖c‖1

data term shake kernel prior

Note: Solving such optimization problems is complicated (no longer linear least squares).

Page 57: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

A demonstration

input deconvolved image and kernel

This image looks worse than the original…

This doesn’t look like a plausible shake kernel…

Page 58: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Regularized blind deconvolution

Solve regularized least-squares optimization

minx,b ‖b – c ∗ x‖2 + ‖∇x‖0.8 + ‖c‖1

loss function

Page 59: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Regularized blind deconvolution

Solve regularized least-squares optimization

minx,b ‖b – c ∗ x‖2 + ‖∇x‖0.8 + ‖c‖1

loss functioninverse

loss

pixel intensity

Where in this graph is the solution we find?

Page 60: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Regularized blind deconvolution

Solve regularized least-squares optimization

minx,b ‖b – c ∗ x‖2 + ‖∇x‖0.8 + ‖c‖1

loss functioninverse

loss

pixel intensityoptimal solution

many plausible solutions here

Rather than keep just maximum, do a weighted

average of all solutions

Page 61: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

A demonstration

input maximum-only

This image looks worse than the original…

average

Page 62: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

More examples

Page 63: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Results on real shaky images

Page 64: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Results on real shaky images

Page 65: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Results on real shaky images

Page 66: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Results on real shaky images

Page 67: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

More advanced motion deblurring

[Shah et al., High-quality Motion Deblurring from a Single Image, SIGGRAPH 2008]

Page 68: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Why are our images blurry?

• Lens imperfections.

• Camera shake.

• Scene motion.

• Depth defocus.

Can we solve all of these problems using (blind) deconvolution?

Page 69: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Why are our images blurry?

• Lens imperfections.

• Camera shake.

• Scene motion.

• Depth defocus.

Can we solve all of these problems using (blind) deconvolution?• We can deal with (some) lens imperfections and camera

shake, because their blur is shift invariant.• We cannot deal with scene motion and depth defocus,

because their blur is not shift invariant.

Page 70: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

ReferencesBasic reading:• Szeliski textbook, Sections 3.4.3, 3.4.4, 10.1.4, 10.3.• Fergus et al., “Removing camera shake from a single image,” SIGGRAPH 2006.

the main motion deblurring and blind deconvolution paper we covered in this lecture.

Additional reading:• Heide et al., “High-Quality Computational Imaging Through Simple Lenses,” TOG 2013.

the paper on high-quality imaging using cheap lenses, which also has a great discussion of all matters relating to blurring from lens aberrations and modern deconvolution algorithms.

• Levin, “Blind Motion Deblurring Using Image Statistics,” NIPS 2006.• Levin et al., “Image and depth from a conventional camera with a coded aperture,” SIGGRAPH 2007.• Levin et al., “Understanding and evaluating blind deconvolution algorithms,” CVPR 2009 and PAMI 2011.• Krishnan and Fergus, “Fast Image Deconvolution using Hyper-Laplacian Priors,” NIPS 2009.• Levin et al., “Efficient Marginal Likelihood Optimization in Blind Deconvolution,” CVPR 2011.

a sequence of papers developing the state of the art in blind deconvolution of natural images, including the use Laplacian (sparsity) and hyper-Laplacian priors on gradients, analysis of different loss functions and maximum a-posteriori versus Bayesian estimates, the use of variational inference, and efficient optimization algorithms.

• Minskin and MacKay, “Ensemble Learning for Blind Image Separation and Deconvolution,” AICA 2000.the paper explaining the mathematics of how to compute Bayesian estimators using variational inference.

• Shah et al., “High-quality Motion Deblurring from a Single Image,” SIGGRAPH 2008.a more recent paper on motion deblurring.

Page 71: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Noise

Page 72: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Side-effects of increasing ISOImage becomes very grainy because noise is amplified.• Why does increasing ISO increase noise?

Page 73: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Sensor noise

Page 74: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

A quick note

• We will only consider per-pixel noise.

• We will not consider cross-pixel noise effects (blooming, smearing, cross-talk, and so on).

Page 75: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Noise in images

Results in “grainy” appearance.

Page 76: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

The (in-camera) image processing pipeline

• Noise is introduced in the green part.

analog front-end

RAW image (mosaiced,

linear, 12-bit)white

balanceCFA

demosaicingdenoising

color transforms

tone reproduction

compressionfinal RGB

image (non-linear, 8-bit)

Page 77: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

The noisy image formation process

What are the various parts?

Page 78: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

The noisy image formation process

analog-to-digital converter (ADC)

analog voltage L

analog voltage G

discrete signal I

scene radiant flux Φ

analog amplifier (gain g = k ⋅ ISO)

sensor (exposure t, quantum efficiency α)

dark current D

Page 79: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

The noisy image formation process

analog-to-digital converter (ADC)

analog voltage L

analog voltage G

discrete signal I

scene radiant flux Φ

analog amplifier (gain g = k ⋅ ISO)

sensor (exposure t, quantum efficiency α)

dark current D

introduces photon noise and dark noise

introduces read noise

introduces ADC noise

• We will be ignoring saturation, but it can be modeled using a clipping operation.

Page 80: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

simulated mean #photons/pixel

0.001 0.01 0.1

1 10 100

Photon noiseA consequence of the discrete (quantum) nature of light. • Photon detections are independent random events.• Total number of detections is Poisson distributed.• Also known as shot noise and Schott noise.

Ndetections ∼ Poisson[t ⋅ α ⋅ Φ]

photon noise depends on scene flux and exposure

Page 81: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Can you think of examples when dark noise is important?

Dark noiseA consequence of “phantom detections” by the sensor. • Electrons are randomly released without any photons.• Total number of detections is Poisson distributed.• Increases exponentially with sensor temperature (+6°C ≈ doubling).

Ndetections ∼ Poisson[t ⋅ D]

dark noise depends on exposure but not on scene

Page 82: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Can you think of examples when dark noise is important?

• Very long exposures (astrophotography, pinhole camera).

Dark noiseA consequence of “phantom detections” by the sensor. • Electrons are randomly released without any photons.• Total number of detections is Poisson distributed.• Increases exponentially with sensor temperature (+6°C ≈ doubling).

Ndetections ∼ Poisson[t ⋅ D]

dark noise depends on exposure but not on scene

Can you think of ways to mitigate dark noise?

Page 83: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Can you think of examples when dark noise is important?

• Very long exposures (astrophotography, pinhole camera).

Dark noiseA consequence of “phantom detections” by the sensor. • Electrons are randomly released without any photons.• Total number of detections is Poisson distributed.• Increases exponentially with sensor temperature (+6°C ≈ doubling).

Ndetections ∼ Poisson[t ⋅ D]

dark noise depends on exposure but not on scene

Can you think of ways to mitigate dark noise?

• Cool the sensor.

• Average multiple shorter exposures.

Page 84: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Poisson distributionIs it a continuous or discrete probability distribution?

Page 85: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Poisson distributionIs it a continuous or discrete probability distribution?

• It is discrete.

How many parameters does it depend on?

Page 86: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Poisson distributionIs it a continuous or discrete probability distribution?

• It is discrete.

What is its probability mass function?

How many parameters does it depend on?

• One parameter, the rate λ.

Page 87: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Poisson distributionIs it a continuous or discrete probability distribution?

• It is discrete.

What is its probability mass function?

𝑁 ∼ Poisson(𝜆) ⇔ 𝑃(𝑁 = 𝑘; 𝜆) =𝜆𝑘𝑒−𝜆

𝑘!

How many parameters does it depend on?

• One parameter, the rate λ.

What is its mean and variance?

Page 88: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Poisson distributionIs it a continuous or discrete probability distribution?

• It is discrete.

What is its probability mass function?

𝑁 ∼ Poisson(𝜆) ⇔ 𝑃(𝑁 = 𝑘; 𝜆) =𝜆𝑘𝑒−𝜆

𝑘!

How many parameters does it depend on?

• One parameter, the rate λ.

What is its mean and variance?

• Mean: μ(N) = λ

• Variance: σ(N)2 = λ

The mean and variance of a Poisson random variable both equal the rate λ.

What is the distribution of the sum of two Poisson random variables?

Page 89: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Poisson distributionIs it a continuous or discrete probability distribution?

• It is discrete.

What is its probability mass function?

𝑁 ∼ Poisson(𝜆) ⇔ 𝑃(𝑁 = 𝑘; 𝜆) =𝜆𝑘𝑒−𝜆

𝑘!

How many parameters does it depend on?

• One parameter, the rate λ.

What is its mean and variance?

• Mean: μ(N) = λ

• Variance: σ(N)2 = λ

The mean and variance of a Poisson random variable both equal the rate λ.

What is the distribution of the sum of two Poisson random variables?

𝑁1 ∼ Poisson 𝜆1 , 𝑁2 ∼ Poisson 𝜆2 ⇒ 𝑁1 + 𝑁2 ∼ Poisson 𝜆1 + 𝜆2

Page 90: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Fundamental question

Why are photon noise and dark noise Poisson random variables?

Page 91: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

The noisy image formation process

analog-to-digital converter (ADC)

analog voltage L

analog voltage G

discrete signal I

scene radiant flux Φ

analog amplifier (gain g = k ⋅ ISO)

sensor (exposure t, quantum efficiency α)

dark current D

introduces photon noise and dark noise

introduces read noise

introduces ADC noise

• What is the distribution of the sensor readout L?

Page 92: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

The distribution of the sensor readoutWe know that the sensor readout is the sum of all released electrons:

𝐿 = 𝑁photon_detections + 𝑁phantom_detections

What is the distribution of photon detections?

Page 93: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

The distribution of the sensor readoutWe know that the sensor readout is the sum of all released electrons:

𝐿 = 𝑁photon_detections + 𝑁phantom_detections

What is the distribution of photon detections?

𝑁photon_detections ∼ Poisson(𝑡 ⋅ 𝛼 ⋅ Φ)

What is the distribution of phantom detections?

Page 94: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

The distribution of the sensor readoutWe know that the sensor readout is the sum of all released electrons:

𝐿 = 𝑁photon_detections + 𝑁phantom_detections

What is the distribution of photon detections?

𝑁photon_detections ∼ Poisson(𝑡 ⋅ 𝛼 ⋅ Φ)

What is the distribution of phantom detections?

𝑁phantom_detections ∼ Poisson(𝑡 ⋅ 𝐷)

What is the distribution of the sensor readout?

Page 95: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

The distribution of the sensor readoutWe know that the sensor readout is the sum of all released electrons:

𝐿 = 𝑁photon_detections + 𝑁phantom_detections

What is the distribution of photon detections?

𝑁photon_detections ∼ Poisson(𝑡 ⋅ 𝛼 ⋅ Φ)

What is the distribution of phantom detections?

𝑁phantom_detections ∼ Poisson(𝑡 ⋅ 𝐷)

What is the distribution of the sensor readout?

𝐿 ∼ Poisson(𝑡 ⋅ (𝑎 ⋅ Φ + 𝐷))

Page 96: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

The noisy image formation process

analog-to-digital converter (ADC)

analog voltage G

discrete signal I

scene radiant flux Φ

analog amplifier (gain g = k ⋅ ISO)

sensor (exposure t, quantum efficiency α)

dark current D

introduces photon noise and dark noise

introduces read noise

introduces ADC noise

analog voltage 𝐿,𝐿 ∼ Poisson(𝑡 ⋅ (𝑎 ⋅ Φ + 𝐷))

Page 97: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Read and ADC noiseA consequence of random voltage fluctuations before and after amplifier. • Both are independent of scene and exposure.• Both are normally (zero-mean Guassian) distributed. • ADC noise includes quantization errors.

nread ∼ Normal(0, σread)

Very important for dark pixels.

nADC ∼ Normal(0, σADC)

Page 98: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

The noisy image formation process

analog-to-digital converter (ADC)

analog voltage G

discrete signal I

scene radiant flux Φ

analog amplifier (gain g = k ⋅ ISO)

sensor (exposure t, quantum efficiency α)

dark current D

introduces photon noise and dark noise

introduces read noise

introduces ADC noise

• How can we express the voltage G and discrete intensity I?

analog voltage 𝐿,𝐿 ∼ Poisson(𝑡 ⋅ (𝑎 ⋅ Φ + 𝐷))

Page 99: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Expressions for the amplifier and ADC outputs

Both read noise and ADC noise are additive and zero-mean.

• How can we express the output of the amplifier?

Page 100: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Expressions for the amplifier and ADC outputs

Both read noise and ADC noise are additive and zero-mean.

• How can we express the output of the amplifier?

𝐺 = 𝐿 ⋅ 𝑔 + 𝑛read ⋅ 𝑔

• How can we express the output of the ADC?

don’t forget to account for the ISO-dependent gain

Page 101: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Expressions for the amplifier and ADC outputs

Both read noise and ADC noise are additive and zero-mean.

• How can we express the output of the amplifier?

𝐺 = 𝐿 ⋅ 𝑔 + 𝑛read ⋅ 𝑔

• How can we express the output of the ADC?

𝐼 = 𝐺 + 𝑛ADC

don’t forget to account for the ISO-dependent gain

Page 102: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

The noisy image formation process

analog-to-digital converter (ADC)

scene radiant flux Φ

analog amplifier (gain g = k ⋅ ISO)

sensor (exposure t, quantum efficiency α)

dark current D

introduces photon noise and dark noise

introduces read noise

introduces ADC noise

analog voltage 𝐿,𝐿 ∼ Poisson(𝑡 ⋅ (𝑎 ⋅ Φ + 𝐷))

analog voltage 𝐺 = 𝐿 ⋅ 𝑔 + 𝑛read ⋅ 𝑔,𝑛read ∼ Normal(0, 𝜎read)

discrete signal 𝐼 = 𝐺 + 𝑛ADC,𝑛ADC ∼ Normal(0, 𝜎ADC)

Page 103: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Putting it all togetherWithout saturation, the digital intensity equals:

𝐼 = 𝐿 ⋅ 𝑔 + 𝑛read ⋅ 𝑔 + 𝑛ADC

𝐿 ∼ Poisson 𝑡 ⋅ 𝑎 ⋅ Φ + 𝐷

𝑛read ∼ Normal(0, 𝜎read)𝑛ADC ∼ Normal(0, 𝜎ADC)

where

What is the mean of the digital intensity (assuming no saturation)?

𝐸 𝐼 =

Page 104: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Putting it all togetherWithout saturation, the digital intensity equals:

𝐼 = 𝐿 ⋅ 𝑔 + 𝑛read ⋅ 𝑔 + 𝑛ADC

𝐿 ∼ Poisson 𝑡 ⋅ 𝑎 ⋅ Φ + 𝐷

𝑛read ∼ Normal(0, 𝜎read)𝑛ADC ∼ Normal(0, 𝜎ADC)

where

What is the mean of the digital intensity (assuming no saturation)?

𝐸 𝐼 = 𝐸 𝐿 ⋅ 𝑔 + 𝐸 𝑛read ⋅ 𝑔 + 𝐸 𝑛ADC

=

Page 105: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Putting it all togetherWithout saturation, the digital intensity equals:

𝐼 = 𝐿 ⋅ 𝑔 + 𝑛read ⋅ 𝑔 + 𝑛ADC

𝐿 ∼ Poisson 𝑡 ⋅ 𝑎 ⋅ Φ + 𝐷

𝑛read ∼ Normal(0, 𝜎read)𝑛ADC ∼ Normal(0, 𝜎ADC)

where

What is the mean of the digital intensity (assuming no saturation)?

𝐸 𝐼 = 𝐸 𝐿 ⋅ 𝑔 + 𝐸 𝑛read ⋅ 𝑔 + 𝐸 𝑛ADC

= 𝑡 ⋅ 𝑎 ⋅ Φ + 𝐷 ⋅ 𝑔

What is the variance of the digital intensity (assuming no saturation)?

𝜎 𝐼 2 =

Page 106: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Putting it all togetherWithout saturation, the digital intensity equals:

𝐼 = 𝐿 ⋅ 𝑔 + 𝑛read ⋅ 𝑔 + 𝑛ADC

𝐿 ∼ Poisson 𝑡 ⋅ 𝑎 ⋅ Φ + 𝐷

𝑛read ∼ Normal(0, 𝜎read)𝑛ADC ∼ Normal(0, 𝜎ADC)

where

What is the mean of the digital intensity (assuming no saturation)?

𝐸 𝐼 = 𝐸 𝐿 ⋅ 𝑔 + 𝐸 𝑛read ⋅ 𝑔 + 𝐸 𝑛ADC

= 𝑡 ⋅ 𝑎 ⋅ Φ + 𝐷 ⋅ 𝑔

What is the variance of the digital intensity (assuming no saturation)?

𝜎 𝐼 2 = 𝜎 𝐿 ⋅ 𝑔 2 + 𝜎 𝑛read ⋅ 𝑔 2 + 𝜎 𝑛ADC2

=

Page 107: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Putting it all togetherWithout saturation, the digital intensity equals:

𝐼 = 𝐿 ⋅ 𝑔 + 𝑛read ⋅ 𝑔 + 𝑛ADC

𝐿 ∼ Poisson 𝑡 ⋅ 𝑎 ⋅ Φ + 𝐷

𝑛read ∼ Normal(0, 𝜎read)𝑛ADC ∼ Normal(0, 𝜎ADC)

where

What is the mean of the digital intensity (assuming no saturation)?

𝐸 𝐼 = 𝐸 𝐿 ⋅ 𝑔 + 𝐸 𝑛read ⋅ 𝑔 + 𝐸 𝑛ADC

= 𝑡 ⋅ 𝑎 ⋅ Φ + 𝐷 ⋅ 𝑔

What is the variance of the digital intensity (assuming no saturation)?

𝜎 𝐼 2 = 𝜎 𝐿 ⋅ 𝑔 2 + 𝜎 𝑛read ⋅ 𝑔 2 + 𝜎 𝑛ADC2

= 𝑡 ⋅ 𝑎 ⋅ Φ + 𝐷 ⋅ 𝑔2 + 𝜎read2 ⋅ 𝑔2 + 𝜎ADC

2

Page 108: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

The noisy image formation process

analog-to-digital converter (ADC)

scene radiant flux Φ

analog amplifier (gain g = k ⋅ ISO)

sensor (exposure t, quantum efficiency α)

dark current D

analog voltage 𝐿,𝐿 ∼ Poisson(𝑡 ⋅ (𝑎 ⋅ Φ + 𝐷))

analog voltage 𝐺 = 𝐿 ⋅ 𝑔 + 𝑛read ⋅ 𝑔,𝑛read ∼ Normal(0, 𝜎read)

discrete signal 𝐼 = 𝐺 + 𝑛ADC,𝑛ADC ∼ Normal(0, 𝜎ADC)

𝐼 = min(𝐿 ⋅ 𝑔 + 𝑛read ⋅ 𝑔 + 𝑛ADC, 𝐼max) 𝐸 𝐼 = 𝑡 ⋅ 𝑎 ⋅ Φ + 𝐷 ⋅ 𝑔

𝜎 𝐼 2 = 𝑡 ⋅ 𝑎 ⋅ Φ + 𝐷 ⋅ 𝑔2 + 𝜎read2 ⋅ 𝑔2 + 𝜎ADC

2

discrete image intensity (with saturation): intensity mean and variance:

saturation level

Page 109: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Affine noise modelCombine read and ADC noise into a single additive noise term:

What is the distribution of the additive noise term?

𝐼 = 𝐿 ⋅ 𝑔 + 𝑛add 𝑛add = 𝑛read ⋅ 𝑔 + 𝑛ADCwhere

Page 110: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Affine noise modelCombine read and ADC noise into a single additive noise term:

𝑛add ∼ Normal(0, 𝜎read2 ⋅ 𝑔2 + 𝜎ADC

2 )

What is the distribution of the additive noise term?

• Sum of two independent, normal random variables.

𝐼 = 𝐿 ⋅ 𝑔 + 𝑛add 𝑛add = 𝑛read ⋅ 𝑔 + 𝑛ADCwhere

Page 111: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Affine noise model

analog-to-digital converter (ADC)

scene radiant flux Φ

analog amplifier (gain g = k ⋅ ISO)

sensor (exposure t, quantum efficiency α)

dark current D

analog voltage 𝐿,𝐿 ∼ Poisson(𝑡 ⋅ (𝑎 ⋅ Φ + 𝐷))

discrete signal 𝐼 = 𝐺 + 𝑛add,𝑛add ∼ Normal(0, 𝜎add)

𝐼 = min(𝐿 ⋅ 𝑔 + 𝑛add, 𝐼max) 𝐸 𝐼 = 𝑡 ⋅ 𝑎 ⋅ Φ + 𝐷 ⋅ 𝑔

𝜎 𝐼 2 = 𝑡 ⋅ 𝑎 ⋅ Φ + 𝐷 ⋅ 𝑔2 + 𝜎add2

discrete image intensity (with saturation): intensity mean and variance:

Page 112: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Some observationsIs image intensity an unbiased estimator of (scaled) scene radiant flux?

Page 113: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Some observationsIs image intensity an unbiased estimator of (scaled) scene radiant flux?

• No, because of dark noise (term 𝑡 ⋅ 𝐷 ⋅ 𝑔 in the mean).

When are photon noise and additive noise dominant?

Page 114: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Some observationsIs image intensity an unbiased estimator of (scaled) scene radiant flux?

• No, because of dark noise (term 𝑡 ⋅ 𝐷 ⋅ 𝑔 in the mean).

When are photon noise and additive noise dominant?

• Photon noise is dominant in very bright scenes (photon-limited scenaria).

• Additive noise is dominant in very dark scenes.

Can we ever completely remove noise?

Page 115: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Some observationsIs image intensity an unbiased estimator of (scaled) scene radiant flux?

• No, because of dark noise (term 𝑡 ⋅ 𝐷 ⋅ 𝑔 in the mean).

Can we ever completely remove noise?

• We cannot eliminate photon noise.

• Super-sensitive detectors have pure Poisson photon noise.

single-photon avalanche photodiode (SPAD)

When are photon noise and additive noise dominant?

• Photon noise is dominant in very bright scenes (photon-limited scenaria).

• Additive noise is dominant in very dark scenes.

Page 116: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Summary: noise regimes

regime dominant noise notes

bright pixels photon noise scene-dependentdark pixels read and ADC noise scene-independent

low ISO ADC noise post-gainhigh ISO photon and read noise pre-gain

long exposures dark noise thermal dependence

𝐼 = min(𝐿 ⋅ 𝑔 + 𝑛read ⋅ 𝑔 + 𝑛ADC, 𝐼max) 𝐸 𝐼 = 𝑡 ⋅ 𝑎 ⋅ Φ + 𝐷 ⋅ 𝑔

𝜎 𝐼 2 = 𝑡 ⋅ 𝑎 ⋅ Φ + 𝐷 ⋅ 𝑔2 + 𝜎read2 ⋅ 𝑔2 + 𝜎ADC

2

discrete image intensity (with saturation): intensity mean and variance:

Page 117: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Noise calibration

Page 118: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

How can we estimate the various parameters?

analog-to-digital converter (ADC)

scene radiant flux Φ

analog amplifier (gain g = k ⋅ ISO)

sensor (exposure t, quantum efficiency α)

dark current D

analog voltage 𝐿,𝐿 ∼ Poisson(𝑡 ⋅ (𝑎 ⋅ Φ + 𝐷))

analog voltage 𝐺 = 𝐿 ⋅ 𝑔 + 𝑛read ⋅ 𝑔,𝑛read ∼ Normal(0, 𝜎read)

discrete signal 𝐼 = 𝐺 + 𝑛ADC,𝑛ADC ∼ Normal(0, 𝜎ADC)

𝐼 = min(𝐿 ⋅ 𝑔 + 𝑛read ⋅ 𝑔 + 𝑛ADC, 𝐼max) 𝐸 𝐼 = 𝑡 ⋅ 𝑎 ⋅ Φ + 𝐷 ⋅ 𝑔

𝜎 𝐼 2 = 𝑡 ⋅ 𝑎 ⋅ Φ + 𝐷 ⋅ 𝑔2 + 𝜎read2 ⋅ 𝑔2 + 𝜎ADC

2

discrete image intensity (with saturation): intensity mean and variance:

saturation level

Page 119: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Estimating the dark currentCan you think of a procedure for estimating the dark current D?

Page 120: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Estimating the dark currentCan you think of a procedure for estimating the dark current D?

• Capture multiple images with the sensor completely blocked and average to form the dark frame.

Why is the dark frame a valid estimator of the dark current D?

Page 121: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Estimating the dark currentCan you think of a procedure for estimating the dark current D?

• Capture multiple images with the sensor completely blocked and average to form the dark frame.

Why is the dark frame a valid estimator of the dark current D?

• By blocking the sensor, we effectively set Φ = 0.

• Average intensity becomes:

𝐸 𝐼 = 𝑡 ⋅ 𝑎 ⋅ 0 + 𝐷 ⋅ 𝑔 = 𝑡 ⋅ 𝐷 ⋅ 𝑔

• The dark frame needs to be computed separately for each ISO setting, unless we can also calibrate the gain g.

For the rest of these slides, we assume that we have calibrated D and removed it from captured images (by subtracting from them the dark frame).

Page 122: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Noise model after dark frame subtraction

analog-to-digital converter (ADC)

scene radiant flux Φ

analog amplifier (gain g = k ⋅ ISO)

sensor (exposure t, quantum efficiency α)

analog voltage 𝐿,𝐿 ∼ Poisson(𝑡 ⋅ (𝑎 ⋅ Φ))

analog voltage 𝐺 = 𝐿 ⋅ 𝑔 + 𝑛read ⋅ 𝑔,𝑛read ∼ Normal(0, 𝜎read)

discrete signal 𝐼 = 𝐺 + 𝑛ADC,𝑛ADC ∼ Normal(0, 𝜎ADC)

𝐼 = min(𝐿 ⋅ 𝑔 + 𝑛read ⋅ 𝑔 + 𝑛ADC, 𝐼max) 𝐸 𝐼 = 𝑡 ⋅ 𝑎 ⋅ Φ ⋅ 𝑔

𝜎 𝐼 2 = 𝑡 ⋅ 𝑎 ⋅ Φ ⋅ 𝑔2 + 𝜎read2 ⋅ 𝑔2 + 𝜎ADC

2

discrete image intensity (with saturation): intensity mean and variance:

saturation level

Page 123: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

analog-to-digital converter (ADC)

analog amplifier (gain g = k ⋅ ISO)

Affine noise model after dark frame subtraction

scene radiant flux Φ

sensor (exposure t, quantum efficiency α)

analog voltage 𝐿,𝐿 ∼ Poisson(𝑡 ⋅ (𝑎 ⋅ Φ))

discrete signal 𝐼 = 𝐺 + 𝑛add,𝑛add ∼ Normal(0, 𝜎add)

𝐼 = min(𝐿 ⋅ 𝑔 + 𝑛add, 𝐼max) 𝐸 𝐼 = 𝑡 ⋅ 𝑎 ⋅ Φ ⋅ 𝑔

𝜎 𝐼 2 = 𝑡 ⋅ 𝑎 ⋅ Φ ⋅ 𝑔2 + 𝜎add2

discrete image intensity (with saturation): intensity mean and variance:

Page 124: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Estimating the gain and additive noise variance

Can you think of a procedure for estimating these quantities?

Page 125: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Estimating the gain and additive noise variance

1. Capture a large number of images of a grayscale target.

Page 126: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Estimating the gain and additive noise variance

What do you expect the measurements

to look like?

1. Capture a large number of images of a grayscale target.

2. Compute the empirical mean and variance for each pixel, then form a mean-variance plot.

mean

vari

ance

Page 127: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Estimating the gain and additive noise variance

1. Capture a large number of images of a grayscale target.

2. Compute the empirical mean and variance for each pixel, then form a mean-variance plot.

mean

vari

ance

𝐸 𝐼 = 𝑡 ⋅ 𝑎 ⋅ Φ ⋅ 𝑔

𝜎 𝐼 2 = 𝑡 ⋅ 𝑎 ⋅ Φ ⋅ 𝑔2 + 𝜎add2

⇒ 𝜎 𝐼 2= 𝐸 𝐼 ⋅ 𝑔 + 𝜎add2

Page 128: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Estimating the gain and additive noise variance

1. Capture a large number of images of a grayscale target.

2. Compute the empirical mean and variance for each pixel, then form a mean-variance plot.

mean

vari

ance 𝜎 𝐼 2 = 𝐸 𝐼 ⋅ 𝑔 + 𝜎add

2

3. Fit a line and use slope and intercept to estimate the gain and variance.

equal to line slope

equal to line intercept𝜎add

2

𝑔

How would you modify this procedure to separately estimate read and ADC noise?

Page 129: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Estimating the gain and additive noise variance

1. Capture a large number of images of a grayscale target.

2. Compute the empirical mean and variance for each pixel, then form a mean-variance plot.

mean

vari

ance 𝜎 𝐼 2 = 𝐸 𝐼 ⋅ 𝑔 + 𝜎add

2

3. Fit a line and use slope and intercept to estimate the gain and variance.

equal to line slope

equal to line intercept𝜎add

2

𝑔

How would you modify this procedure to separately estimate read and ADC noise?• Perform it for a few different ISO settings (i.e., gains g).

Page 130: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Important note

Noise calibration should be performed with RAW images!

Page 131: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Optimal weights for HDR merging

Page 132: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Merging non-linear exposure stacks

1. Calibrate response curve

2. Linearize images

For each pixel:

3. Find “valid” images

4. Weight valid pixel values appropriately

5. Form a new pixel value as the weighted average of valid pixel values

(noise) 0.05 < pixel < 0.95 (clipping)

(pixel value) / ti

Same steps as in the RAW case.

Note: many possible weighting schemes

Page 133: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Many possible weighting schemes“Confidence” that pixel is noisy/clipped

• What are the optimal weights for merging an exposure stack?

Page 134: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

RAW (linear) image formation model

Exposure time:t5 t4 t3 t2 t1

(Weighted) radiant flux for image pixel (x,y): α ⋅ Φ(x, y)

What weights should we use to merge these images, so that the resulting HDR image is an optimal estimator of the weighted radiant flux?

Different images in the exposure stack will have

different noise characteristics

Page 135: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Simple estimation exampleWe have two noisy unbiased estimators x and y of the same quantity (e.g., a pixel’s intensity).• The two estimators have variance σ[x]2 and σ[y]2.

Page 136: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Simple estimation exampleWe have two noisy unbiased estimators x and y of the same quantity (e.g., a pixel’s intensity).• The two estimators have variance σ[x]2 and σ[y]2.

Assume we form a new estimator from the convex combination of the other two:

z = a ⋅ x + (1 – a) ⋅ y

Page 137: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Simple estimation example

Assume we form a new estimator from the convex combination of the other two:

z = a ⋅ x + (1 – a) ⋅ y

What criterion should we use in selecting the mixing weight a?

We have two noisy unbiased estimators x and y of the same quantity (e.g., a pixel’s intensity).• The two estimators have variance σ[x]2 and σ[y]2.

Page 138: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Simple estimation example

Assume we form a new estimator from the convex combination of the other two:

z = a ⋅ x + (1 – a) ⋅ y

What criterion should we use in selecting the mixing weight a?• We should select a to minimize the variance of estimator z. (Why?)

What is the variance of z as a function of a?

We have two noisy unbiased estimators x and y of the same quantity (e.g., a pixel’s intensity).• The two estimators have variance σ[x]2 and σ[y]2.

Page 139: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Simple estimation exampleAssume we have two noisy estimators x and y of the same quantity (e.g., intensity at a pixel).• The two estimators have variance σ[x]2 and σ[y]2.

Assume we form a new estimator from the convex combination of the other two:

z = a ⋅ x + (1 – a) ⋅ y

What criterion should we use in selecting the mixing weight a?• We should select a to minimize the variance of estimator z.

What is the variance of z as a function of a?

σ[z]2 = a2 ⋅ σ[x]2 + (1 – a)2 ⋅ σ[y]2

What value of a minimizes σ[z]2?

Page 140: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Simple estimation exampleSimple optimization problem:

𝜕σ[z]2

𝜕𝑎= 0

𝜕(𝑎2 ⋅ σ[x]2 + (1 –𝑎)2 ⋅ σ[y]2)

𝜕𝑎= 0

2 ⋅𝑎⋅ σ[x]2 − 2 ⋅ (1 –𝑎) ⋅ σ[y]2 = 0

𝑎 =σ[y]2

σ[x]2 + σ[y]21 − 𝑎 =

σ[x]2

σ[x]2 + σ[y]2and

Page 141: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Simple estimation examplePutting it all together, the optimal linear combination of the two estimators is

𝑧 =σ[x]2σ[y]2

σ[x]2 + σ[y]2⋅

1

σ[x]2𝑥 +

1

σ[y]2𝑦

normalization factor

weights inversely proportional to variance

Page 142: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Simple estimation examplePutting it all together, the optimal linear combination of the two estimators is

𝑧 =σ[x]2σ[y]2

σ[x]2 + σ[y]2⋅

1

σ[x]2𝑥 +

1

σ[y]2𝑦

normalization factor

weights inversely proportional to variance

This is weighting scheme is called Fisher weighting and is a BLUE estimator.

More generally, for more than two estimators,

𝑧 =1

σ𝑖=1𝑁 1

σ[𝑥𝑖]2

𝑖=1

𝑁1

σ[𝑥𝑖]2𝑥𝑖

Page 143: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Video Textures

Arno Schödl

Richard Szeliski

David Salesin

Irfan Essa

Microsoft Research, Georgia Tech

[SIGGRAPH 2000]

Page 144: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Problem statement

video clip video texture

Page 145: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Our approach

How do we find good transitions?

Page 146: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Finding good transitions

Compute L2 distance Di, j between all frames

Similar frames make good transitions

frame ivs.

frame j

Page 147: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Markov chain representation

2 3 41

Similar frames make good transitions

Page 148: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Transition costs

Transition from i to j if successor of i is like j

Cost function: Ci→j = Di+1, j

i

j

i+1

j-1

i j→ Di+1, j

Page 149: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Transition probabilities

Probability for transition Pi→j inversely related

to cost:Pi→j ~ exp ( – Ci→j / s2 )

high s low s

Page 150: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Preserving dynamics

Page 151: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Preserving dynamics

Page 152: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Preserving dynamics

Cost for transition i→j

Ci→j = wk Di+k+1, j+kk = -N

N -1

i

j j+1

i+1 i+2

j-1j-2

i j→Di, j-1 D Di+1, j i+2, j+1

i-1

Di-1, j-2

Page 153: Computational Photography and Image Manipulation CMPT 469 ...yagiz/cpim/2019-CPIM-12-Deconvolution.pdf · Wiener Deconvolution gradient regularization For natural images and white

Finding good loops

• Alternative to random transitions

• Precompute set of loops up front