Skip to content

This is a python project to implement HDR imaging process with jupyter notebook.

Notifications You must be signed in to change notification settings

qa276390/high-dynamic-range-imaging

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

High Dynamic Range Imaging

This is a python project from recovering the response curve to reconstruct the irradiance map(HDR) in the real scene.

Project Description

There are several steps(shown below) between the scene radiance and the image we see. Starting from taking few photographs in different exposures, we use Paul Debevec's method to recover the response curve by these photographs. After we got the response curve, we are now able to reconstuct the irradiance map also known as HDR images. Also, we developed a global tone mapping algorithm to see the combination of these photographs.

Algorithms

Recovering the Response Curve

The function of response curve is a general term for the many steps shown above. To recover from pixel values record on image to radiance map , we need a function g which is:

.

minimize the following:

  • is the unknown response function

  • is a linear weighting function. g will be less smooth and will fit the data more poorly near extremes (Z=0 or Z=255). Debevec introduces a weighting function to enphasize the smoothness fitting terms toward the middle of the curve.

  • is the exposure time in index

  • is the unknown radiance in different pixel

  • : is the observed value in pixel and exposure time

  • is the pixel location index, is the exposure index and P is the total number of exposures.

Reconstruct the Irradiance Map

And now we can reconstruct the irradiance map by the formula below.

After this step, we are able to have the output.hdr file.

Global Tone Mapping

In this part, we implemented a naive global tone mapping algorithm(shown below) to get a image which can match our visual experience.

and now we can have the result.

Usages

There are python file and ipython notebook for you to choose.

Prepare Images and Meta Data

Put your images in a single folder and prepare your meta data file. The meta file should contains filename and exposure time separated with spaces(see ./example/park3.csv). There are meta file creator in createMeta.ipynb if your images contains EXIF data.

Start

here is an example to run the code.

python3 computeHDR.py --img-dir ./example/park3/ --meta_path ./example/park3.csv

to see more parameters

python3 computeHDR.py --help

Results

Original image


Exposure 1/4 sec

Exposure 1 sec

Exposure 4 sec

Exposure 15 sec

HDR image

Acknowledgements

About

This is a python project to implement HDR imaging process with jupyter notebook.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published