Implement Reinhard's global tone mapping operator to map High Dynamic Range (HDR) images to a displayable range while preserving local contrast. This technique is crucial in Computational Photography as it enables the display of HDR images on standard devices.
The concept of tone mapping is based on the idea of compressing the dynamic range of an image, which is the ratio of the brightest and darkest areas, to fit within the limited range of a display device. Tone mapping operators like Reinhard's apply a non-linear transformation to the image's luminance values, preventing saturation and preserving details. The transformation involves calculating the log-average luminance of the image, which represents the average brightness, and then scaling the luminance values based on a key value that controls the overall brightness.
To achieve this, the following steps are involved:
This technique is widely used in image and video processing applications.
hdr = HDR image with values > 1.0 key = 0.18
LDR image with values in [0, 1]