Drago Adaptive Log Mapping
Implement Drago's adaptive logarithmic tone mapping, a technique used in tone mapping to preserve details in high dynamic range images. This method extends traditional logarithmic tone mapping by adapting the base of the logarithm based on local luminance.
The goal is to map high dynamic range images to lower dynamic ranges while preserving details, which is crucial in computational photography. The logarithmic tone mapping approach is based on the idea that human perception of light is logarithmic, and can be represented by the equation Ld=logb(1+Lmax)logb(1+L), where L is the luminance and b is the adaptive base.
Here are the key steps:
- Compute the luminance L from the input image.
- Determine the maximum luminance Lmax.
- Calculate the adaptive base b based on local luminance.
- Apply the logarithmic tone mapping using the calculated b.
This technique is widely used in high dynamic range imaging applications.
Example:
HDR image
Tone mapped LDR
Adaptive log base improves local contrast
Constraints:
- Input image: 2D numpy array (grayscale or RGB) with shape (height, width) and dtype float32, representing the high dynamic range image
- Luminance values: in range [0, 1e6], assuming a maximum possible luminance of 1 million
- Adaptive base calculation: b in range [2, 10], with a minimum and maximum base value to prevent division by zero and ensure meaningful tone mapping
- Output: return the tone mapped image as a 2D numpy array (grayscale or RGB) with the same shape as the input, and dtype uint8, representing the low dynamic range image
- Special conditions: assume the input image has at least one pixel with a non-zero luminance value to avoid division by zero in the logarithmic tone mapping equation
More from CV: Computational Photography
Background Knowledge
Tone Mapping is a technique used in Computational Photography to adjust the contrast and brightness of an image to make it more visually appealing. It's particularly useful when dealing with high dynamic range (HDR) images, which contain a wide range of intensity values. Drago's Adaptive Log Mapping is an extension of the Reinhard Tone Mapping technique, which uses a logarithmic function to map the intensity values of an image.
The key concept behind Drago's Adaptive Log Mapping is the use of an adaptive base logarithm, which varies based on the local luminance of the image. This allows for better preservation of details in both bright and dark areas of the image. The formula for Drago's Adaptive Log Mapping is given by: Ld=logb(1+Lmax)logb(1+L) where L is the intensity value of a pixel, Lmax is the maximum intensity value in the image, and b is the adaptive base logarithm.
In order to understand this problem, it's essential to have a good grasp of logarithmic functions and how they can be used to transform intensity values. Additionally, understanding the concept of local luminance and how it can be used to adapt the tone mapping process is crucial. Image processing techniques, such as calculating the maximum intensity value and applying the tone mapping formula to each pixel, are also necessary to solve this problem.
Continue the full explanation
You're reading the free preview. Unlock the complete walkthrough, the code editor, test runner and reference solution with Premium.
Editor locked
The code editor is locked for Pro problems. It is only available for free problems. Please upgrade to gain access to the code editor for all problems.