<< Chapter < Page Chapter >> Page >

An implementation suggested by Reinhard in“Photographic Tone Reproduction for Digital Images,”involves constructing circularly symmetric Gaussians of eight varying scalesand convolving them (via multiplication in the frequency domain for speed improvement) with the image luminance values, which resultsin the production of eight Gaussain-blurred versions of the image with different degrees of blurring.

The equation used for the Gaussians is:

(Reinhard et al., 4)

The normalized error function for the difference between the image at one scale of blurriness and thenext is iteratively evaluated at successive scale values, sm, where s = 1.6^Sm, until its absolute value exceeds the threshold of 0.05.The scale value one less than that causing the threshold to be exceeded (if sm=1 exceeds the threshold, the 1 is still kept) isthen stored in the scale matrix, Sm(x,y). The paper provided a suggested threshold value of 0.05 that seemed to work well for mostimages although others were tried. The function below is evaluated at every pixel in the image, and a scale value is determined foreach pixel, ranging from 1 to 8. The value for alpha1 is taken to be 0.3536 (approximation of 1/(2*sqrt(2))) par recommendation fromthe paper, and alpha2 is set to 1.6*alpha1 = 0.5657.

The equation used to construct the Sm matrix:

where |V|<0.05 (Reinhard et al., 4).

Phi = 8.0 and a is the key value, set to 0.18 for most images. These values were suggested by the paper andadjusted to understand their effects, but phi = 8.0 was used for all final test images. The average luminance of the image tends tosuggest the key value, a. In practice, it should be varied from about 0.09 to 0.36 (or sometimes more) for some darker or lighterphotographs, respectively. The Vi values for i=1 and i=2, as used above, are calculated via convolution of the luminance values withthe Ri Gaussians defined in the R(x,y,z) equation above. The equation representing this convolution is: Vi(x,y,s) = L(x,y) *Ri(x,y,s) (Reinhard et al., 4).

To produce the final image, the formula,

is evaluated over all x and y values of possible image positions (Reinhard et al., 4). The algorithmultimately accomplishes a greater reduction in brightness for regions especially bright and a greater increase in brightness forregions that are especially dark. For example, for a dark pixel in a relatively luminescent region, L(x,y)<V1(x,y), therefore Ld(x,y) will decrease, increasing the contrast at that point. Onthe other hand, a bright pixel in a darker region will cause L(x,y)>V1(x,y), therefore Ld(x,y) will increase, subsequently increasing the contrast for this case as well.

In an effort to improve the algorithm, we changed the Ld equation above to

where C are scaling coefficients that can give more weight to the brightening or darkening effect for V1because, with some images, the effects are not strong enough with our original implementation of the algorithm. This is veryeffective on some images where regions with similar sm values have similar brightness, and the coefficients could be determined byhand or by another algorithm from the sm(x,y) matrix. On more complex images, Sm values correlate with similar brightness only onlocal regions so C(sm(x,y)) would have to also depend on x and y independent of sm and therefore become, C(sm(x,y),x,y).

Examples:

(Photo from nine-image set in“IRIS TUTORIAL: Comet High Dynamic Range imagery Application to total eclipseprocessing”-- (External Link) )

Fig. 1: Global Linear Operator:

Fig. 2: Using original operator based on Reinhard paper (equivalent to C = {1,1,1,1,1,1,1,1}):

Fig. 3: Using final equation with C = {-2,-2,-1,4,4,4,4,4}:

Here, setting C to something different that {1,1,1,1,1,1,1,1} is rather effective at pulling down the extremelybright window even more. It works pretty well since the high-valued region of Sm(x,y) corresponds to a similar sm value in the same(x,y) rectangular-bounded region in all color channels.

Scale Matrix Examples (Longer wavelength color corresponds to higher Sm(x,y) value):

The images below show an example of how an HDR image of a window scene was broken into different scale regions by thealgorithm: dark blue = 1, light blue = 2, cyan = 3, yellow = 4, orange = 5, and dark red = 6.

The Sm matrix values show how the overly bright window region was easily isolated with the C vector:

Fig. 4: Red:

Fig. 5: Green:

Fig. 6: Blue:

Example 2:

(Photo from three-image set taken by Robert Ortman in Banff National Park, Canada)

Fig. 7: Global Linear Operator:

Fig. 8: Using original operator based on Reinhard paper (equivalent to C = {1,1,1,1,1,1,1,1}):

Fig. 9: Using final equation with C = {1 1 1 1.5 4 4 4 4}:

In this case, the operator based on the paper renders the grass and trees part better since it increases theluminance in those regions relatively well, but it does worse than the global linear operator on the clouds: it has not decreasedluminance nearly enough in that region. Attempting to use the C vector to help reduce extra cloud luminance also fails here becausethe Sm regions computed for the clouds do not correspond very well for across color channels. In particular, the blue channel had aclearly high-valued region that could have it’s brightness selectively reduced, but applying this equally across all colorchannels results in discoloration. Applying the increased weight of luminance reduction to the regions represented in yellow and orangebelow across all color channels darkens blue (the most) and red much more than green, leaving the green and yellow (red+green)patches showed above.

The Sm matrix values clearly explain the discoloration:

Red:

Green:

Blue:

In both example photos above, the operator based on the Reinhard paper tended to outperform the global linearoperator in some parts and fail in others. In some cases, it can be easy to fix with the introduction of the C vector, but ultimately,there must be a better way.

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Elec 301 projects fall 2006. OpenStax CNX. Sep 27, 2007 Download for free at http://cnx.org/content/col10462/1.2
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Elec 301 projects fall 2006' conversation and receive update notifications?

Ask