Download presentation
Presentation is loading. Please wait.
1
CPSC 6040 Computer Graphics Images
Slides prepared by Ioannis Karamouzas With modifications by Donald House
2
Tone Mapping & Bilateral Filtering
Slide Credits: Frédo Durand Josh Levine Ioannis Karamouzas
3
The Dynamic Range Problem
Two Challenges Recording the information Choosing which 6-12 bits of the world to include in your photograph (cell phone to professional SLR, respectively) Metering the world to help you make this decision, since the world has more dynamic range than any light meter Displaying the information Compressing 12 bits into 4 bits for print, or 10 for LCD
4
Challenge 1: Recording the Information
The range of illumination levels is 10 to 12 orders of magnitude Negatives or sensors can record only 2 to 3 orders of magnitude A solution: multiple exposures with different light sensitivities
5
The Radiance Map
6
Problem 2: Displaying the Information
How should we map scene radiances (up to 1:100,000) to display radiances (only around 1:100) to produce a satisfactory image? Goal: match limited contrast of the display medium while preserving details Solution: Tone Mapping
7
Simple Tone Mapping
8
Gamma Compression on Intensity
Colors ok, but details in intensity are blurry
9
Gamma Compression on Intensity
Colors ok, but details in intensity are blurry Solution: Reduce contrast of low frequencies Keep mid and high frequencies Mid-high frequency Low frequency
10
Tone Mapping Using Linear Filtering
Reduce contrast of low-frequencies Keep mid and high frequencies
11
The Halo Nightmare For strong edges
Because they contain high frequencies
12
Tone Mapping Using Bilateral Filter to eliminate the halo effect
13
Durand and Dorsey, 2002 Do not blur across edges Non-linear filtering
14
Framework Overview IN LOG Detail = input log – large scale
15
Bilateral Filtering (slides based on Durand)
16
Start with Gaussian filtering
Input (I) is a step function + noise Output (J) is a convolution of I with a Gaussian kernel f
17
Gaussian filter as weighted average
Weight of ξ depends on the distance to x
18
The problem of edges I(ξ) is too different from I(x)
Pollutes our estimate of J(x)
19
Principle of bilateral filtering
Reject (in a soft way) pixels that differ too much Add a Gaussian g that penalizes intensity differences
20
Bilateral filtering Combines Spatial Gaussian f (domain kernel)
ⅇxp − 𝑥−𝜉 𝜎 2
21
Bilateral filtering Combines Spatial Gaussian f (domain kernel)
ⅇxp − 𝐼(𝑥)−I(𝜉) 𝜎 2 Combines Spatial Gaussian f (domain kernel) Gaussian g on intensity differences (range kernel)
22
Normalization factor
23
Bilateral filtering is non linear
The weights are different for each output pixel
24
See [Tomasi and Manduchi,1998] for more
Putting it all together See [Tomasi and Manduchi,1998] for more
25
Contrast Reduction Input HDR Image Contrast too high!
26
Contrast Reduction Intensity = 0.30R + 0.59G + 0.11B R’ = R/intensity
Input HDR Image Intensity Intensity = 0.30R G B Color R’ = R/intensity G’ = G/intensity B’ = B/intensity important to use ratios (makes color luminance invariant)
27
Contrast Reduction Bilateral filter in log Input HDR Image Intensity
Large Scale Bilateral filter in log Color spatial sigma = 2% - 5% image size range sigma = 0.4 (in log 10)
28
Contrast Reduction Bilateral filter in log Detail =
Input HDR Image Intensity Large Scale Bilateral filter in log Detail Color Detail = log intensity - large scale
29
Contrast Reduction Bilateral filter in log Input HDR Image Intensity
Large Scale Large Scale Bilateral filter in log Detail newLog = a oldLog Color
30
Contrast Reduction Bilateral filter in log Input HDR Image Intensity
Large Scale Large Scale Bilateral filter in log Detail Detail Preserve! Color
31
Contrast Reduction Bilateral filter in log Input HDR Image Output
Intensity Large Scale Large Scale Bilateral filter in log Detail Detail Preserve! Color Color
32
Contrast Reduction in log
inLog = log10Intensity inLogLarge = bilateralFilter(inLog) inLogDetail = inLog – inLogLarge Manipulate large scale and detail separately!
33
Contrast Reduction in log
outLog = k(inLogLarge – max(inLogLarge)) Normalize so that 0 is the biggest value in log Set target large scale contrast - targetRange = log10100, if we want a target contrast of 1:100 Compute range of input layer - largeRange = max(inLogLarge) – min(inLogLarge) Compute scale factor: k = targetRange / largeRange
34
Contrast Reduction in log
outLog = detailAmp*inLogDetail + k(inLogLarge – max(inLogLarge)) Normalize so that 0 is the biggest value in log Set target large-scale contrast - targetRange = log10100, if we want a target contrast of 1:100 Compute range of input layer - largeRange = max(inLogLarge) – min(inLogLarge) Compute scale factor: k = targetRange / largeRange We can boost details by detailAmp
35
Final Output Image outIntensity = 10outLog
R’, G’, B’ are intensity invariant color channels - outR = R’*outIntensity - outG = G’*outIntensity - outB = B’*outIntensity
36
Recap Bilateral filter in log Detail = log intensity - large scale
Input HDR Image Output Intensity Large Scale Large Scale Bilateral filter in log Detail Detail Color Detail = log intensity - large scale Color
37
Results
38
Important notes Spatial sigma not very important
Range sigma: quite important Critical to work in the log domain Because HDR and because perception sensitive to multiplicative contrast Luminance computation (0.30R G B) See [Eisemann 2004] for smarter function
39
Improving Performance
Direct bilateral filtering is slow (minutes) Fast algorithm: bilateral grid - Paris_09_Fast_Approximation.pdf -
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.