JonashHDRHDR Gallery

Digital Visual eFfecX
HDR, Assignment 1

In this assignment I implemented Paul Debevec's paper. The tonemapping was done using Reinhard's plugin on HDRShop and PhotoMatix.

Team Member
R94725022 ¸êºÞ©Ò ¶À»²¤¤

Platform
MS Visual Studio .Net 2003
TAUCS sparse matrix library
gil2 graphic image library

Referred Paper
Paul E. Debevec, Jitendra Malik. Recovering High Dynamic Range Radiance Maps from Photographs , SIGGRAPH 1997.

Algorithm
In Paul's paper, we intend to recover a radiance image from a sequence of under- or over- exposured images. These images were typically taken with large or small shuttle speed because that the radiance range of the scene was extremely large. The physical limitation of digital camera cannot cover the whole range, and in order to cope with such problem, an algorithm was designed to assemble these images and find the inverse of the response curve hidden in the camera. After such procedure, we can inverse-map the pixel of the picture back to its radiance value by substract the natural log of the exposure time.

Such procudure can be fomulated as followed:

Z_ij = f(Radiance_i * Time_j)

The pixel value of Z_ij is the i-th pixel at j-th exposure time, and is the function value of the Radiance at pixel location i times the exposure time j. By taking inverse of function f, we have

f^-1(Z_ij) = Radiance_i * Time_j.

Taking log on both side, we have

Ln(f^-1(Z_ij)) = Ln(Radiance_i) + Ln(Tine_j) = G(Z_ij),

where G() = Lnf^-1(). In this formulation we intend to find the function G and the radiance at each pixel. Such a problem can be fomulated in an over-determined linear system and be solved using least square solver. Differing from the SVD solver described by Paul Debevec, my implementation use normal equation and conjugate gradient iterative method to solve the system.


Results
The results of HDR image files can be download from here. We also made some artifacts using various Tone-Mapping algorithm, and were displayed in Gallery.


Other Thoughts
In this assignment I tought Paul's algorithm pretty easy to implement, but the result were not as good as I previously thought. I guess at least 3 factors can contribute to the phenomena.

First we assume G(Zmid) is zero, this have the implication that these pictures were taken from a digital camera of optical sensor with equally-responding color channels, yet I think this assumption were not true.

The secoond is that data are quite noisy. Paul Debevec include a panelty term encouraged the second-order-derivative to be small, and thus a smooth function of G is intended. The penalty term plays an important role in the data fitting but not so trival to tweak. I show a picture of the fitted cure here using the thrid image of the right column. The weighting for the panelty term is 4. How can the smoothness of the curve can affect the HDR reconstruction is out of my knowledge.

The third concern is that we usually do not take every pixel in the image into consideration, otherwise we will have too large a system to solve. Paul's paper said that the pixels solved were manually picked. In my implementation, I randomly choose several pixels to solve, and I do not know if this will affect the result.

Finally, I think the tone mapping is so important that it can dramatically bias the resulting image, and manually tweaking parameters is necessary.

Useful Links
HDR Shop
HDR Soft
TAUCS
Reinhard's Tone Mapping


The tone-mapped HDR image of Stanford Memorial. (Tonemap by Reinhard, HDRShop)


The HDR image mapped by my-self. (Manual Tweaking, HDRShop)


The HDR image which I re- assembled. (Tonemap by Photomatix)

The re-assembled imaget. (Tonemap by Photomatix)

  JonashHDRHDR Gallery