Digital Visual Effects, Spring 2013

Jump to...

project #2
project #3
final project

project #1: High Dynamic Range Imaging

Assigned: 2013/3/6
Due: 2013/3/27 11:59am
submission, voting

Project description

High dynamic range (HDR) images have much larger dynamic ranges than traditional images' 256 levels. In addition, they correspond linearly to physical irradiance values of the scene. Hence, they are useful for many graphics and vision applications. In this assignment, you are asked to finish the following tasks to assemble an HDR image in a group of two.

1. Taking photographs. Take a series of photographs for a scene under different exposures. (As discussed in the class, changing shutter speeds is probably the best way to change exposures for this application.) For that, you need a digital camera that allows you to set exposures. You can use your own camera or borrow a Canon PowerShot G7 from us. If you need to borrow G7, please sign up here. It is suggested that you use a tripod when you take pictures. Again, you can use your own or borrow one from TAs.

One thing to note is that you should avoid touching your camera during this process so that all pictures are well registered. For Canon cameras, there are programs allowing you to set exposures and release shutter remotely, for example, Breeze system's PSRemote. Another solution would be to use AHDRIA for some models from Canon, but it is obsolete and not maintained since 2007. Cameras of other brands might have a similar solution for remote capturing, but you have to discover on your own. You are welcome to write down your findings for that matter in your report. When you borrow G7 from us, you can borrow a laptop with PSRemote installed from us as well.

If you decide to manually change exposures, it would help if you align your images before proceeding to the next step. You can probably try to use Photomatix. Otherwise, you are also welcome to write a program for alignment as bonuses. A good candidate is the median threshold bitmap we discussed in the class.

2. Write a program to assemble an HDR image. Write a program to take these captured images as inputs and output an HDR image and, optionally, the response curve of the camera. We provide a C++ image class called cmlib which supports I/O for many image formats for both unsigned-char images and float-point images. We recommend that you output your radiance map as a Radiance RGBE image (.hdr) or OpenEXR format (.exr). As discussed in the class, there are several ways for assembling a radiance map.
  • Paul Debevec's method. Please refer to Debevec's SIGGRAPH 1997 paper. HDRShop use this algorithm. The details of this algorithm has been discussed in class. The most difficult part probably is to solve the resulted over-determined linear system. You can use these packages, GSL, Boost, LAPACK, LAPACK++, ATLAS, or write your own solver. You can refer to Chapter 2 of Numerical Recipes if you want to write your own linear solver. If you want to test your program before taking pictures of your own, you can download test images from here or here (hdr here).

  • On the other hand, to avoid the trouble with camera's nonlinear mapping, you can recover a radiance map directly from CCD snapshots. To use this method, remember to have your camera save images in raw format during capturing. You can then use dcraw or libraw to convert raw images into 16-bit ppm images. Dcraw can decode raw formats for 248 cameras including most of Canon, Nikon and Kodak's. Since the recorded pixels are linear to irradiance, you can just recover the slope of the recorded pixel values under different exposures and use it as the irradiance value. Notice that, to recover colors, you have to perform demosaicking on the recovered radiance map.
3. Develop your radiance map using tone mapping. Finally, load your radiance map into HDRShop and use Reinhard's tone mapping algorithm to develop your radiance map into a usual image. This HDRShop plugin implements Reinhard's algorithm for HDRShop. Optionally, you are welcome to write other tone mapping algorithms, preferably in HDRShop plugin format. You can refer to this page to learn how to write a plugin for HDRShop. Implementing tone mapping will be counted as a bonus since it is not required.

Here are several other options for tone mapping: Photomatix (algorithm unknown), logview and tmo (24 algorithms implemented). The following two tone mapping programs are for Linux only: Fast Bilateral Filtering and PFStmo (seven algorithms implemented).

Bells and whistles

Students will get extra points if they implement any of the following extensions. Please note that bonus only apply after you have finished required part. For example, if you decide to implement another HDR reconstruction algorithm as bonus, you still need to finish the one mentioend above. In addition, the basic requirement for this project is pretty simple. It is strongly recommended that you implement at least one of these extensions.
  • Image alignment methods for HDR imaging. A good suggestion is Ward's MTB algorithm.
  • Other HDR creation methods such as Mitsunaga and Nayar's algorithm. Please refer to their CVPR 1999 paper, Radiometric Self Calibration. The main difference with Debevec's method is that this method assumes that the response curves are high-order polynomials. RASCAL uses this method. Another popular method is Robertson's method. It is more robust.
  • Tone mapping. Any tone mapping algorithms other than Reinhard's are counted as bonuses. Refer to the reading list for more tone mapping algorithms.
You are welcome to do any other extensions or develop algorithm related to high dynamic range images. The bonus depends on how useful and difficult these extensions are.


You have to turn in your complete source, the executable, the original pictures you have taken, a recovered HDR image, a tone-mapped image, instruction to run your program and a report in an html/pdf format (including all resources). The report could contain a description of this project, what you have learned from this project, description of the algorithm you implemented, implementation details, results (either good or bad), and what extensions you have implemented.

You also have to submit your favorite artifact generated by the program you have implemented (not the reference software). For the artifacts for this project, submit the tone-mapped image. All class participates will vote for the top three artifacts. The creators for these artifacts will get extra bonus points. Look at others' HDR images for inspiration.

Please submit your homework through this website. (use this link within cmlab domain) Log in the website using the password sent to your NTU account. If you have any questions, please contact your TA.

Reference software

  • Photomatix: a high-quality commercial program to create HDR images and tone mapping. It has a free version with basic operations.
  • HDRShop: a program to create, view and manipulate HDR images.
  • AHDRIA & AHDRIC: a program to automatically create HDR images including camera support.
  • RASCAL: a HDR creation program with image alignment capability.