High Dynamic Range Imaging

Travis Portz

Introduction

The objective of this project was to learn how to create high dynamic range (HDR) images from a sequence of exposures. A single exposure is limited in its dynamic range by the bit-depth of its sensors, which is usualy 8 bits per channel. This leads to saturation where regions of the image are washed out or completely black. By combining the information from multiple exposures with different shutter speeds, a larger dynamic range can be obtained and the saturated regions can be restored.

The Algorithm

The HDR imaging method used here is Debevec's algorithm. The algorithm finds a response curve g(Zij) = ln Ei + ln Δtj which maps the pixel intensity Zij from exposure j to the sensor irradiance Ei at pixel i. The radiance map Ei can then be tone-mapped to obtain a HDR image.

To find the response curve, the algorithm minimizes the following:
O (1)
where w(z) is weighting function that weights pixel closer to the middle value more heavily than pixels closer to the minimum or maximum value. The sum also includes a second-derivative term to provide a smoothness constraint on the response curve.

Implementation

I implemented the algorithm in MATLAB. The sum in equation 1 is put in matrix form and minimized by finding the least squares solution to Ax = b. The vector x then contains the response curve values g(z) and the sensor irradiance values ln Ei. The implementation is provided in the script hdr.m.

The algorithm is only run on a subset of the pixels in the images. These pixels are chosen by the user with another MATLAB script points.m.

Results

Algorithm was run on a sequence of 13 images obtained from here. Three of 13 exposures are shown below.

10 s 1 s 1/60 s

The images are already aligned. The median threshold bitmap alignment technique will result in misalignment on some of the extremely underexposed images. The response curve was obtained using lambda = 10. The curve is shown below.

Response curve

The radiance map was tone-mapped using MATLAB's tonemap function. The tone-mapped image is shown below.

Tone-mapped image

References

Debevec, P.E. and Malik, J. Recovering High Dynamic Range Radiance Maps from Photographs. SIGGRAPH 1997.

Ward, G. Fast Robust Image Registration for Compositing High Dynamic Range Photographs from Hand-Held Exposures. JGT 2003.