File Exchange

image thumbnail

The HDR Toolbox

version 2.0.0.0 (34.4 MB) by Francesco Banterle
The HDR Toolbox is a toolbox for processing High Dynamic Range (HDR) content.

20 Downloads

Updated 03 May 2021

From GitHub

View license on GitHub

Editor's Note: This file was selected as MATLAB Central Pick of the Week

The HDR Toolbox provides functions for processing HDR images and videos for different tasks such as tone mapping, inverse tone mapping, reverse tone mapping, expansion, HDR compression, image-based lighting, handling HDR videos, color transforms, etc.
The HDR Toolbox is part of the book "Advanced High Dynamic Range Imaging", where you can find extra documentation about the code and more details on HDR imaging. Please visit the website of the book at the following URL:
http://www.advancedhdrbook.com/
Note that the GitHub repository of the HDR Toolbox can be found at the following URL:
https://github.com/banterle/HDR_Toolbox

HOW TO INSTALL:
1) Unzip the file HDRToolbox.zip in a FOLDER on your PC/MAC
2) Run Matlab
3) Set the FOLDER as the current directory
4) Write the command:
installHDRToolbox
in the Command Window, and wait for the installation process to end.

NOTE ON TONE MAPPING:
The majority of TMOs return tone-mapped images with linear values. This means that gamma encoding needs to be applied to the output of these TMOs before visualization or before writing tone mapped images on the disk; otherwise, these images may appear dark. A few operators (e.g. Mertens et al.'s operator) return gamma-encoded values, so there is no need to apply gamma to them; in this case, a message (e.g. a Warning) is displayed after tone mapping alerting that there is no need of gamma encoding.

NOTE ON EXPANSION OPERATORS (INVERSE/REVERSE TONE MAPPING):
The majority of EOs require having as input LDR images in the range [0,1] that are LINEARIZED. This means that the camera response function (CRF) or the gamma encoding has been removed. This operation is MANDATORY in order to generate fair comparisons; please do use the gammaRemoval parameter to remove gamma if you do not have the CRF of the input image. RAW files do not require this step because they are already linear.

REFERENCE:
Please reference the book in your work or papers if you use this toolbox:
@book{Banterle:2017,
author = {Banterle, Francesco and Artusi, Alessandro and Debattista, Kurt and Chalmers, Alan},
title = {Advanced High Dynamic Range Imaging (2nd Edition)},
year = {2017},
month={July},
isbn = {9781498706940},
publisher = {AK Peters (CRC Press)},
address = {Natick, MA, USA},
}

Cite As

Francesco Banterle (2021). The HDR Toolbox (https://github.com/banterle/HDR_Toolbox), GitHub. Retrieved .

Comments and Ratings (8)

Francesco Banterle

Sorry, the correct email is this one:
support@advancedhdrbook.com

Please, resend everything there.

anand swamy a s

Hi Francesco Banterle,
Please let me know the whether the below code lines are correct

Hi Francesco,
Thanks for you reply.
I have installed hdr toolbox.
Mail to support@advancedhdr.com bounced back.

Can i write below codelines to access the stack folder containing LDR jpeg images.

name_folder = 'stack'; %Insert your raw stack folder
format = 'jpg'; %Insert your raw image format

If not please let me know how to access the folder wth ldr images.

Jack

Hi Francesco, thanks for this toolbox. I noticed that in Kim&Kautz's paper they use base 10 log, while your implementation of it uses Matlab's log function, which is the natural logarithm. Any reason for the change?
Cheers!

Francesco Banterle

It's quite difficult to answer you here; please send an email to support@advancedhdr.com

Note1: did you run the installHDRToolbox.m before running demo_build_hdr?
Note2: in the email specify the version of MATLAB that you have and send a screenshot
of the workspace after running the script.

anand swamy a s

Hi Francesco Banterle,
Thanks for the reply.
Still after using new hdr tool box, i am getting the same error

>> demo_build_hdr
1) Read a stack of LDR images
2) Read exposure values from the exif
3) Estimate the Camera Response Function (CRF)
Error using DebevecCRF (line 57)
DebevecCRF: a stack cannot be empty!

Error in demo_build_hdr (line 28)
[lin_fun, ~] = DebevecCRF(stack, stack_exposure, 256);

while using ReadLDRStack, in place of name_folder , i tried both the name of the folder i.e 'stack' as well as the path of the stack folder.

Please do the needful.

Francesco Banterle

Dear Anand Swamy a s,
demo_build.m is a very old demo that no longer exists. Please check the master/develop branch from github with new demos:
https://github.com/banterle/HDR_Toolbox

anand swamy a s

Hi,
I am getting the following error, whenever i run the demo_build.m file. Please do the needful.

Error using DebevecCRF (line 56)
DebevecCRF: a stack cannot be empty!

Error in demo_build_hdr (line 29)
[lin_fun, ~] = DebevecCRF(stack, stack_exposure)

Sebastian Gross

MATLAB Release Compatibility
Created with R2012b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

demos

source_code/Alignment

source_code/Alignment/util

source_code/Analysis

source_code/BatchFunctions

source_code/ColorCorrection

source_code/ColorSpace

source_code/Compression

source_code/Deghosting

source_code/Deghosting/util

source_code/EO

source_code/EO/util

source_code/EnvironmentMaps

source_code/Formats

source_code/Generation

source_code/Generation/util

source_code/Generation_video

source_code/Generation_video/util

source_code/IBL

source_code/IBL/util

source_code/IO

source_code/IO_stack

source_code/IO_video

source_code/LaplacianPyramids

source_code/Metrics

source_code/Metrics/util

source_code/NativeVisualization

source_code/Tmo

source_code/Tmo/util

source_code/Tmo_video

source_code/Tools

source_code/util