<< Chapter < Page Chapter >> Page >

Tone mapping

Tone Mapping is a tool that allows us to map a High Dynamic Range (HDR) image for display on a Low Dynamic Range (LDR) medium, such as an LCD screen. We have implemented Reinhard's algorithms in doing this, which revolve around the idea of scaling the pixel values of the image by a factor to fit in the LDR. In Reinhard's paper, two implementations are found. Let us call these two: Initial Scaling, and Dodge-and-Burning (DAB).

For both implementations, we compress the 3 different channels of Red, Green, and Blue into luminance values by:

L w = ( 0 . 2125 ) R + ( 0 . 7154 ) G + ( 0 . 0721 ) B ;

We denote the luminance value by L w and Red, Green, Blue by R , G , B respectively.

As we would like to avoid singularities, we adjust all luminance values for each pixel with a small value, ϵ .

For the Initial Scaling scheme, we first obtain the key value of the scene by computing:

k e y = 1 N e x p ( x ( y ( l o g ( d e l + L w ) ) ) )

where we sum over all x and y values indicating pixel location. Now, we normalize all pixel values with respect to the middle-grey of the scene. The middle-grey is the subjective middle brightness region of the scene and for images of normal brightness, this middle-grey value typically maps to 0.18, and always lies in between 0 and 1. Once we have normalized, we scale all pixel values by to get a LDR image:

L d ( x , y ) = L ( x , y ) 1 + L ( x , y )

In the DAB scheme, we obtain two Gaussian functions of different sizes located concentric with each other, where the ratio of variances is set to 1.6 (this value can be changed slightly to meet better quality tone mapping). We convolute the image with both Gaussian functions and calculate:

V ( x , y , s ) = V 1 ( x , y , s ) - V 2 ( x , y , s ) 2 φ a / s 2 + V 1 ( x , y , s ) ( 1 )

where V 1 and V 2 are the Gaussian functions of different sizes, φ is a parameter (=8 in our case), a is the subjective middle-grey value of our scene and s is the scaling ratio of the Gaussian functions.

In doing so, we hope to find a small outcome that is less than or equal to a tolerance level that we give (in our case 0.05). If this value meets the tolerance level, we try to enlarge the variance (and by doing so enlarge both gaussians) so that we can compute (1) over again to re-evaluate if this larger area still meets the tolerance. We keep doing this until our Gaussians cover the entire image or we meet the largest area that is less than the tolerance level. We then keep the convoluted values of the image with the smaller Gaussian function and use this for our new LDR image.

What we are essentially doing in this scheme is finding the smallest contrast difference obtainable in the largest area and keeping these values. In effect, we are smoothing the image to fit the LDR yet keeping the edges and details of the image.

In these two ways, we are able to obtain a LDR from a HDR image.

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, High dynamic range imaging. OpenStax CNX. Dec 18, 2012 Download for free at http://cnx.org/content/col11471/1.1
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'High dynamic range imaging' conversation and receive update notifications?

Ask