• 沒有找到結果。

Tone mapping

N/A
N/A
Protected

Academic year: 2022

Share "Tone mapping"

Copied!
83
0
0

加載中.... (立即查看全文)

全文

(1)

Tone mapping

Digital Visual Effects Yung-Yu Chuang

with slides by Fredo Durand, Lin-Yu Tseng, and Alexei Efros

(2)

Tone mapping

• How should we map scene luminances (up to 1:100,000) to display luminances (only around 1:100) to produce a satisfactory image?

Linear scaling?, thresholding?

10

-6

10

6

10

-6

10

6

Real world radiance

Display intensity

dynamic range

Pixel value 0 to 255

CRT has 300:1 dynamic range

(3)

The ultimate goal is a visual match

We do not need to reproduce the true radiance as long as it gives us a visual match.

visual adaption

(4)

Eye is not a photometer!

• Dynamic range along the visual pathway is only around 32:1.

• The key is adaptation

(5)

Eye is not a photometer!

Are the headlights different in two images? Physically, they are the same, but perceptually different.

(6)

We are more sensitive to contrast

• Weber’s law

% 1

~

b b

I

I

background intensity

Just-noticeable Difference (JND)

flash

(7)

How humans deal with dynamic range

• We're more sensitive to contrast (multiplicative)

– A ratio of 1:2 is perceived as the same contrast as a ratio of 100 to 200

– Makes sense because illumination has a multiplicative effect

– Use the log domain as much as possible

• Dynamic adaptation (very local in retina)

– Pupil (not so important) – Neural

– Chemical

• Different sensitivity to spatial frequencies

(8)

Preliminaries

• For color images

• Log domain is usually preferred.

w w d

w w d

w w d

d d d

L L B

L L G

L L R

B G R

(9)

HDR Display

• Once we have HDR images (either captured or synthesized), how can we display them on

normal displays?

HDR display system, Sunnybrook Technology, SIGGRAPH2004 DLP

800:1

LCD 300:1

diffuser Theoretically, 240,000:1.

Due to imperfect optical depth,

54,000:1 measured

(10)

Sunnybrook HDR display

Slide from the 2005 Siggraph course on HDR

(11)

How it works

Slide from the 2005 Siggraph course on HDR

(12)

Brightside HDR display

37”

200000:1 Acquired by Dolby

(13)

Tone mapping operators

• Spatial (global/local)

• Frequency domain

• Gradient domain

• 3 papers from SIGGRAPH 2002

Photographic Tone Reproduction for Digital Images

Fast Bilateral Filtering for the Display of High- Dynamic-Range Images

Gradient Domain High Dynamic Range Compression

(14)

Photographic Tone Reproduction for Digital Images

Erik Reinhard Mike Stark Peter Shirley Jim Ferwerda

SIGGRAPH 2002

(15)

Global v.s. local

(16)

Photographic tone reproduction

• Proposed by Reinhard et. al. in SIGGRAPH 2002

• Motivated by traditional practice, zone system by Ansel Adams and dodging and burning

• It contains both global and local operators

(17)

Zone system

(18)

The Zone system

• Formalism to talk about exposure, density

• Zone = intensity range, in powers of two

• In the scene, on the negative, on the print

Source: Ansel Adams

(19)

The Zones

(20)

The Zone system

• You decide to put part of the system in a given zone

• Decision: exposure, development, print

(21)

Dodging and burning

• During the print

• Hide part of the print during exposure

– Makes it brighter

From The Master Printing Course, Rudman

(22)

Dodging and burning

From Photography by London et al.

dodging burning

(23)

Dodging and burning

• Must be done for every single print!

Straight print After dodging and burning

(24)

Global operator





y x

w

w L x y

L N

,

)) ,

( 1 log(

exp

) , ( )

,

( L x y

L y a

x

L w

w

m

Approximation of scene’s key (how light or dark it is).

Map to 18% of display range for average-key scene

User-specified; high key or low key

) , ( 1

) , ) (

,

( L x y

y x y L

x L

m m

d  

transfer function to compress high luminances

(25)

Global operator

) , ( 1

) , (

) , 1 (

) , ( )

, (

2

y x L

y x L

y x y L

x L

y x L

m

white m m

d



 

 

It seldom reaches 1 since the input image does not have infinitely large luminance values.

Lwhite is the smallest luminance to be mapped to 1

(26)

low key (0.18) high key (0.5)

(27)

Dodging and burning (local operators)

• Area receiving a different exposure is often bounded by sharp contrast

• Find largest surrounding area without any sharp contrast

) , ( )

, ( )

,

(x y L x y G x y

Lblursms

blur s blur

s blur

s

s a s L

y x L

y x y L

x

V

 2 1

2

) , ( )

, ) (

,

(

 y) (x, : max

max Vs

s

(28)

Dodging and burning (local operators)

• A darker pixel (smaller than the blurred

average of its surrounding area) is divided by a larger number and become darker (dodging)

• A brighter pixel (larger than the blurred

average of its surrounding area) is divided by a smaller number and become brighter (burning)

• Both increase the contrast

) , ( 1

) , ) (

, (

max x y

L

y x y L

x

L blur

s m

d  

(29)

Dodging and burning

(30)

Frequency domain

• First proposed by Oppenheim in 1968!

• Under simplified assumptions,

image = illuminance * reflectance

low-frequency

attenuate more high-frequency attenuate less

(31)

Oppenheim

• Taking the logarithm to form density image

• Perform FFT on the density image

• Apply frequency-dependent attenuation filter

• Perform inverse FFT

• Take exponential to form the final image

kf c kf

c f

s    

) 1 1

( )

(

(32)

Fast Bilateral Filtering for the

Display of High-Dynamic-Range Images

Frédo Durand & Julie Dorsey SIGGRAPH 2002

(33)

A typical photo

• Sun is overexposed

• Foreground is underexposed

(34)

Gamma compression

• X  X

• Colors are washed-out

Input Gamma

(35)

Gamma compression on intensity

• Colors are OK, but details (intensity high- frequency) are blurred

Gamma on intensity Intensity

Color

(36)

Chiu et al. 1993

• Reduce contrast of low-frequencies

• Keep high frequencies

Reduce low frequency Low-freq.

High-freq.

Color

(37)

The halo nightmare

• For strong edges

• Because they contain high frequency

Reduce low frequency Low-freq.

High-freq.

Color

(38)

Durand and Dorsey

• Do not blur across edges

• Non-linear filtering

Output Large-scale

Detail

Color

(39)

Edge-preserving filtering

• Blur, but not across edges

• Anisotropic diffusion [Perona & Malik 90]

– Blurring as heat flow – LCIS [Tumblin & Turk]

• Bilateral filtering [Tomasi & Manduci, 98]

Edge-preserving Gaussian blur

Input

(40)
(41)
(42)
(43)
(44)
(45)
(46)
(47)
(48)
(49)
(50)

Contrast reduction

Input HDR image

Contrast too high!

(51)

Contrast reduction

Color

Input HDR image

Intensity

(52)

Contrast reduction

Color

Intensity Large scale

Fast

Bilateral Filter

Input HDR image

(53)

Contrast reduction

Detail

Color

Intensity Large scale

Fast

Bilateral Filter

Input HDR image

(54)

Contrast reduction

Detail

Color

Intensity Large scale

Fast

Bilateral Filter

Reduce contrast

Large scale

Input HDR image

Scale in log domain

(55)

Contrast reduction

Detail

Color

Intensity Large scale

Fast

Bilateral Filter

Reduce contrast

Detail

Large scale

Preserve!

Input HDR image

(56)

Contrast reduction

Detail

Color

Intensity Large scale

Fast

Bilateral Filter

Reduce contrast

Detail

Large scale

Color

Preserve!

Input HDR image Output

(57)

Bilateral filter is slow!

• Compared to Gaussian filtering, it is much slower because the kernel is not fixed.

• Durand and Dorsey proposed an approximate approach to speed up

• Paris and Durand proposed an even-faster

approach in ECCV 2006. We will cover this one when talking about computational photogrphy.

(58)

Oppenheim bilateral

(59)

Gradient Domain High Dynamic Range Compression

Raanan Fattal Dani Lischinski Michael Werman SIGGRAPH 2002

(60)

Log domain

• Logorithm is a crude approximation to the perceived brightness

• Gradients in log domain correspond to ratios (local contrast) in the luminance domain

(61)

The method in 1D

log derivative

attenuate

integrate exp

(62)

The method in 2D

• Given: a log-luminance image

H(x,y)

• Compute an attenuation map

• Compute an attenuated gradient field

G

:

• Problem:

G

may not be integrable!

H

H

y x

H y

x

G ( , )   ( , )   

(63)

Solution

• Look for image

I

with gradient closest to

G

in the least squares sense.

• I

minimizes the integral:

,

2 2



2

 

 

 

 

 

 

 

x

G

y

y G I

x G I

I G

I F

 

 F I , G dxdy

y G x

G y

I x

I

x y

 

 

 

2 2 2

2 Poisson

equation

(64)

Solve

y G x

G y

I x

I

x y

 

 

 

2 2 2

2

) 1 ,

( )

, ( )

, 1 (

) ,

( x yG xyG x yG x y

G

x x y y

) , ( 4 )

1 ,

( )

1 ,

( )

, 1 (

) , 1

( x y I x y I x y I x y I x y

I        

 

 

 

 

 

 

 

 

 

 

 

 

.. 1 … 1 -4 1 … 1 ..

I

(65)

Solving Poisson equation

• No analytical solution

• Multigrid method

• Conjugate gradient method

(66)

Attenuation

• Any dramatic change in luminance results in large luminance gradient at some scale

• Edges exist in multiple scales. Thus, we have to detect and attenuate them at multiple scales

• Construct a Gaussian pyramid Hi

(67)

Attenuation

gradient magnitude

log(Luminance) attenuation map

) 1

, ) (

, (



 

  

k x y Hkx y

H

 10. 8 . 0

~

(68)

Multiscale gradient attenuation

interpolate

interpolate

X =

X =

(69)

Final gradient attenuation map

(70)

Performance

• Measured on 1.8 GHz Pentium 4:

512 x 384: 1.1 sec – 1024 x 768: 4.5 sec

• Can be accelerated using processor-optimized libraries.

0 4 8 12 16

0 1000000 2000000 3000000

(71)

Bilateral

[Durand et al.]

Photographic [Reinhard et al.]

Gradient domain [Fattal et al.]

Informal comparison

(72)

Informal comparison

Bilateral

[Durand et al.]

Photographic [Reinhard et al.]

Gradient domain [Fattal et al.]

(73)

Bilateral

[Durand et al.]

Photographic [Reinhard et al.]

Gradient domain [Fattal et al.]

Informal comparison

(74)

Evaluation of Tone Mapping

Operators using a High Dynamic Range Display

Patrick Ledda Alan Chalmers Tom Troscinko Helge Seetzen

SIGGRAPH 2005

(75)

Six operators

• H: histogram adjustment

• B: bilateral filter

• P: photographic reproduction

• I: iCAM

• L: logarithm mapping

• A: local eye adaption

(76)

23 scenes

(77)

Experiment setting

HDR display tonemapping

result tonemapping

result

(78)

Preference matrix

• Ranking is easier than rating.

• 15 pairs for each person to compare. A total of 345 pairs per subject.

preference matrix (tmo2->tmo4, tom2 is better than tmo4)

(79)

Statistical measurements

• Statistical measurements are used to evaluate:

– Agreement: whether most agree on the ranking between two tone mapping operators.

– Consistency: no cycle in ranking. If all are confused in ranking some pairs, it means they are hard to

compare. If someone is inconsistent alone, his ranking could be droped.

(80)

Overall similarity

• Scene 8

(81)

Summary

(82)

Not settled yet!

• Some other experiment said bilateral are better than others.

• For your reference, photographic reproduction performs well in both reports.

• There are parameters to tune and the space could be huge.

(83)

References

• Raanan Fattal, Dani Lischinski, Michael Werman, Gradient Domain High Dynamic Range Compression, SIGGRAPH 2002.

• Fredo Durand, Julie Dorsey, Fast Bilateral Filtering for the Display of High Dynamic Range Images, SIGGRAPH 2002.

• Erik Reinhard, Michael Stark, Peter Shirley, Jim

Ferwerda, Photographics Tone Reproduction for Digital Images, SIGGRAPH 2002.

• Patrick Ledda, Alan Chalmers, Tom Troscianko, Helge Seetzen, Evaluation of Tone Mapping Operators using a High Dynamic Range Display, SIGGRAPH 2005.

• Jiangtao Kuang, Hiroshi Yamaguchi, Changmeng Liu, Garrett Johnson, Mark Fairchild, Evaluating HDR

Rendering Algorithms, ACM Transactions on Applied Perception, 2007.

參考文獻

相關文件

RNA in situ hybridization (ISH) for detection of high-risk HPV E6/E7 mRNA was performed in the Translational Research Laboratory within the Peter MacCallum Cancer Centre of

Gallios allows use of the entire dynamic range with simultaneous resolution of dim signals even at the low end of the scale Gallios allows use of the entire dynamic range

for Real - - Time Rendering in Dynamic, Time Rendering in Dynamic, Low Low - - Frequency Lighting Environments Frequency Lighting Environments. Peter-Pike Sloan, Microsoft

• Colors are OK, but details (intensity high- frequency) are blurred.. Gamma on

• Colors are OK, but details (intensity high- frequency) are blurred.. Gamma on

• Fredo Durand, Julie Dorsey, Fast Bilateral Filtering for the Display of High Dynamic Range Images, SIGGRAPH 2002. • Erik Reinhard, Michael Stark, Peter

Input Log(Intensity Log(Intensity) ) Bilateral Smoothing Bilateral Smoothing Gaussian.. Gaussian

• Patrick Ledda, Alan Chalmers, Tom Troscianko, Helge Seetzen, Evaluation of Tone Mapping Operators using a High Dynamic Range Display,