Creating HDR Images
We want to build an HDR radiance map from several LDR exposures.Part 1: Recovering a radiance map from a collection of images
- The observed pixel value Zij for pixel i in image j is a function of unknown scene radiance and known exposure duration: Zij = f(Ei Δ tj ). Ei is the unknown scene radiance at pixel i, and scene radiance integrated over some time Ei Δ tj is the exposure at a given pixel. In general, f might be a somewhat complicated pixel response curve. We will not solve for f, but for g=ln(f-1) which maps from pixel values (from 0 to 255) to the log of exposure values: g(Zij) = ln(Ei) + ln(tj)
- Trying to minimize
- The smoothness term : g''(x) = (g(x-1) - g(x)) - (g(x) - g(x+1)) = g(x-1) + g(x+1) - 2*g(x)
- Each exposure only gives us trustworthy information about certain pixels (i.e. the well exposed pixels for that image). For dark pixels the relative contribution of noise is high and for bright pixels the sensor may have been saturated. To make our estimates of Ei more accurate we need to weight the contribution of each pixel. An example of a weighting function w is a triangle function that peaks at Z=127.5, and is zero at Z=0 and Z=255. This is provided for you in the starter code. This weighting should be used both when solving for g and when using g to build the HDR radiance map for all pixels.

by solving the over determined system of linear equations would give us appropriate values for g.
Part 2: Converting this radiance map into a display image
- Few Eg. gobal tone-mapping operators are log(L), sqrt(L), and L / (1+L).
- In the results the Global Simple is log(L)
- I implemented a simplified version of a local tone mapping algorithm given in Durand 2002.
- Rough Steps are:
- Input is linear RGB values of radiance.
- Compute the intensity (I) using a luminance function.
I = 0.2126 R + 0.7152 G + 0.0722 B Source:Wikipedia - Compute the chrominance channels: (R/I, G/I, B/I)
- Compute the log intensity: L = log2(I)
- Filter that with a bilateral filter: B = bf(L)
- Compute the detail layer: D = L - B
- o = max(B)
- s = dR / (max(B) - min(B)). dr=[2:8]
- Apply an offset and a scale to the base: B' = (B - o) * s
- O = 2^(B' + D)
- R',G',B' = O * (R/I, G/I, B/I)
Apply gamma Correction.
Extra Credit
Fast Bilateral Filter: Using the method described in the class and in the paper Durand 2002. I converted the 2d image into a 3d with the intensity values with subsampled values. To this now a spacial gaussian and an intensity gaussian could be applied due to which the computation time of the bilateral filtering reduced substantially from mins to a couple of sec's.
Image Alignment Using proj1 code: Some of the images weren't aligned properly and so when the hdr images were being created the radiance from the hight value points use to get diffused into the neighbouring points. Using the code from proj1 I converted the images to grayscale using the luminance function defined above. And taking the first image as the base realigned the rest of the images to it.
Without alignment | After aligning |
![]() |
![]() |
![]() |
![]() |
Used self images: Check out the coke android caves images in the results.