PIXELBANKv9.1.0
Menu

Implement exposure fusion to blend multiple exposures without HDR tonemapping, leveraging quality metrics to produce a seamless image. This technique is crucial in HDR Imaging as it allows for the combination of differently exposed images, capturing a wider dynamic range.

Exposure fusion directly blends images using weight maps based on contrast, saturation, and well-exposedness, which are calculated as C=βˆ£βˆ‡I∣C = |\nabla I|, S=std(R,G,B)S = \text{std}(R, G, B), and E=exp⁑(βˆ’(Iβˆ’0.5)22Οƒ2)E = \exp(-\frac{(I - 0.5)^2}{2\sigma^2}).

  1. Calculate contrast using the Laplacian filter.
  2. Compute saturation as the standard deviation across color channels.
  3. Determine well-exposedness using a Gaussian function centered at 0.5.
W=Cwcβ‹…Swsβ‹…EweW = C^{w_c} \cdot S^{w_s} \cdot E^{w_e}

This technique is widely used in digital photography to capture high-contrast scenes.

Example:

Input:
images = [dark_exposure, medium_exposure, bright_exposure]
Output:
Fused image with details from all exposures
Reasoning:
  1. Compute weight maps for each exposure
  2. Normalize weights to sum to 1
  3. Blend images using weights
  4. Multi-scale blending for better results

Constraints:

  • images: List of differently exposed images
  • Return: Fused image
πŸ”’

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.

solution.py

Test Results

0/0
Run code to see test results.
Exposure Fusion - Hard | PixelBank