This is a python project from recovering the response curve to reconstruct the irradiance map(HDR) in the real scene.
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.
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 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 pixel location index, is the exposure index and P is the total number of exposures.
And now we can reconstruct the irradiance map by the formula below.
After this step, we are able to have the output.hdr
file.
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.
There are python file and ipython notebook for you to choose.
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.
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
Exposure 1/4 sec |
Exposure 1 sec |
Exposure 4 sec |
Exposure 15 sec |
---|