CS180: HDR and Tone Mapping

Exploring Part A and Part B

Introduction

This project focuses on High Dynamic Range (HDR) imaging and tone mapping techniques. The objective is to create HDR images by combining multiple Low Dynamic Range (LDR) exposures, reconstructing an HDR radiance map, and applying tone mapping operators to produce visually appealing images suitable for display.

Original Image

Original Image

Project Goals

The primary goal of this project is to develop a robust HDR imaging pipeline that effectively combines multiple exposures to capture the full dynamic range of a scene. The specific objectives include:

Key functions include construct_radiance_map() for merging exposures into an HDR map, decomposition() for separating base illumination from details, and local_tone_map() for enhancing local contrasts based on the decomposition.

HDR Reconstruction

HDR reconstruction involves merging multiple LDR exposures to create a high dynamic range radiance map that represents the full spectrum of light intensities in a scene. This process ensures that details in both the shadows and highlights are preserved, providing a comprehensive representation of the scene's lighting.

The HDR reconstruction process consists of these steps:

Input Images for HDR Reconstruction

Input Images for HDR Reconstruction

Log Radiance (Luminance) Visualization

Log Radiance (Luminance) Visualization

Radiance Map and Camera Response Curve

The HDR radiance map is constructed by combining pixel values from multiple exposures. A critical component of this process is recovering the camera response curve g(Z), which maps observed pixel values to log exposures. This curve is essential for accurately estimating the true radiance of each pixel in the scene.

The response_curve() function calculates the camera response curve using a weighted least squares approach. It balances data fidelity from multiple exposures with smoothness constraints to ensure a stable and accurate response curve. The resulting curve is then plotted to visualize the mapping from pixel values to log exposures. For more details, refer to the original work by Debevec and Malik (1997).

Tone Mapping

Tone mapping is the process of compressing the high dynamic range radiance map into a format suitable for display devices, which have a limited dynamic range. This step is crucial for maintaining the visual details and contrast of the original scene in the final image.

Global Tone Mapping

Global tone mapping applies a uniform transformation to the entire HDR image to compress its dynamic range. The global_tone_map() function implements this by:

This approach provides a quick and straightforward method to reduce dynamic range but may sometimes result in loss of local contrast and detail.

Comparison of Tone Mapping Approaches

Comparison: Single Exposure, Global Tone Mapping, and Local Tone Mapping

Decomposition for Local Tone Mapping

Local tone mapping enhances local contrast by decomposing the log intensity image into base illumination and detail layers. The decomposition() function achieves this by applying a bilateral filter to separate the image into a smoothly varying base layer and a high-frequency detail layer. This separation allows for independent adjustment of global and local contrast, resulting in a more visually appealing image. This technique is based on the methodology presented by Durand and Dorsey (2002).

Original Log Domain, Base Layer, and Detail Layer

Original Log Domain, Base Layer, and Detail Layer

Global and Local Tone Mapping Comparison

Comparing single exposure, global tone mapping, and local tone mapping approaches highlights the advantages of each method. The compare_tonemapping() function was used to display these comparisons side by side, illustrating how global tone mapping uniformly compresses the dynamic range while local tone mapping preserves local details by adjusting contrast based on local regions.

Comparison of Tone Mapping Approaches

Comparison: Single Exposure, Global Tone Mapping, and Local Tone Mapping

Local Tone Mapping

The local_tone_map() function performs local adjustments based on the decomposed base and detail layers to enhance local contrast and preserve scene details. This results in an image that retains both global brightness and local intricacies, offering a balanced and visually appealing representation of the original scene's dynamic range.

Final Local Tone Mapped Image

Final Local Tone Mapped Image

Before & After

The following images demonstrate the effectiveness of the HDR reconstruction and tone mapping processes by showcasing the original image alongside the final tone mapped result.

Original Image

Original Image

Final Local Tone Mapped Image

Final Local Tone Mapped Image

The display_imgs() function was utilized to present these comparisons clearly, ensuring that the enhancements achieved through tone mapping are easily observable.

Other Examples

Original Image

Original Image (1)

Final Local Tone Mapped Image

Final Local Tone Mapped Image (1)

Original Image

Original Image (2)

Final Local Tone Mapped Image

Final Local Tone Mapped Image (2)

Conclusion

The project successfully implemented HDR reconstruction and tone mapping techniques, demonstrating the ability to create visually appealing images that preserve the dynamic range and local details of a scene. By leveraging methodologies from Debevec and Malik (1997) and Durand and Dorsey (2002), and utilizing key functions such as construct_radiance_map(), decomposition(), and local_tone_map(), the project achieved robust and high-quality HDR images suitable for various display applications.