EUROGRAPHICS2003/P.Brunet and D.Fellner
(Guest Editors)
Volume22(2003),Number3
Adaptive Logarithmic Mapping For Displaying High
Contrast Scenes
F.Drago,1K.Myszkowski,2T.Annen2and N.Chiba1
1Iwate University,Morioka,Japan.2MPI Informatik,Saarbrücken,Germany.
Abstract
We propose a fast,high quality tone mapping technique to display high contrast images on devices with limited dy-
namic range of luminance values.The method is based on logarithmic compression of luminance values,imitating
the human response to light.A bias power function is introduced to adaptively vary logarithmic bases,resulting
in good preservation of details and contrast.To improve contrast in dark areas,changes to the gamma correction
procedure are proposed.Our adaptive logarithmic mapping technique is capable of producing perceptually tuned
images with high dynamic content and works at interactive speed.We demonstrate a successful application of our
tone mapping technique with a high dynamic range video player enabling to adjust optimal viewing conditions for
any kind of display while taking into account user preference concerning brightness,contrast compression,and
detail reproduction.
Categories and Subject Descriptors(according to ACM CCS):I.3.3[Image Processing and Computer Vision]:Image
Representation
1.Introduction
Mainstream imaging and rendering software are now ad-dressing the need to represent physically accurate lighting information in the form of high dynamic range(HDR)tex-tures,environment maps,lightfields,and images in order to capture accurate scene appearance.Clearly,proper capture of luminance(radiance)and chroma for any environment re-quires better precision than offered by a24-bit RGB repre-sentation.This fact has been early recognized by the light-ing simulation8and physically based rendering16,20commu-nities.As a result of lighting computation,luminance val-ues in the scene are reconstructed and rendered images are saved usingfile formats capable of representing the com-plete visible spectrum19,6,5.The same formats are used for high dynamic range imaging2,where photographs of a static scene taken at different exposures are assembled and saved in a radiance map(Figure1).Initially,HDR images have been used by Debevec3as a lighting tool to render CG ob-jects illuminated in a real world setting.However,this for-mat was soon adopted
by photographers,who werefinally able to cope with high contrast scenes.Modern digital cam-eras are moving toward greater contrast representation.
Al-Figure1:Dynamic range=394,609:1.HDR image built from three stitched photographs taken atfive different expo-sures.
ready consumer oriented cameras offer12-bits or more data per channel and recent innovative chip design permits to achieve much ,the Super CCD SR developed by Fuji,which incorporates both large,high-sensitivity S-pixels and smaller R-pixels for expanded dynamic range.Modern graphics acceleration cards also start to offer a HDR data representation usingfloating point precision throughout their rendering pipelines.We can envision that in a near future,the complete imaging pipeline will be based on physically accu-rate data.
©The Eurographics Association and Blackwell Publishers2003.Published by Blackwell Publishers,108Cowley Road,Oxford OX41JF,UK and350Main Street,Malden,MA 02148,USA.
Unfortunately,displaying methods have not progressed in a similar pace.Except for a few specialized devices,CRT andflat panel displays are still limited to a very small dy-namic range,often less than100:1,while the dynamic range of scenes represented by HDR images can span overfive or more orders of magnitude.
Tone mapping is introduced in the graphic pipeline as the last step before image display to address the problem of incompatible luminance ranges.The question answered by most of the tone mapping algorithms developed for com-puter graphics applications is:“Within the physical limita-tions of displaying hardware,how to present images percep-tually similar to the original scenes to human viewers?”Es-sentially,tone mapping should provide drastic contrast re-duction from scene values to displayable ranges while pre-serving the image details essential to appreciate the scene content.
The tone mapping problem wasfirst addressed by Tum-blin and Rushmeier16and Ward20.They developed global mapping functions backed by results in psychophysics on brightness and contrast perception.Later,Ward7proposed the Histogram Adjustment technique which allocates dy-namic rang
e space in proportion to the percentage of pix-els with similar brightness,again taking contrast perception into account.Some researchers focused simply on computa-tion efficiency,mostly ignoring characteristics of the human visual system(HVS)14.Each of these methods can be classi-fied as spatially uniform because a single mapping function is derived and used for all pixels in a given image.The tone mapping proposed in this paper belongs to this category. Another group,the spatially varying methods,often attempt to model spatial adaptation by using locally changing map-ping functions,which depend on a given pixel neighbor-hood.While spatially varying methods might produce the most compelling images,they are significantly more expen-sive than spatially uniform techniques and their use in inter-active applications has not been shown so far.An interested reader can refer to a recent extensive survey on this topic4. Our motivation for this work is to address the need for a fast algorithm suitable for interactive applications which au-tomatically produces realistically looking images for a wide variation of scenes exhibiting high dynamic range of lumi-nance.For the sake of efficiency we use a spatially uniform tone mapping function which is based on a simple model of brightness perception.We provide the user with the possibil-ity of on-the-fly image appearance tuning in terms of bright-ness and contrast during an interactive application.The re-sulting images are detailed,and faithful representations of the original high contrast scenes reproduced within the ca-pabilities of the displaying medium.Material accompany-ing this paper can
be found on the web at:www-cg.cis.iwate-u.ac.jp/frederic/logmap. The paper is organized as follows:Section2briefly describes the research results our technique is based upon.In Section 3we present the tone mapping function,its parameters and usage.Section4proposes a solution to the loss of detail in dark areas caused by gamma correction.In Section5we dis-cuss some essential optimizations leading to the implemen-tation of a HDR movie player which enables the presentation of high dynamic range content in realtime.Finally,we con-clude this paper and propose possible directions for future research.
2.Background
The term brightness B describes the response of the HVS to stimulus luminance L.This response has the form of compressive non-linearity which can be approximated by a logarithmic function(Weber-Fechner law)B=k1ln(L/L0), where L0denotes the luminance of the background and k1 is a constant factor.The relation has been derived in psy-chophysical threshold experiments through examining just noticeable differences∆L for various L0.Slightly different relations between B and L have been obtained depending on such factors as stimulus size,L0,and temporal presen-tation.For example,supra-threshold experiments resulted in an observation that equal ratios of luminance lead to equal ratios of brightness and the HVS response should be rather modeled by a p
ower function(Stevens law)B=k2L n,where n falls in the range of0.3to1.0.In practice,both descrip-tions are relatively close so that it is difficult to discrimi-nate between them experimentally18.Therefore,we assumed the logarithmic relation in our tone mapping solution follow-ing Stockham15who recommended such a relation for image processing purposes:
L d=
log(L w+1)
max
(1) where for each pixel,the displayed luminance L d is derived from the ratio of world luminance L w and maximum lumi-nance in the scene L max.This mapping ensures that what-ever the dynamic range of the scene is,the maximum value is remapped to one(white)and other luminance values are smoothly incremented.While this formula leads to pleasant images,we found that the luminance compression is exces-sive and the feeling of high contrast content is lost.
3.Adaptive Logarithmic Mapping
The design of our tone mapping technique was guided by a few rules.It must provide consistent resul
ts despite the vast diversity of natural scenes and the possible radiance value inaccuracy found in HDR photographs.Additionally, it should be adaptable and extensible to address the current capabilities of displaying methods and their future evolution. Tone mapping must capture the physical appearance of the scene,while avoiding the introduction of artifacts such as contrast reversal or black halos.The overall brightness of the output image must be faithful to the context.It must be “user-friendly”i.e.,automatic in most cases,with a few in-tuitive parameters which provide possibility for adjustments.
©The Eurographics Association and Blackwell Publishers2003.
It must be fast for interactive and realtime applications while avoiding any trade-off between speed versus quality.
3.1.Scaling Scene Luminance to Image Brightness
The overall brightness of the output image is decided mainly by the lighting characteristics of the scene.It is then neces-sary tofind an initial scalefactor from the scene luminance to output image brightness.We can make here an analogy with the photography where the exposure settings determine the appearance of the taken picture.Modern cameras offer dif-ferent options for automatic
exposure setting,such as center-weighted,center-spot,or matrix-metering.In the same fash-ion,we rely on two methods suitable for different use.For static images or when a user does not directly interact with the scene,we compute the logarithmic average of the scene based on luminance values for all pixels,similar to Tumblin and Rushmeier16(who called this scalefactor world adapta-tion luminance)or Reinhard et al.12.We also use a center-weighted scalefactor for interactive tone mapping or walk-through sequences when a user’s center of attention might shift from one location to another in the scene13.Our im-plementation of a center-weighted scalefactor calculates the logarithmic average of the region centered at a pixel(the cen-ter of viewingfixation)and convolved by a two-dimensional Gaussian distribution kernel.The area of the sampled region and Gaussian kernel default to15%of the scene area but can be adjusted interactively.This method might be used in conjunction with an eye tracking system.We also offer an exposure scale factor allowing users to adjust the brightness of the output image to their displaying conditions.
3.2.Contrast Adjustment
The principal characteristic of our tone mapping function is an adaptive adjustment of logarithmic base depending on each pixel’s radiance.We interpolate luminance values found in the scene from log2(L w)to log10(L w).This essen-tially provides for good contrast and detail preservation in dark an
d medium areas while permitting maximum com-pression of high luminance values.In principle,a narrower or wider interval of logarithmic bases could be used,but we could notfind any practical reason for it.The values of log x(L w)for x<2increase sharply making exposure adjust-ments difficult.On the other hand for x>10luminance com-pression is only marginally augmented and the overall image loses too much contrast.We also observed some color shift caused by high logarithmic bases.
Figure2shows the difference between images which are tone mapped with log2()and log10()functions after apply-ing an initial world adaptation scalefactor.The following ba-sic property of logarithm permits an arbitrary choice of log-arithmic base:
log base(x)=
log(x)
log(base)
(2)
2
4
6
8
10
0 100 200 300 400 500
0.2
0.4
0.6
0.8
1
0 0.2 0.4 0.6 0.8 1
log2(x+1)log(x+1)log10(x+1)
Figure2:The Stanford MEMORIAL church mapped with
fixed base two logarithm(left)and with decimal logarithm
(right).The contrast and brightness difference is evident but
none of these images provides a satisfying rendition.Our
tone mapping function offers the possibility to combine the
characteristics of both images in a single result.Plots of the
logarithm function show the difference among common log-
arithmic bases.log2()increases sharply providing high con-
trast while log10()drastically compresses higher values.
For smooth interpolation among logarithmic bases,we rely
upon Perlin and Hoffert“bias”power function9.Bias was
first presented as a density modulation function,to change
density of the soft boundary between the inside and outside
of a procedural hypertexture.It became a standard tool of
texture synthesis and is also used for many different tasks
throughout computer graphics.The bias function is a power
function defined over the unit interval,an intuitive parameter
b remaps an input value to a higher or lower value.
bias b(t)=t log(b)
log(0.5)(3)
Figure3shows the bias curve for different b values.It is in-
teresting to notice that bias0.73produces approximately the
same mapping as the gamma correction function with a pa-
rameterγ=2.2.
3.3.Algorithm
The input data is converted from its original format to a
floating point representation of linear RGB values.Since the
©The Eurographics Association and Blackwell Publishers2003.
Figure 4:The Stanford MEMORIAL Church processed with different bias parameters:b =0.65,b =0.75,b =0.85,and b =0.95(from left to right).The scene dynamic range is 343,111:1.Radiance map courtesy of Paul Debevec.
0.2 0.4 0.6 0.8 1 0
0.2
0.4
0.6
0.8
1
b = 1.00b = 0.95b = 0.85b = 0.75b = 0.50b = 0.25b = 0.10
Figure 3:The bias power function for different value of the parameter b (refer to Equation (3)).In our application,use-ful value for b falls into the range 0.5–1.0.
scene illuminant characteristic is not accurately known in most cases,we assume a D 65white point,to further convert tristimulus values between Rec.709RGB and CIE XYZ.The XYZ luminance component Y of each pixel (L w for world luminance)and the maximum luminance of the scene L wmax are divided by the world adaptation luminance L wa and eventually multiplied by an exposure factor set by the user.
The tone mapping function presented in Equation (4)is used to compute a displaying value L d for each pixel.This function is derived by inserting Equation (3)into the de-nominator of Equation (2).Equation (4)requires luminance values L w and L wmax (scaled by L wa and the optional expo-sure factor)which characterize the scene as well as L dmax which is the maximum luminance capability of the display-ing medium.The parameter of the bias function is denoted
by b (refer to Equation (3)).L d =
L dmax ·0.01
log 10(L wmax +1)
·
log (L w +1)
log 2+
L w L wmax
log (b )
log (0.5)
·8
(4)
L dmax is used as a scalefactor to adapt the output to its in-tended display.In the denominator decimal logarithm is used since the maximum luminance value in the scene is always re-sampled to decimal logarithm by the bias function.We use a value for L dmax =100cd /m 2,a common reference value for CRT displays.The bias parameter b is essential to adjust compression of high values and visibility of details in dark areas.The result of different values for parameter b are visible in Figures 4and 6.The graph in Figure 5shows the curves of the mapping function for a scene with maximum luminance of 230cd /m 2.
00.20.40.60.811.21.40
50
100150200
D i s p l a y L u m i n a n c e
World Luminance
logmap(bias(1.))logmap(bias(.9))logmap(bias(.8))logmap(bias(.7))logmap(bias(.6))logmap(bias(.5))
Figure 5:Example plots of the tone mapping function (re-fer to Equation (4))for L wmax =230cd /m 2.The maximum displayable value (white)is 1.For bias parameters smaller than b =0.7clamping to L dmax will occur.
©The Eurographics Association and Blackwell Publishers 2003.
Values for b between0.7and0.9are most useful to gen-erate perceptually good images,but ideally a uniquefixed parameter working for most situations is needed.In an infor-mal evaluation,we askedfive
persons to interactively choose from six different scenes,among four images tone mapped with different bias parameters(Figure4was a part of the sur-vey)the ones they felt looked the most realistic and the most pleasing.In terms of preference a bias parameter around0.85 was consistently proposed.Results for realism were scat-tered for different images but consistent for each subject. Averaging preferences and realism from this simple evalu-ation,we propose a default bias parameter b=0.85.This indeed produces consistent,well balanced images with any kind of scenes.A side effect of changing the bias
parame-Figure6:Closeup of a light source of the ATRIUM scene at Aizu University(refer to Figure8for the full view of this scene in daylight conditions).Thisfigure illustrates how high luminance values are clamped to the maximum displayable value.The images were computed using the following bias parameter values:b=0.5,b=0.7,and b=0.9(from left to right).The scene dynamic range is11,751,307:1.
ter is some brightnessfluctuation of the output image.The image brightness is approximately doubled
for b=0.85and tripled for b=0.7in respect to images for b=1.0.This affects the realism of images even though the increase of contrast due to the bias value reduction naturally leads to brighter images.We introduce here a scalefactor to world adaptation luminance,aiming at keeping a constant bright-ness impression.Again the adaptation is based on a default bias parameter equal to0.85:adaptive
L wa=L wa/(1+b−0.85)5
Figures4and6benefited from this scalefactor,the global brightness impression is almost constant,even though the contrast among images is very different.
4.Gamma Correction
Gamma correction must be applied to the tone mapped data to compensate for the non-linearity of displaying devices. It is common to use a gamma coefficientγ=2.2for non-corrected displays,the gamma correction function is L d= L1/γ
w.
In our pipeline,this correction is applied to linear RGB tris-timulus values after tone mapping and conversion from CIE XYZ.We would like to address a potential problem of the gamma function.At the
origin’s vicinity,the gamma func-tion exhibits a very steep slope.Even though we usefloat-ing point precision1,after correction and quantization to24 bit,originally dark pixels will all be transformed to medium values.This results in significant contrast and detail loss in shadowed areas.Ward’s Histogram Adjustment method7en-sures that all displayable values are represented in thefinal image.However,other tone mapping methods potentially suffer from this phenomenon and the contrast of their result-ing images might be improved by considering this problem. Gamma functions with better perceptual accuracy have been 0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
0 0.2 0.4 0.6 0.8 1
gamma = 2ITU linear
0.1
0.2
0.3
0.4
0 0.02 0.04 0.06 0.08 0.1
Figure7:Comparison of the gamma power function usually used in computer graphics with the ITU-R
BT.709transfer function.The essential difference is the less drastic mapping of dark pixels in the ITU-R BT.709function.
proposed,for example the sRGB color space includes a spe-cific transformation.The international standard recommen-dation is the ITU-R BT.709transfer function11;it describes the transformation done by a video camera to produce the best possible images on a calibrated display.This function is close toγ=2,but assumes aγ=1.125correction of the dis-play to compensate for the viewing environment.The prin-cipal differences between the gamma power function and the ITU-R BT.709transfer function(refer to Figure7)are smaller output values for dark pixels in the latter case.This results in better contrast and details in dark areas and po-tential attenuation of the noise often found in dark parts of photographs.
In its original form,the ITU-R BT.709gamma correction is:
E =
4.5L L≤0.018
1.099L0.45−0.099L>0.018
where L is the linear value of each RGB tristimulus and E the nonlinear pixel value to be displayed.
The ITU-R BT.709transfer function hasfixed parameters. This lacks convenience for computer graphics applications, where different transfer values might be needed depending on the lighting conditions surrounding the display,custom user settings,and operating system.We adapted the function to use familiarγvalues and we use a simplefit of the lin-ear segment at the origin.Our transfer function based on the
©The Eurographics Association and Blackwell Publishers2003.
ITU-R BT.709standard is:
E =
slope ·L
L ≤start 1.099L 0.9γ−0.099
L >start
Where slope is the elevation ratio of the line passing by the origin and tangent to the curve,and start is the abscissa at the point of tangency.All the images in this paper have been corrected with this custom gamma function using γ=2.2.Direct comparison of images shows some contrast enhance-ment in dark to medium areas,while keeping a similar over-all brightness.
5.Implementation and Results
In our original scheme,each pixel is processed with Equa-tion (4),and computation time increases linearly with the number of pixels.This is too slow for realtime applications so we have been looking for a faster solution.We rejected the idea of using a lookup table because it would need too many entries to satisfy the wide dynamic range,and a dif-ferent table is needed if the user changes a parameter in the tone mapping procedure.
Evaluation of the bias function for each pixel is particularly expensive.We found that if the luminance difference among pixels is below a certain threshold,the bias function can be evaluated just once for their average luminance value.In practice,we split the input image into 3×3pixel tiles and perform the bias computation for each group of nine pixels.This adaptation gives a substantial speedup even for very de-tailed scenes (e.g.,MEMORIAL )and performs even better for simple scenes such as the computer generated ROOM .
Further acceleration was obtained by a Pade approximation of log (x +1),for low radiance values.Table 1shows the computation time of our algorithm for five scene (refer to Figures 4and 8)of different sizes,the speedup factor re-sulting from our optimizations,and the percentage of error introduced by those optimization.In all the images tested,we could not visually detect a difference between the results of the original algorithm and the faster version.Scene
Size Base Fast Speedup Diff (pixels)(sec.)(sec.)#times (%)MEMORIAL 512×7680.1430.036 3.970.75NAVE 720×4800.1260.031 4.060.21ROOM 3000×1950 2.1110.428 4.930.43ATRIUM 1016×7600.2810.061 4.610.22PANORAMA
2000×9010.6520.153 4.260.14
Table 1:Tone mapping routine execution time before and af-ter optimization,speed increase,and the RMS image differ-ence.Algorithm running on a Pentium IV 2.2GHz,compiled with Intel C compiler version 5.The tone mapping routine is taken into account here.Image IO,color space transforma-tion,and the initial calculation of L wa remain constant and are not part of the table.
5.1.A High Dynamic Range Movie Player
In some multimedia applications,it can be more convenient to distribute video streams in an HDR format.This way,end-users are able to tune display parameters to accommo-date for their hardware characteristics as well as external lighting conditions.Also,the animation might be adjusted according to personal preference,achieving a desired bal-ance between reproduced contrast,details,and brightness.At present,these settings must be decided by the distributor and are fixed for streamed video.
To address those issues we implemented our tone map-ping method in a HDR movie player.Instead of saving al-ready tone mapped 24bit images,we created a HDR movie file format in which the physical radiance value of each pixel is available.This offers the same advantages and capabilities as for static HDR scenes.The viewer has access to a percep-tually tuned rendition of the movie through tone mapping while conserving the original HDR data.Beside exposure adjustment,setting the maximum display luminance L max makes optimal viewing possible with any kind of display,and interactive adjustment of the bias parameter results in different luminance and contrast compression.
We use Ward’s RGBE format 19to build the movie file.In-stead of using three floating point values (96-bits),each pixel is represented by four integers (32-bits).The obvious advan-tage is a 2/3file size reduction,allowing to save long ani-mations and reading frames from disk in a manageable time.The
downside is the exponentiation needed to convert data for tone mapping and display.Also,a major speed bottleneck is the necessary conversion from RGB tristimulus to lumi-nance values and back.For each frame,we precompute and save constants needed for tone mapping,such as world adap-tation L wa and maximum luminance L wmax .These of course would have to be calculated while playing for a VRML ap-plication or an animation rendered in realtime.We simulate the time-dependent adaptation of the human visual system by a weighted averaging of the world adaptation of the last four frames with the current.
We implemented two versions of the tone mapping function.A straightforward C routine,and a GPU implementation us-ing the OpenGL fragment program extension.Modern GPUs support SIMD (Single Instruction Multiple Data)instruc-tion sets capable of performing very fast parallelized floating point calculations.The ATI Fire GL X1which we used has eight pixel pipeline and a 256bit memory interface,which means that eight pixels are processed in parallel making the GPU very powerful even with a much slower clock rate than modern CPUs.Table 2summarizes the frame rates obtained on our test PC.6.Conclusions
We presented a perception-motivated tone mapping algo-rithm for interactive display of high contrast scenes.In our algorithm the scene luminance values are compressed using logarithmic functions,whi
ch are computed using different
©The Eurographics Association and Blackwell Publishers 2003.
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论