HDR images acquisition dr. Francesco Banterle - - PowerPoint PPT Presentation

hdr images acquisition
SMART_READER_LITE
LIVE PREVIEW

HDR images acquisition dr. Francesco Banterle - - PowerPoint PPT Presentation

HDR images acquisition dr. Francesco Banterle francesco.banterle@isti.cnr.it Current sensors No sensors available to consumer for capturing HDR content in a single shot Some native HDR sensors exist, HDRc by Omron, but some issues:


slide-1
SLIDE 1

HDR images acquisition

  • dr. Francesco Banterle

francesco.banterle@isti.cnr.it

slide-2
SLIDE 2

Current sensors

  • No sensors available to consumer for capturing

HDR content in a single shot

  • Some native HDR sensors exist, HDRc by Omron,

but some issues:

  • too much noise
  • low resolution (around 1024x768)
  • expensive to manufacture
slide-3
SLIDE 3

Exposure bracketing

  • Capturing many LDR images (8-bit) of the same

scene:

  • from the darkest area in the scene
  • to the brightest area in the scene
  • The scene has to be static!!!
slide-4
SLIDE 4

Exposure bracketing

t = 1/8s t = 1/32s t = 1/128s

slide-5
SLIDE 5

Exposure bracketing

  • Required equipment:
  • camera with the possibility to vary the exposure
  • tripod (avoid camera shake)
  • Optional equipment:
  • luminance meter
  • colorchecker chart
  • remote control for the camera
slide-6
SLIDE 6

How many exposures?

  • Brute force approach:
  • Select an exposure for the darkest/brightest area

in the scene and take a shot

  • Double/half exposure and take a shot
  • Repeat until brightest/darkest are in the scene is

captured

slide-7
SLIDE 7

How many exposures?

  • Some issue with this approach:
  • time consuming, especially if the camera is not

programmable

  • we are making micro movements at every click!
  • over-sampling, maybe there is no need
slide-8
SLIDE 8
  • Exposure metering [Gallo et al. 2012]:
  • capturing histograms from the viewfinder (picture

preview in a camera) - free!

  • computing CDF for each histogram
  • obtaining the global CDF
  • differentiation —> HDR histogram

Exposure Metering

F(n) = Pn

i=0 H(i)

PN

i=0 H(i)

slide-9
SLIDE 9

Exposure Metering: LDR Histograms

−6 −5 −4 −3 −2 −1 1 2 3 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 −5 −4 −3 −2 −1 1 2 3 4 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 −4 −3 −2 −1 1 2 3 4 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 −3 −2 −1 1 2 3 4 5 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 −2 −1 1 2 3 4 5 6 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 −8 −7 −6 −5 −4 −3 −2 −1 1 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5 −9 −8 −7 −6 −5 −4 −3 −2 −1 0.05 0.1 0.15 0.2 0.25 0.3 0.35 −10 −9 −8 −7 −6 −5 −4 −3 −2 −1 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 −11 −10 −9 −8 −7 −6 −5 −4 −3 −2 0.005 0.01 0.015 0.02 0.025 0.03 0.035 0.04 −12 −11 −10 −9 −8 −7 −6 −5 −4 −3 0.01 0.02 0.03 0.04 0.05 0.06 −13 −12 −11 −10 −9 −8 −7 −6 −5 −4 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 −13 −12 −11 −10 −9 −8 −7 −6 −5 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09
slide-10
SLIDE 10

Exposure Metering: LDR CDFs

−14 −12 −10 −8 −6 −4 −2 2 4 6 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

log2 Irradiance F

slide-11
SLIDE 11

Exposure Metering

Algorithm 2.1: COMPFULLCDF({Bk},{b ˜

E i, j},FL 1 ,FL 2 ,...,FL J )

for k ← 0 to K −1 do FH(Bk) ← 0 for j ← 0 to J −1 do 8 > < > : for i ← 0 to I −2 do ( for each k : Bk ∈ (b ˜

E i, j,b ˜ E i+1, j]

do FH(Bk) ← max(FH(Bk),FL

j (b ˜ E i, j))

return (FH)

slide-12
SLIDE 12

Exposure Metering: HDR CDF

−14 −12 −10 −8 −6 −4 −2 2 4 6 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

log2 Irradiance F

slide-13
SLIDE 13

Exposure Metering: HDR Histogram

−14 −12 −10 −8 −6 −4 −2 2 4 6 0.005 0.01 0.015 0.02 0.025 0.03

log2 Irradiance P

slide-14
SLIDE 14
  • Selection of exposure times based on:
  • HDR histogram
  • Noise model of the camera

Exposure Metering

slide-15
SLIDE 15

Exposure Metering: sampling

−14 −12 −10 −8 −6 −4 −2 2 4 6 0.005 0.01 0.015 0.02 0.025 0.03

log2 Irradiance P

slide-16
SLIDE 16

Exposure Metering: sampling

−14 −12 −10 −8 −6 −4 −2 2 4 6 0.005 0.01 0.015 0.02 0.025 0.03

log2 Irradiance P

exp

slide-17
SLIDE 17

Exposure Metering: sampling

−14 −12 −10 −8 −6 −4 −2 2 4 6 0.005 0.01 0.015 0.02 0.025 0.03

log2 Irradiance P

exp exp

slide-18
SLIDE 18

Exposure Metering: sampling

−14 −12 −10 −8 −6 −4 −2 2 4 6 0.005 0.01 0.015 0.02 0.025 0.03

log2 Irradiance P

exp exp exp

slide-19
SLIDE 19

Exposure Metering: sampling

−14 −12 −10 −8 −6 −4 −2 2 4 6 0.005 0.01 0.015 0.02 0.025 0.03

log2 Irradiance P

exp exp exp exp

slide-20
SLIDE 20

Exposure Metering: sampling

−14 −12 −10 −8 −6 −4 −2 2 4 6 0.005 0.01 0.015 0.02 0.025 0.03

log2 Irradiance P

exp exp exp exp exp

slide-21
SLIDE 21

Linear Images

  • What is a linear value?

I = a E

  • where:
  • I the value recorded by the sensor
  • E is the radiance of the real value
  • a is a constant
slide-22
SLIDE 22

Linear Images

  • High-end or prosumer camera can save RAW:
  • advantage: storing linear values
  • disadvantage: a lot of memory; no

compression and 12-14bit per color channel

slide-23
SLIDE 23

meanwhile in the real-word…

slide-24
SLIDE 24

Linear Images

  • Consumer cameras, smartphones, tables save

typically JPEG at high quality (in the best case):

  • advantage: images are stored in little memory
  • disadvantage:
  • no linear values
  • images are stored applying an unknown

function, f, called Camera Response Function (CRF)

slide-25
SLIDE 25

Linear Images: example

0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 50 100 150 200 250

Relative camera response Pixel value

identity γ = 2.2

slide-26
SLIDE 26

Linear Images: example

0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 50 100 150 200 250

Relative camera response Pixel value red channel green channel blue channel

slide-27
SLIDE 27

Estimating CRF

  • What can we do?
  • We can estimate the CRF or perform a

radiometric calibration

  • What can we do?
  • Taking a photograph with colorchecker and

controlled environment

  • Taking photographs at different exposure times
slide-28
SLIDE 28

Estimating CRF

slide-29
SLIDE 29

Estimating CRF

smoothing term function to minimize

slide-30
SLIDE 30

Estimating CRF

  • To minimize the objective function, a dense linear

system needs to be solved using SVD:

  • (Nexposures x Nsamples + D + 1) x (Nsamples + D + 1)
  • where D = 256 (discretization levels)
  • We cannot use all pixels in the image:
  • too large system
slide-31
SLIDE 31

Estimating CRF

  • To minimize the objective function, a dense linear

system needs to be solved using SVD

  • We cannot use all pixels in the image:
  • too large system
slide-32
SLIDE 32

Estimating CRF

  • To minimize the objective function, a dense linear

system needs to be solved using SVD

  • We cannot use all pixels in the image:
  • too large system
slide-33
SLIDE 33

Estimating CRF: samples selection

  • Idea1: sampling in spatial domain
slide-34
SLIDE 34

Estimating CRF: samples selection

  • For each spatial sample
  • Collect values at each exposure, , to obtain a

sample vector:

[Z0(i, j), ..., Zn(i, j)]

(i, j) Zi

slide-35
SLIDE 35

Estimating CRF: samples selection

  • Idea2: in histogram domain, to randomly

subsample the image

50 100 150 200 250 0.2 0.4 0.6 0.8 1

Pixel value F

Exposure 1 Exposure 2 Exposure 3

slide-36
SLIDE 36

50 100 150 200 250 0.2 0.4 0.6 0.8 1

Pixel value F

Exposure 1 Exposure 2 Exposure 3

Estimating CRF: samples selection

  • Idea2: sampling in histogram domain
slide-37
SLIDE 37

50 100 150 200 250 0.2 0.4 0.6 0.8 1

Pixel value F

Exposure 1 Exposure 2 Exposure 3

Estimating CRF: samples selection

  • Idea2: sampling in histogram domain
slide-38
SLIDE 38

50 100 150 200 250 0.2 0.4 0.6 0.8 1

Pixel value F

Exposure 1 Exposure 2 Exposure 3

Estimating CRF: samples selection

  • Idea2: sampling in histogram domain
slide-39
SLIDE 39

50 100 150 200 250 0.2 0.4 0.6 0.8 1

Pixel value F

Exposure 1 Exposure 2 Exposure 3

Estimating CRF: samples selection

  • Idea2: sampling in histogram domain
slide-40
SLIDE 40

50 100 150 200 250 0.2 0.4 0.6 0.8 1

Pixel value F

Exposure 1 Exposure 2 Exposure 3

Estimating CRF: samples selection

  • Idea2: sampling in histogram domain
slide-41
SLIDE 41

50 100 150 200 250 0.2 0.4 0.6 0.8 1

Pixel value F

Exposure 1 Exposure 2 Exposure 3

Estimating CRF: samples selection

  • Idea2: sampling in histogram domain
slide-42
SLIDE 42

50 100 150 200 250 0.2 0.4 0.6 0.8 1

Pixel value F

Exposure 1 Exposure 2 Exposure 3

Estimating CRF: samples selection

  • Idea2: sampling in histogram domain
slide-43
SLIDE 43

50 100 150 200 250 0.2 0.4 0.6 0.8 1

Pixel value F

Exposure 1 Exposure 2 Exposure 3

Estimating CRF: samples selection

  • Idea2: sampling in histogram domain
slide-44
SLIDE 44

Estimating CRF: weighting function

  • weighting function:
  • to avoid outliers during the estimate
  • shapes: tent, box with cut-off, Gaussian, etc.
  • outliers:
  • over-exposed pixels
  • under-exposed pixels
slide-45
SLIDE 45

Estimating CRF: samples selection

50 100 150 200 250 0.2 0.4 0.6 0.8 1

Pixel value w(x)

slide-46
SLIDE 46

Estimating CRF: samples selection

50 100 150 200 250 0.2 0.4 0.6 0.8 1

Pixel value w(x)

w(x) = 1 − (2x − 1)12

slide-47
SLIDE 47

Estimating CRF: samples selection

50 100 150 200 250 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

Pixel value w(x)

w(x) = e

−4 (x−0.5)2

2(0.5)2

slide-48
SLIDE 48

Estimating CRF: samples selection

  • Other methods?
  • To fit a N-dimensional polynomial
  • How to chose N? Brute force: trying different fits,

from N=1 to N=10 and chose the one with the smallest error f(x) =

N

X

i=0

cixi

slide-49
SLIDE 49

Estimating CRF: colorchecker based

slide-50
SLIDE 50

Estimating CRF: colorchecker based

slide-51
SLIDE 51

Estimating CRF: colorchecker based

slide-52
SLIDE 52

Estimating CRF: colorchecker based

20 40 60 80 100 120 140 160 180 200 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1

Pixel value Relative response

slide-53
SLIDE 53

Estimating CRF: colorchecker based

  • This method is computationally cheap, and it offers

a ground truth but:

  • Color checker
  • Luminance meter or photometer
  • Better to have controlled lighting
  • Few points… interpolation
slide-54
SLIDE 54

Where are we?

  • We know how to capture enough images
  • We know how to compute the CRF
  • We need to build the HDR image from the LDR
  • nes
slide-55
SLIDE 55

HDR merge

E(x) = Pn

i=1 1 ti w(Zi(x))f −1(Zi(x))

Pn

i=1 w(Zi(x))

slide-56
SLIDE 56

HDR merge: noise reduction

E(x) = Pn

i=1 w(Zi(x))t2 i f −1(Zi(x)) ti

Pn

i=1 w(Zi(x))t2 i

Note: this gives more weight to long-exposure images (less noise) than short-exposure images (more noise)

slide-57
SLIDE 57

Exposure time

  • Exposure time how is it computed?
  • Typically using shutter speed, but we need to take

into account of:

  • ISO
  • Aperture
slide-58
SLIDE 58

Exposure time

  • Keeping shutter and ISO constant, and varying the

aperture the image gets brighter or darker:

F/8 F/5.6 F/4

slide-59
SLIDE 59

Exposure time

  • Keeping shutter speed and aperture constant, and

varying the ISO the image gets brighter or darker:

ISO 200 ISO 400 ISO 800

slide-60
SLIDE 60

Exposure time

  • I is the ISO value
  • A is the aperture value
  • t_i is the shutter speed (time)
  • K is a camera manufacturer constant in [10.6, 13.4]

te

i =

Iti KA2

slide-61
SLIDE 61

Example

t = 1/8s t = 1/32s t = 1/128s

slide-62
SLIDE 62

Example

t = 1/8s t = 1/32s t = 1/128s

slide-63
SLIDE 63

Example

t = 1/8s t = 1/32s t = 1/128s

Lux

1.623 8.32 42.65 218.6 1121

slide-64
SLIDE 64

HDR Formats

  • Once, an HDR image is merged, it has to be stored
  • 8-bit unsigned char encoding per color channels is

not enough —> limited range [0,255]

  • The range of values for natural scenes can be very

large —> [10-7 109] cd/m2

slide-65
SLIDE 65

HDR Formats: floating point

  • Typically, HDR pixels are stored using 32-bit

floating point numbers per color channel:

  • This means four times the amount of memory for an

uncompressed LDR pixel!

  • Moreover, IEEE 754 encoding is a bit wasted, more

values that what is needed

32-bit 32-bit 32-bit

slide-66
SLIDE 66

HDR Formats: RGBE

  • Idea: red, green, and blue color channel for a given

error may have a very similar exponent, only mantissa is changing!

  • A standard integrated in some OS, e.g. OS X
  • It can not encode negative values
slide-67
SLIDE 67

HDR Formats: RGBE

Em = ⇠ log2 max(R, G, B) + 128 ⇡ Rm = 256R 2Em−128 ⌫ Gm = 256G 2Em−128 ⌫ Bm = 256B 2Em−128 ⌫

Rm Gm Bm Em

32-bit 8-bit 8-bit 8-bit 8-bit

slide-68
SLIDE 68

HDR Formats: LogLuv

  • Idea: convert RGB colors in the LogLuv color

space; colors require less precision than intensity values

  • Advantage: intensity and color values are

separated good for post-processing

  • Two versions: 24-bit and 32-bit
slide-69
SLIDE 69

HDR Formats: LogLuv

x y

  • =

X X+Y +Z Y X+Y +Z

  • u0

v0

  • =

4x 2x+12y+3 4x 2x+12y+3

 X Y Z   = MRGB→XY Z   R G B  

slide-70
SLIDE 70

HDR Formats: LogLuv 32-bit

Le = ⌅ (256 log2 Y + 64) ⇧ ue = ⌅ 410u0⇧ ve = ⌅ 410v0⇧

Le ue ve

32-bit

15-bit 8-bit 8-bit

±

1-bit

slide-71
SLIDE 71

HDR Formats: LogLuv 24-bit

Le ue ve ±

Le = ⌅ (64 log2 Y + 12) ⇧ ue = ⌅ 410u0⇧ ve = ⌅ 410v0⇧

10-bit 7-bit 7-bit 1-bit 24-bit

slide-72
SLIDE 72

HDR Formats: OpenEXR

  • Standard de facto for HDR “digital negative” values
  • Proposed by ILM in 2002 as a digital negative for

movies and CGI productions

  • Half format (16-bit) for each color channel:
  • Dynamic range: [0.000061 , 65504]
  • OpenSource on github:
  • https://github.com/openexr/openexr
slide-73
SLIDE 73

HDR Formats: OpenEXR

H = 8 > > > > > > > < > > > > > > > : if

  • M = 0 ∧ E = 0
  • ,

(−1)S2E−15 +

M 1024

if E = 0, (−1)S2E−15 ✓ 1 +

M 1024

◆ if 1 ≤ E ≤ 30, (−1)S∞ if

  • E = 31 ∧ M = 0
  • ,

NaN if

  • E = 31 ∧ M > 0
  • ,

Exp ± 1-bit 10-bit Mantissa 5-bit 16-bit

slide-74
SLIDE 74

HDR Formats: comparisons

Encoding Color Space Bpp Dynamic Range (log10) Relative Error (%) IEEE RGB full RGB 96 79 0.000003 RGBE positive RGB 32 76 1.0 LogLuv24 logY + (u,v) 24 4.8 1.1 LogLuv32 logY + (u,v) 32 38 0.3 Half RGB RGB 48 10.7 0.1

slide-75
SLIDE 75

Questions?