CS766 Project1-High Dynamic Range Image Report
Mengmeng Chen (mchen), Yi Pan (yipan), Charles Xie (cxie)
For our group, Yi implemented HDR, Mengmeng implemented Ward's MTB alignment alogrithm, and Chao implemented Drago's tonemapping algorithm. We took pictures, read the papers and discussed the algorithms all together.
GOALS
The project attempts to construct the High Dynamic Range (HDR) Image from the photograghs, which are taken using digital camera canon G6 with a series of different shutter speeds. In addition, the produced HDR image is tone-mapped using xxxxx. In addition, Greg Ward's MTB algorithm is implemented to align two misaligned images.
HOW TO RUN OUR PROGRAMS
- Use gil library to read in a set of photos and read in configuration file, including the exposure for each photo.
- Pick certain number of pixels from a set of photos. Those pixels are ensured to have wide range of pixel values on the photo set as to make recovered response curve more accurate.
- Use CLAPACK library to perform Singular Value Decomposition (SVD) on a group of over-determined equations, find the least-square solution and then get the recovered response curve. (Using dgelss function)
- Output the high dynamic range radiance maps (.hdr file) with recovered response curve.
>HDR.exe c:\temp\photo_
The output result is stored as working_directory/result.hdr
The executable runs as a self-testing program. It takes two images(A.jpg, B.jpg) of different exposure levels as inputs. Given the two image are aligned by nature, the program first shift the second image by some arbitrary number(i.e. (30,30)) and then combines them together and writes the result into a image named 'combined.jpg'. Then the program pauses and wait for any input from keypboard. After any key is input, the program will go ahead to try to align B.jpg to A.jpg and overwrite 'combined.jpg' with the result.
D:\workspace\HDR>HDR.exeCOMPONENTS & IMPLEMENTATION DETAILSS
Describe what you have done here and what algorithm is used
We implemented the tone mapping algorithm in paper "Adaptive Logarithmic Mapping for Displaying High Contrast Scenes" presented by F. Drago et al at Eurographics 2003. We developed the program in C++ with Microsoft Visual Studio 2005 under Window XP environment, using the Linux C implementation provided by the authors as a reference. We also compiled and tested our program under Linux environment using Eclipse. It worked pretty well too.
The source code package of our implementation ALToneMap.rar can be found in the /tonemapping directory under our submission. It includes three files, namely ALToneMap.h, ALToneMap.cpp, ToneMapMain.cpp. The header file ALToneMap.h provides the definition of all the constants, variables, and classes used in our program. File ALToneMap.cpp provides the detailed implementation of the classes and its methods. ToneMapMain.cpp is the main entry, which provides the main() function and invokes the whole program.
The usage of the program: ALToneMap.exe inputfilename.hdr outputfilename.hdr
We applied our tone mapping program on the picture as follows: ALToneMap.exe result.hdr result_ALToneMap.hdr Begin tone mapping: Maximum Luminance: 12144.118568 Minimum Luminance: 0.305600 Dynamic Range = 39738.660393 Tone mapping finished successfully! Tone mapping execution time = 1.234 sec Total execution time = 5.078 sec
We compared the results with results using the detail enhancer method in Photomatix as below. As we can see, quality of our resulting image is inferior to that of the Photematix result. That may be because that we used default values for all the parameters in Drago´s algorithm. Fine tuning the parameters may result in better results.
|
||
|
We use Ward's MTB alogrithm to ajust the alignment of two similar photographs. We use the following formula to convert the colored (3 channels) photos to grayscale (1 channels) photos:
grey = (54*red + 183*green + 19*blue) / 256
When converting the grayscale images to the median threshold bitmaps, we manually select the threshold percentile for images of different exposure level. For median exposure level, we use 50% as the threshold to conduct the bitmap conversion. For lower or higher exposure, use 13% or 87% as the threshold. We shrunk down each image 6 times which allows us to shift the image within -64 and +64 pixels vertically and horizontally. To simplify the illustration, we use two grayscale images as targets for alignment. The left-hand picture is a combined picture, whose pixel values are generated by 1/2*(image1's pixel values +image2's pixel values). It's clear that the two images are not aligned. Then we applied our program to align these two images by using the first image as a reference. The result is shown in the right-hand image. We can clearly see that the two images are aligned now.
HDR RESULTS
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
The tone-mapped picture of photo1:
PHOTO SETS
We took 5 photo sets, which are stored in directory c:\t1, c:\t2...C:\t5 respectively. I use 11 photos for each photo set. Besides photos, each directory contains a filename called "shutter.txt". It contains exposure time for each photo.
01: Exposure length: 0.00050 Relative Stops: 0.00
02: Exposure length: 0.00200 Relative Stops: 1.00
03: Exposure length: 0.00400 Relative Stops: 1.00
04: Exposure length: 0.00800 Relative Stops: 1.00
05: Exposure length: 0.01667 Relative Stops: 1.06
06: Exposure length: 0.03333 Relative Stops: 1.00
07: Exposure length: 0.06667 Relative Stops: 1.00
08: Exposure length: 0.12500 Relative Stops: 0.91
09: Exposure length: 0.25000 Relative Stops: 1.00
10: Exposure length: 0.50000 Relative Stops: 1.00
11: Exposure length: 1.00000 Relative Stops: 1.00
Total shutter time: 2.0062 sec.
Total acquisition time: 197.9220 sec.
Time efficiency: 1.01%
TimeStamp=20080918121548
FAVORITE ARTIFACT
Here is our favorite artifact! here