Project 1: High Dynamic Range Imaging
Computer Vision – CS766 – Fall 2008

Christopher Hopman

 

Outline

Introduction
Approach
Results
References

 

Introduction

Several algorithms were implemented for this project:

1. Recovering the high dynamic range (HDR) radiance maps from digital photographs
2. Using the HDR radiance maps to create high dynamic range images

Two references were key to this project. The technique outlined in Reference [1] was used 1 above, and Reference [2] was used for 2.

 

Approach

Image Capture

Images were captured with a Canon Powershot SX100 IS mounted on a small mini-tripod. Camera settings were controlled remotely via Canon's RemoteCapture DC software. Using this method there was no need to align images prior to processing.

 

HDR

Debevec's HDR technique was implemented in c++. The program will open first the file hdr.txt in the same directory. This file should contain a single line, the filename of the actual config file.

  • this file is a text file in the following format
    #config options
    config1
    config2
    ...
    #image files
    imagefile1
    imagefile2
    ...
    *
    sample positions
    #sample positions
    sx_1 sy_1
    sx_2 sy_2
    ...
    ^
    response curves
    #entries for red curve
    rc_r_1
    rc_r_2
    ...
    #entries for green curve
    rc_g_1
    rc_g_2
    ...
    #entries for blue curve
    rc_b_1
    rc_b_2
    eof
    Everything after the image filenames is optional, if provided it will be used otherwise it will calculate new values.

    Most status is sent to stdout, some debugging info may be sent to log.txt. An hdr image is written to hdr_image.hdr, and a tonemapped image is written to ashikh.jpg.
  •  The program, if not given sample positions or response curve data will first read in the images provided in the list. Then it will pick sample positions by the following method

    1. assign values to each pixel approximately equal to the color change of the pixel over the images divided by the gradients at that pixel
    2. pick the position with greatest value and add to sample position list
    3. decay neighbor positions (200x200 square) by a value inversely proportional to distance from chosen pixel
    4. decay neighbor positions (600x600 square) by a value inversely proportional to color difference from chosen pixel
    5. if we have enough samples: stop. else goto 2.

    Using these sample positions the program applies Debevec's method. This hdr image is saved as hdr_image.hdr.

    The program will then also take this image and apply Ashikhmin's tone-mapping algorithm and resulting image is saved as ashikh.jpg

    Results

    HDR and tone-mapping

    The HDR results obtained were good, as is seen in the comparison of the tone-mapped images with the non-processed images below. The images are taken from an unlit indoor area of a bright outdoor opening. Both Reinhard and Ashikhmin tone-mapping algorithms produce better results than a simple linear scaling, but Ashikhmin's algorithm produces more visually appealing images.
    This first image is made with 9 images with exposure time ranging from 1/8 to 1/1600

    shutter speed = 1/1600 s
    shutter speed = 1/500 s
    shutter speed = 1/80 s
    shutter speed = 1/15 s
    linearly compressed to display range
    tone mapped hdr image--Reinhard algorithm
    tone mapped hdr image--Ashikhmin algorithm

     

    This image was done with 14 images with exposure times ranging from 1/4 to 1/1600

    shutter speed = 1/1600 s
    shutter speed = 1/500 s
    shutter speed = 1/100 s
    shutter speed = 1/10 s
    tone mapped hdr image--Reinhard algorithm
    tone mapped hdr image--Ashikhmin algorithm

    The recovered response curves are shown below. These were with lambda - the smoothness weighting - equal to 100.

     

    Files submitted

    P1 - HDR (directory)

    debevec.cpp

    The meat of the code. Contains the code to select sample points and to apply the debevec algorithm.

    ashikhmin.cpp

    the code to apply the ashikhmin tone-mapping algorithm.

    log.cpp / myfilters.cpp

    just a little basic code moved out of the main file. logging and gaussian/other filters.

    other stuff

    other stuff in here is mostly just vc++ stuff or libs/dlls/include stuff

    tunnel / lakelab (directories)

    Sets of source images and the resulting tonemapped images. tonemapped images are lakelab-reinhard.jpg, lakelab-ashikhmin.jpg, etc.

    Release (directory)

    A compiled version, done w/ vs2008 on windows vista 64. Can you compile it with something else? I don't know, good luck. Also has hdr.txt, tunnel.txt, and lakelab.txt for image file information

    include/ and libs/ (directories)

    Contain the gil library, used for reading and writing images, including images in the .hdr format.

    images (directory)

    just contains the image plot above and my favorite image

    cjhopman-hdr.html

    This file.

    other stuff

    vc++ stuff and other less important stuff.

     

    References

    [1] Debevec, Paul E. and Jitendra Malik. "Recovering High Dynamic Range Radiance Maps from Photographs", SIGGRAPH 1997

    [2] Ashikhmin, Michael. "A Tone Mapping Algorithm for High Contrast Images", EGWR 2002.