This page is for the report of the program assignment #1 in VFX 2008 Spring.
Introduction:
In this assignment, we are supposed to implement the Paul Debevec's method which is teached in the class to compose HDR images. We capture photographs using AHDRIA with a Canon PowerShot G7 from TA. The captured images are aligned by our implementation of the MTB algorithm. After the irradiance map is recovered, we first perform a simple white balance to estimate the shifts between color channels which are lost during optimization. The corrected irradiance map then undergoes a tone-mapping process by fast bilateral filtering to get a mapped image for usual display.
Algorithm implementation & details:
We implemented our program using VS .NET C++ with OpenCV to facilitate common image processing routines. Our implementation includes: 1) MTB algorithm for image alignment, 2) Paul Debevec's algorithm for HDR composition, 3) a simple white balance algorithm and 4) a fast bilateral filter for tone-mapping. The details and personal comments of each parts are following.
MTB:
We modified the procedure on the class slides to suit our needs. To deal with a sequence of images, we align each image to the last one in the sequence and concatenate all the shifts afterward. Note that one cannot blindly align each image to one single image because even the thresholded binary images can change considerably among different shuttle speeds. We also increase the number of thresholding levels to 3. This effectively prevent the algorithm to break down when both images for alignment are of very low contrast.
Note: We optionally change the number of thresholding levels for different datasets.
Paul Debevec's method:
This part is simple as the teacher went through most of the details in the class. We recover one response curve for each color channel and compute the irradiance maps independently. This approach has a problem of color shift as the response curve we optimized is only up to a scale, and no constraints are established among three channels. Thus, white balance is needed.
White Balance:
We estimate the true white from the top 1% pixels with the largest min(r,g,b) in the irradiance map. Those pixels are averaged and the mean is assumed to be the white point. The two channels of smaller magnitudes of the estimated white point are then positively shifted to balance the whole image. It should be noted that our method does break down if no pixels close to white present in the image, but this is common to many white balance algorithms. As HDR images typically have many light regions, our algorithm performs well.
Fast Bilateral Filter:
We implemented the version as described in [1]. The color and spatial sigmas we use are identical to the one in the paper. Spatial downsampling factor is set to 8. We choose the bicubic filter for upsampling, but other filters perform similarly. Depending on the sigma parameters, Our implementation takes about 0.5 sec for an 1M image. The extracted base image is linearly adjusted to match the target intensity levels for display.
Results:
Here we present several tone-mapped images including the one of the sample dataset from the class website. Optionally, we apply bilateral denoising when the input images are too noisy.
One may observe that some halo effects show up near the silhouette of the building. This is due to the limitation of bilateral filter. The sigma of intensity needed to exhibit splendid HDR depth feeling just also leaks intensity values across the boundary. It is often hard to trade-off between the two extremes. Such difficulty is common to several applications of bilateral filter, and thus limits the use of bilateral filter.
Sample:
Library 1:
Library 2:
Download:
Codes, Binary & Documents:
Datasets & Tone-mapped result:
Reference:
1. Fast Bilateral Filtering for the Display of High-Dynamic-Range Images. See "http://people.csail.mit.edu/fredo/PUBLI/Siggraph2002/".


