noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- which...

93
Noise 15-463, 15-663, 15-862 Computational Photography Fall 2019, Lecture 6 http://graphics.cs.cmu.edu/courses/15-463

Upload: others

Post on 11-Jun-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

Noise

15-463, 15-663, 15-862Computational Photography

Fall 2019, Lecture 6http://graphics.cs.cmu.edu/courses/15-463

Page 2: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

Course announcementsโ€ข Homework 2 is out.

- Due September 27th. - Requires camera and tripod.- Start early! Substantially larger programming and imaging components than in Homework 1.- Generous bonus component, up to 50% extra credit.- No really: start early!

โ€ข Any issues with Homework 1?- How did you find homework 1 in general? - Any issues with Matlab?- Any issues using the cameras?- Which part of homework 1 did you enjoy the most?- How many of you did the room-sized camera obscura bonus?

โ€ข New policy regarding deadlines and submission times: deadlines will be strictly enforced.- Policy applies starting with Homework 2.- Miss deadline by one second, and it will cost you a late day. No excuses (e.g., server lagged, laptop crashed).- This is how things work in real academic deadlines (e.g., conference deadlines).- Many homeworks require submitting large files, so be mindful of that.- Do not leave uploading your Homework 2 solution for the last minute!

Page 3: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

Overview of todayโ€™s lecture

โ€ข Leftover from lecture 5: other aspects of HDR imaging.

โ€ข Leftover from lecture 5: tonemapping.

โ€ข Leftover from lecture 5: Some notes about HDR imaging and tonemapping.

โ€ข A few motivating examples.

โ€ข Sensor noise.

โ€ข Noise calibration.

โ€ข Optimal weights for HDR.

Page 4: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

Slide credits

Many of these slides were inspired or adapted from:

โ€ข James Hays (Georgia Tech).โ€ข Fredo Durand (MIT).โ€ข Gordon Wetzstein (Stanford).โ€ข Marc Levoy (Stanford, Google).โ€ข Sylvain Paris (Adobe).โ€ข Sam Hasinoff (Google).

Page 5: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

A few motivating questions from things weโ€™ve seen

Page 6: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

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

Page 7: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

Tonemapping for a single image

Careful not to โ€œtonemapโ€ noise.โ€ข Why is this not a problem

with multi-exposure HDR?

Modern DSLR sensors capture about 3 stops of dynamic range.โ€ข Tonemap single RAW file instead of using cameraโ€™s default rendering.

Page 8: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

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 9: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

Many possible weighting schemesโ€œConfidenceโ€ that pixel is noisy/clipped

โ€ข What are the optimal weights for merging an exposure stack?

Page 10: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

Sensor noise

Page 11: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

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 12: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

Noise in images

Results in โ€œgrainyโ€ appearance.

Page 13: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

The (in-camera) image processing pipeline

Which part introduces noise?

analog front-end

RAW image (mosaiced,

linear, 12-bit)white

balanceCFA

demosaicingdenoising

color transforms

tone reproduction

compressionfinal RGB

image (non-linear, 8-bit)

Page 14: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

The (in-camera) image processing pipeline

Which part introduces noise?โ€ข 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 15: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

The noisy image formation process

What are the various parts?

Page 16: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

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 17: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

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 18: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

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 19: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

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 20: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

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 21: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

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 22: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

Poisson distributionIs it a continuous or discrete probability distribution?

Page 23: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

Poisson distributionIs it a continuous or discrete probability distribution?

โ€ข It is discrete.

How many parameters does it depend on?

Page 24: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

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 25: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

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 26: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

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 27: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

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 28: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

Fundamental question

Why are photon noise and dark noise Poisson random variables?

Page 29: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

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 30: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

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 31: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

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 32: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

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 33: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

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 34: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

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 35: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

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 36: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

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 37: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

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 38: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

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 39: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

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 40: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

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 41: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

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 42: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

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 43: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

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 44: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

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 45: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

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 46: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

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 47: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

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 48: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

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 49: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

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 50: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

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

Page 51: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

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 52: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

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 53: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

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 54: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

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 55: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

Noise calibration

Page 56: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

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 57: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

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

Page 58: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

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 59: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

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 60: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

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 61: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

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 62: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

Estimating the gain and additive noise variance

Can you think of a procedure for estimating these quantities?

Page 63: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

Estimating the gain and additive noise variance

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

Page 64: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

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 65: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

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 66: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

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 67: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

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 68: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

Important note

Noise calibration should be performed with RAW images!

Page 69: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

Optimal weights for HDR merging

Page 70: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

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 71: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

Many possible weighting schemesโ€œConfidenceโ€ that pixel is noisy/clipped

โ€ข What are the optimal weights for merging an exposure stack?

Page 72: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

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 73: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

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 74: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

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 75: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

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 76: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

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 77: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

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 78: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

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 79: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

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 80: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

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 81: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

Back to HDRGiven unclipped and dark-frame-corrected intensity measurements Ii[x, y] at pixel [x, y] and exposures ti, we can merge them optimally into a single HDR intensity I[x, y] as

๐ผ[๐‘ฅ, ๐‘ฆ] =1

ฯƒ๐‘–=1๐‘ ๐‘ค๐‘– [๐‘ฅ, ๐‘ฆ]

โ‹…

๐‘–=1

๐‘

๐‘ค๐‘– ๐‘ฅ, ๐‘ฆ1

๐‘กi

๐ผ๐‘–[๐‘ฅ, ๐‘ฆ]

The per-pixel weights ๐‘ค๐‘– ๐‘ฅ, ๐‘ฆ should be selected to be inversely proportional to that pixelโ€™s variance at each image in the exposure stack.โ€ข How do we compute this variance?

Page 82: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

Back to HDR

๐ผ[๐‘ฅ, ๐‘ฆ] =1

ฯƒ๐‘–=1๐‘ ๐‘ค๐‘– [๐‘ฅ, ๐‘ฆ]

โ‹…

๐‘–=1

๐‘

๐‘ค๐‘– ๐‘ฅ, ๐‘ฆ1

๐‘กi

๐ผ๐‘–[๐‘ฅ, ๐‘ฆ]

The per-pixel weights ๐‘ค๐‘– ๐‘ฅ, ๐‘ฆ should be selected to be inversely proportional to that pixelโ€™s variance at each image in the exposure stack.โ€ข How do we compute this variance? โ†’ Use affine noise model.

Given unclipped and dark-frame-corrected intensity measurements Ii[x, y] at pixel [x, y] and exposures ti, we can merge them optimally into a single HDR intensity I[x, y] as

ฯƒ[1

๐‘กi

๐ผ๐‘–[๐‘ฅ, ๐‘ฆ]]2 = ?

Page 83: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

Back to HDR

๐ผ[๐‘ฅ, ๐‘ฆ] =1

ฯƒ๐‘–=1๐‘ ๐‘ค๐‘– [๐‘ฅ, ๐‘ฆ]

โ‹…

๐‘–=1

๐‘

๐‘ค๐‘– ๐‘ฅ, ๐‘ฆ1

๐‘กi

๐ผ๐‘–[๐‘ฅ, ๐‘ฆ]

The per-pixel weights ๐‘ค๐‘– ๐‘ฅ, ๐‘ฆ should be selected to be inversely proportional to that pixelโ€™s variance at each image in the exposure stack.โ€ข How do we compute this variance? โ†’ Use affine noise model.

ฯƒ[1

๐‘กi

๐ผ๐‘–[๐‘ฅ, ๐‘ฆ]]2 =1

๐‘กi2 ฯƒ[๐ผ๐‘–[๐‘ฅ, ๐‘ฆ]]2

โ‡’ ฯƒ[1

๐‘กi

๐ผ๐‘–[๐‘ฅ, ๐‘ฆ]]2 = ?

Given unclipped and dark-frame-corrected intensity measurements Ii[x, y] at pixel [x, y] and exposures ti, we can merge them optimally into a single HDR intensity I[x, y] as

Page 84: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

Back to HDR

๐ผ[๐‘ฅ, ๐‘ฆ] =1

ฯƒ๐‘–=1๐‘ ๐‘ค๐‘– [๐‘ฅ, ๐‘ฆ]

โ‹…

๐‘–=1

๐‘

๐‘ค๐‘– ๐‘ฅ, ๐‘ฆ1

๐‘กi

๐ผ๐‘–[๐‘ฅ, ๐‘ฆ]

The per-pixel weights ๐‘ค๐‘– ๐‘ฅ, ๐‘ฆ should be selected to be inversely proportional to that pixelโ€™s variance at each image in the exposure stack.โ€ข How do we compute this variance? โ†’ Use affine noise model.

ฯƒ[1

๐‘กi

๐ผ๐‘–[๐‘ฅ, ๐‘ฆ]]2 =1

๐‘กi2 ฯƒ[๐ผ๐‘–[๐‘ฅ, ๐‘ฆ]]2

โ‡’ ฯƒ[1

๐‘กi

๐ผ๐‘–[๐‘ฅ, ๐‘ฆ]]2 =1

๐‘กi2 ๐‘กi โ‹… ๐›ผ โ‹… ฮฆ[๐‘ฅ, ๐‘ฆ] โ‹… ๐‘”2+ ฯƒadd

2

Computing the optimal weights requires:1. calibrated noise characteristics.2. knowing the radiant flux ๐›ผ โ‹… ฮฆ[๐‘ฅ, ๐‘ฆ].

Given unclipped and dark-frame-corrected intensity measurements Ii[x, y] at pixel [x, y] and exposures ti, we can merge them optimally into a single HDR intensity I[x, y] as

This is what we wanted to estimate!

Page 85: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

Simplification: only photon noise

If we assume that our measurements are dominated by photon noise, the variance becomes:

ฯƒ[1

๐‘กi

๐ผ๐‘–[๐‘ฅ, ๐‘ฆ]]2 =1

๐‘กi2 ๐‘กi โ‹… ๐›ผ โ‹… ฮฆ[๐‘ฅ, ๐‘ฆ] โ‹… ๐‘”2+ ฯƒadd

2 โ‰ƒ?

Page 86: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

Simplification: only photon noise

If we assume that our measurements are dominated by photon noise, the variance becomes:

๐ผ[๐‘ฅ, ๐‘ฆ] =1

ฯƒ๐‘–=1๐‘ ๐‘ก๐‘–

โ‹…

๐‘–=1

๐‘

๐ผ๐‘–[๐‘ฅ, ๐‘ฆ]

By replacing in the HDR merging formula and assuming only valid pixels, the HDR estimate simplifies to:

Notice that we no longer weight each image in the exposure stack by its exposure time!

ฯƒ[1

๐‘กi

๐ผ๐‘–[๐‘ฅ, ๐‘ฆ]]2 =1

๐‘กi2 ๐‘กi โ‹… ๐›ผ โ‹… ฮฆ[๐‘ฅ, ๐‘ฆ] โ‹… ๐‘”2+ ฯƒadd

2 โ‰ƒ1

๐‘กi

๐›ผ โ‹… ฮฆ[๐‘ฅ, ๐‘ฆ] โ‹… ๐‘”2

Page 87: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

Some comparisons

original weights optimal weights assuming only photon noise

Page 88: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

More general case

Where does this approximation come from?

If we cannot assume that our measurements are dominated by photon noise, we can approximate the variance as:

ฯƒ[1

๐‘กi

๐ผ๐‘–[๐‘ฅ, ๐‘ฆ]]2 =1

๐‘กi2 ๐‘กi โ‹… ๐›ผ โ‹… ฮฆ[๐‘ฅ, ๐‘ฆ] โ‹… ๐‘”2+ ฯƒadd

2 โ‰ƒ1

๐‘กi2 ๐ผ๐‘–[๐‘ฅ, ๐‘ฆ] โ‹… ๐‘” + ฯƒadd

2

Page 89: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

More general case

Where does this approximation come from?โ€ข We use the fact that each pixel intensity is an unbiased estimate of the radiant flux,

weighted by exposure and gain:

E[๐ผ๐‘–[๐‘ฅ, ๐‘ฆ]] = ๐‘กi โ‹… ๐›ผ โ‹… ฮฆ[๐‘ฅ, ๐‘ฆ] โ‹… g

If we cannot assume that our measurements are dominated by photon noise, we can approximate the variance as:

ฯƒ[1

๐‘กi

๐ผ๐‘–[๐‘ฅ, ๐‘ฆ]]2 =1

๐‘กi2 ๐‘กi โ‹… ๐›ผ โ‹… ฮฆ[๐‘ฅ, ๐‘ฆ] โ‹… ๐‘”2+ ฯƒadd

2 โ‰ƒ1

๐‘กi2 ๐ผ๐‘–[๐‘ฅ, ๐‘ฆ] โ‹… ๐‘” + ฯƒadd

2

Page 90: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

2.8 dB 14.6 dB

standard weights optimal weights

ton

e-m

app

ed m

erge

d H

DR

ground-truth

Some comparisons

Page 91: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

What about ISO?

โ€ข We need to separately account for read and ADC noise, as read noise is gain-dependent.

โ€ข We can optimize our exposure bracket by varying both shutter speed and ISO

Bonus part of Homework 2 (+ 50%!)

Page 92: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

Real capture results

5.9 dB

16.2 dB

โ€œgro

un

d t

ruth

โ€st

and

ard

exp

osu

re

bra

cket

ing

SNR

-op

tim

al

seq

uen

ce

โ€ฆโ€ฆ+15 more

input tone-mapped merged HDR bright region dark region

ISO

64

00

I

SO 6

40

0

IS

O 8

00

1/1

25

s

1

/16

00

s

1/6

40

0 s

ISO

10

0

IS

O 1

00

ISO

10

01

/20

0 s

1/4

00

s

1

/80

0 s

92

Page 93: Noise - graphics.cs.cmu.edugraphics.cs.cmu.edu/courses/15-463/2019_fall/lectures/lecture6.pdf- Which part of homework 1 did you enjoy the most? - How many of you did the room-sized

ReferencesBasic reading:โ€ข Szeliski textbook, Sections 10.1, 10.2. โ€ข Hasinoff et al., โ€œNoise-Optimal Capture for High Dynamic Range Photography,โ€ CVPR 2010.

A paper on weighting different exposures based on a very detailed sensor noise model, additionally discussing combining shutter speed and ISO changes.

โ€ข Healey and Kondepudy, โ€œRadiometric CCD camera calibration and noise estimation,โ€ PAMI 1994.A detailed paper on radiometric and noise calibration based on the noise model we discussed.

โ€ข Martinec, โ€œNoise, Dynamic Range and Bit Depth in Digital SLRs,โ€ 2008, http://theory.uchicago.edu/~ejm/pix/20d/tests/noise/index.htmlA very detailed discussion of noise characteristics and other performance aspects of digital sensors.

Additional reading:โ€ข Kirk and Andersen, โ€œNoise characterization of weighting schemes for combination of multiple exposures,โ€ BMVC 2006.

A great paper on the variance characteristics of most common HDR weighting schemes.โ€ข Granados et al., โ€œOptimal HDR Reconstruction with Linear Digital Cameras,โ€ CVPR 2010.

This paper extends the analysis of optimal HDR weights to consider spatially-varying noise effects.โ€ข Hasinoff, โ€œFundamentals of Computational Photography: Sensors and Noise,โ€ ICCP 2010 tutorial,

https://people.csail.mit.edu/hasinoff/hdrnoise/hasinoff-sensornoise-tutorial-iccp10.pptxA detailed tutorial on sensors and noise.

โ€ข Hasinoff et al., โ€œTime-constrained photography,โ€ ICCV 2009.โ€ข Hasinoff and Kutulakos, โ€œLight-efficient photography,โ€ PAMI 2011.

These two papers examine noise-optimal acquisition and merging schemes for focal and aperture stacks, rather than exposure stacks.โ€ข Ratner et al., โ€œOptimal multiplexed sensing: bounds, conditions and a graph theory link,โ€ Optics Express 2007.โ€ข Ratner and Schechner, โ€œIllumination Multiplexing within Fundamental Limits,โ€ CVPR 2007.

These two papers discuss the effect of different types of noise when fusing multiple images in the context of illumination multiplexing.โ€ข Gupta et al., โ€œPhoton-Flooded Single-Photon 3D Cameras,โ€ CVPR 2019.

A paper on the noise characteristics of single-photon-sensitive cameras.