HDR - High Dynamic Range Graphicspepca/lectures/pdf/pg1-07-hdr-en.pdf · Applications for HDR...

Preview:

Citation preview

HDR 2013 © Josef Pelikán, http://cgg.mff.cuni.cz/~pepca 1 / 16

HDR Images(High Dynamic Range)

© 1995-2016 Josef Pelikán & Alexander Wilkie

CGG MFF UK Praha

pepca@cgg.mff.cuni.cz

http://cgg.mff.cuni.cz/~pepca/

HDR 2013 © Josef Pelikán, http://cgg.mff.cuni.cz/~pepca 2 / 16

Dynamic Range of Images

bright part(short exposure)

dark part(long exposure)

HDR 2013 © Josef Pelikán, http://cgg.mff.cuni.cz/~pepca 3 / 16

Dynamic Range of Images

bright area (short exposure)

dark area (long exposure)

10-6 10-3 1 103 106

reality

10-6 10-3 1 103 106

image(0 .. 255)

HDR 2013 © Josef Pelikán, http://cgg.mff.cuni.cz/~pepca 4 / 16

HDR Graphics

High Dynamic Range– As opposed to Low Dynamic Range – standard images– Pixels – floating point numbers– e.g. float[3] for RGB (96bpp)

Capture of HDR data– Synthetic / via computation (rendering)– Photographic (multi-exposure, specialised cameras)

Display on LDR output devices– Transfer to reduced range („tone-mapping“)

HDR 2013 © Josef Pelikán, http://cgg.mff.cuni.cz/~pepca 5 / 16

RGBE Pixel Format (Radiance)

Format of .hdr files (Radiance)– Reduced size (only 4 bytes per pixel)– Individual mantissa [RGB], shared exponent [E]

Mantissa [RGB]– Type float, normalised to between ½ a 1

Exponent [E]– Binary exponent in two's complement (8 bit number)

Example: [ 0.3, 0.02, 0.1 ] = [ 0.6, 0.04, 0.2 ] · 2-1 → [ 153, 10, 51, 127 ]

HDR 2013 © Josef Pelikán, http://cgg.mff.cuni.cz/~pepca 6 / 16

Other HDR Formats

OpenEXR (.exr)– Industrial Light & Magic (G. Lucas 1975, Star Wars etc.)– Completely open, libraries are open source– Several compression algorithms (ZIP, wavelets), type half– User-extensible pixel format

Portable Float Map (PFM)– Analogous to PPM / PGM / PBM– Three float per pixel– No compression

HDR 2013 © Josef Pelikán, http://cgg.mff.cuni.cz/~pepca 7 / 16

Multiple exposure– Static scene– Constant aperture, varying exposure time– Sequence e.g. from 1/1000s to 2s– Built-in „bracketing“ (–2 EV, 0, +2 EV)– „Super-bracketing“ (e.g. 7 photos in rapid succession)

Processing a sequence of images to HDR– Conventional photo applications (PhotoShop, GiMP..)– HDR Shop (http://www.hdrshop.com/)– Functions: auto-calibration, registration

HDR Photography

HDR 2013 © Josef Pelikán, http://cgg.mff.cuni.cz/~pepca 8 / 16

kvalitativně známá funkce– konkrétní konstanty je třeba nastavit (kalibrace)– „auto-kalibrace“ při skládání (předpoklad stejné předlohy)

Křivka citlivosti senzoru (CCD)

0

255

hodnotapixelu log

10 Exp = log

10 ( Radiance·Dt )

HDR 2013 © Josef Pelikán, http://cgg.mff.cuni.cz/~pepca 9 / 16

HDR Acquisition Example

15 exposures between 1/2000s and 8s (1 EV steps)Assembly: HDR shop

HDR 2013 © Josef Pelikán, http://cgg.mff.cuni.cz/~pepca 10 / 16

Reproducing HDR Images

Simple trimming of image range– Overflow → flare (white or „glare“ effects)

„tone mapping“– Standard: transformation of entire HDR range to LDR– Global vs. local techniques– Local contrast preservation etc.

HDR 2013 © Josef Pelikán, http://cgg.mff.cuni.cz/~pepca 11 / 16

„Tone Mapping“

Transformation of HDR to LDR– Goal: maintaining of contrast & details in dark & light areas

global vs. local conversion

10-6 10-3 1 103 106

HDR

10-6 10-3 1 103 106

LDR(0 .. 255)

HDR 2013 © Josef Pelikán, http://cgg.mff.cuni.cz/~pepca 12 / 16

Logarithmic curves, sigmoids, ..– Implemented as LUT and/or GPU shader

Global Operators

0

255

pixelvalue L

d

2 4 6 8 10

Ld=log(Lw+ 1)

log (Lw ,max+ 1)

HDR input Lw

HDR 2013 © Josef Pelikán, http://cgg.mff.cuni.cz/~pepca 13 / 16

Sigmoid

0

255

pixelvalue L

d

2 4 6 8 10

Ld=Lw

Lw+ 1

HDR input Lw

HDR 2013 © Josef Pelikán, http://cgg.mff.cuni.cz/~pepca 14 / 16

Gamma Compression

Existing mechanism– Disadvantage: discoloration

Gamma compression of intensity– Colour information is retained– Intensity is compressed as above

Ld=Lwγ

HDR 2013 © Josef Pelikán, http://cgg.mff.cuni.cz/~pepca 15 / 16

Local Operators

Goal: locally retain contrast– Edge detection– Local analysis of brightness

Bilateral filtering (1998+)– Non-linear filtering

according tointensitydifference

HDRLDR

filter

HDR 2013 © Josef Pelikán, http://cgg.mff.cuni.cz/~pepca 16 / 16

Applications for HDR

Photography– Improved reproduction of natural scenes– Powerful „tone mapping“, natural looking results– HDR panoramas (sun in the frame, sky vs. landscape)

CGI (computer generated images)– Standard use for „environment mapping“ (light maps

of the surround)– All internal results and calculations are „HDR“– Realistic looking glossy reflections, motion blur, etc.

HDR 2013 © Josef Pelikán, http://cgg.mff.cuni.cz/~pepca 17 / 16

Examples – „tone mapping“

LDR Tone-mapped HDR

HDR 2013 © Josef Pelikán, http://cgg.mff.cuni.cz/~pepca 18 / 16

Examples – „tone mapping“

HDR 2013 © Josef Pelikán, http://cgg.mff.cuni.cz/~pepca 19 / 16

Examples – „tone mapping“

HDR 2013 © Josef Pelikán, http://cgg.mff.cuni.cz/~pepca 20 / 16

Examples - „tone mapping“

HDR 2013 © Josef Pelikán, http://cgg.mff.cuni.cz/~pepca 21 / 16

Example

Environment-map (latitude/longitude mapping)

HDR 2013 © Josef Pelikán, http://cgg.mff.cuni.cz/~pepca 22 / 16

Light Reflection Example

HDR 2013 © Josef Pelikán, http://cgg.mff.cuni.cz/~pepca 23 / 16

Environment („cube-map“)

HDR 2013 © Josef Pelikán, http://cgg.mff.cuni.cz/~pepca 24 / 16

End

Further information:

http://www.debevec.org/

http://cgg.mff.cuni.cz/~pepca/hdr/

http://www.hdrshop.com/

http://www.mpi-inf.mpg.de/resources/hdr/