Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
banterle committed Jul 12, 2017
0 parents commit 835314f
Show file tree
Hide file tree
Showing 432 changed files with 42,742 additions and 0 deletions.
65 changes: 65 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
HDR Toolbox
===========

HDR Toolbox is a MATLAB/Octave toolbox for processing High Dynamic Range (HDR) content.

Author: Francesco Banterle

License: This software is distributed under GPL v3 license (see license.txt)

Year: Fall 2010-2016

Title: HDR Toolbox for Matlab

Version: 1.1.0

Contact:
========
e-mail: support@advancedhdrbook.com

facebook: https://www.facebook.com/pages/Advanced-High-Dynamic-Range-Imaging-Book/166905003358276


HOW TO INSTALL:
===============
1) Unzip the file HDRToolbox.zip in a FOLDER on your PC/MAC

2) Run Matlab

3) Set the FOLDER as 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 PULL REQUESTS:
=====================
Please, send your pull requests to the develop branch.

REFERENCE:
==========
Please reference the book in your work or papers if you use this toolbox:

@book{Banterle:2011,

author = {Banterle, Francesco and Artusi, Alessandro and Debattista, Kurt and Chalmers, Alan},

title = {Advanced High Dynamic Range Imaging: Theory and Practice},

year = {2011},

isbn = {9781568817194},

publisher = {AK Peters (CRC Press)},

address = {Natick, MA, USA},

}
152 changes: 152 additions & 0 deletions Readme.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
== Author: Francesco Banterle


== Contact e-mail: support@advancedhdrbook.com


== License: This software is distributed under GPL v3 license (see license.txt)


== Year: Fall 2010-2015


== Title: HDR Toolbox for Matlab


== Version: 1.1.0


== How To Install:
1) Unzip the file HDRToolbox.zip in a FOLDER on your PC/MAC;
2) Run Matlab
3) Set the FOLDER as current directory
4) Run the command: installHDRToolbox
and wait for the installation process.


== Reference:
Please reference the book in your work or papers if you this toolbox:

@book{Banterle:2011,
author = {Banterle, Francesco and Artusi, Alessandro and Debattista, Kurt and Chalmers, Alan},
title = {Advanced High Dynamic Range Imaging: Theory and Practice},
year = {2011},
isbn = {9781568817194},
publisher = {AK Peters (CRC Press)},
address = {Natick, MA, USA},
}


== 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.


== How to Use the Toolbox:
Run the demos to understand how to use I/O function, visualize images, tone Map Images, etc.


==Update Report
07/01/2016: -Improved the toolbox, especially BuildHDR
17/02/2015: -Added iCAM06 (KuangTMO), added Mitsunaga and Nayar method for recovering inverse CRF, added RAW support through DCRAW, bug fixes, and more...
16/07/2014: -Fixed some reported bugs for single input and FattalTMO, thanks to Areias Figueiras Edite and Bin Hu
29/04/2014: -Added a novel framework for HDR video compression and three compression schemes
19/12/2013: -Many fixes including: ReinhardTMO, DragoTMO, RGBE2Float and many more...
31/10/2013: -Added different fusion operator/tone mapping operator, improved demos, enhanced the toolbox.

03/10/2013: -Added input/output for HDR videos: these videos need to be encoded as folders with a sequence of HDR files.
-Integrated HDRJPEG 2000 into hdrimwrite and hdrimread.

16/09/2013: -Added Grossberg and Nayar sampling through histograms.

05/09/2013: -Added the TMQI Index by H. Yeganeh, Z. Wang. Based on the publication:
"Objective Quality Assessment of Tone Mapped Images", Journal of IEEE Transaction on Image Processing, 22 (2), 657-667, 2013
We thank Hojat Yeganeh for integrating his functions into the Toolbox. Original code can be downloaded at:
https://ece.uwaterloo.ca/~z70wang/research/tmqi/

04/09/2013: -Added SIFT LDR images stack alignment based on the VL Feat Library (http://www.vlfeat.org/)
The library needs to be installed to use this code.

02/09/2013: -Added a Hybrid TMO, BanterleTMO.m, based on ACM SAP 2012 Publications:
Francesco Banterle, Alessandro Artusi, Elena Sikudova, Thomas Edward William Bashford-Rogers,
Patrick Ledda, Marina Bloj, Alan Chalmers. ACM Symposium on Applied Perception (SAP) - August 2012

16/07/2013: -Fixed an error in GenerateExposureBracketing.m. Thanks to Cheng-Yu Wu.

24/04/2013: -Fixed BuildHDR.m and aux files. Thanks to Luis Paulo Dos Santos.
-Added Alignment folder for aligning LDR images, and added demo_build_radiance_map.m

18/04/2013: -Fixed read_rgbe new line in the header. Thanks to Ronan Boitard.

12/02/2013: -Fixed TpFerwerda and TsFerwerda functions. Thanks to Miguel Melo.

23/10/2012: -Added ExposureHistogramCovering.m for sampling exposures with the histogram
using a greedy approach.

18/10/2012: -Added Boschetti et al. 2011 ICIP paper on HDR compression

12/10/2012: -Added Raman and Chaudhuri Eurographics 2009 Short paper on tone mapping (exposure fusion), see RamanTMO.m
-Added a new demo for performing exposure fusion on stack
demo_fusion_from_stack.m (this demo applies RamanTMO.m and Mertens.m)
-Fixed the interface for MertensTMO.m, now directories can be inserted as input

09/10/2012: -Removed a bug when reading uncompressed .hdr/.pic files.

29/08/2012: -Fixed the EXPOSURE's semantic when opening .hdr/.pic files. Thanks to Matthieu Perreira Da Silva

06/07/2012: -Partial rewritten of the ChangeMapping.m function and its auxiliary functions
-Fixed BanterleExpandMap.m to be closer to reference. Fixed a bug in the samples
clamping, and added a Density Estimation through image splatting (see imSplat.m function).
Note that this version is not suitable for videos but only for still images.
-Added a batch function for converting HDR images into LDR images using tone mapping
-Fixed an issue in Create1DDistribution.m. Thanks to Joel Kronander.

18/06/2012: -Fixed a bug in float2LogLuv.m. Thanks to Vassilios Solachidis

14/06/2012: -Added FalseColor.m function for the visualization of HDR images in false colors
-Added imSameHeight.m utility function for adjusting the height
of an image to match the height of a target one

12/06/2012: -Improved TumblinRushmeierTMO.m, added maximum display Luminance parameter
-Added clamping to MertensTMO.m

07/06/2012: -Fixed a minor bug in GenerateExposureBracketing.m
-Made BuildHDR.m and CombineLDR.m functions more flexible and general,
allowing stack to be used as input

28/01/2012: -Fixed a bug in the WardGlobalTMO. Thanks to kirkt from the hdrlabs.com forum.
-CompoCon was made Octave compliant (explicit cast to logical values).

27/01/2012: -Removed some case sensitive problems for Octave. Thanks to kirkt from hdrlabs.com forum.

25/01/2012: -Improved read_rgbe.m function; now RLE compressed streams can be opened.
-Minor improvements in write_rgbe.m function (RLE compression still missing).

17/12/2011: -Fixed PoissonSolver, it now works not only for squared images

-Added a first attempt to retinex
18/11/2011: -Fixed some bugs in the LogLuv encoding and added the Adaptive LogLuv encoding

25/10/2011: -Demo images are compressed into RGBE format to reduce download time.

11/10/2011: -Added ReinhardBilTMO.m
-Renamed the main util folder due to compability with Linux. Thanks to Shanmuga Raman.

11/09/2011: -Fixed a bug in the MeylanEO.m file

08/03/2011: -Fixed some problems in ExponentialTMO.m. Thanks to Alessandro Artusi.


== Known issues: -In ChangeMapping.m the Spherical mapping is not yet supported for output.


== Other: - Read license.txt
- bilateralFilter.m is an implementation by Jiawen Chen under MIT License.
- BanterleExpandMap.m is an implementation of Banterle et al. 2008 (SCCG 2008) for
images only not videos. It is not an implementation of Banterle et al. 2006 (Graphite) or
Banterle et al. 2007 (The Visual Computer). If you are not sure about parameters to
be used please contact the author of the HDR Toolbox at any time.
8 changes: 8 additions & 0 deletions citation.bib
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@book{Banterle:2011,
author = {Banterle, Francesco and Artusi, Alessandro and Debattista, Kurt and Chalmers, Alan},
title = {{Advanced High Dynamic Range Imaging: Theory and Practice}},
year = {2011},
isbn = {9781568817194},
publisher = {AK Peters (CRC Press)},
address = {Natick, MA, USA},
}
6,218 changes: 6,218 additions & 0 deletions demos/Bottles_Small.hdr

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions demos/CS_Warwick.hdr

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions demos/Copyright.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Images Copyright � 2008-2013 Francesco Banterle:
- Bottles_Small.pfm
- Oxford_Church.pfm
- Venice01.png
- stack/venice_canal_exp_0.jpg
- stack/venice_canal_exp_1.jpg
- stack/venice_canal_exp_2.jpg
- stack_alignment/IMG_4209.jpg
- stack_alignment/IMG_4210.jpg
- stack_alignment/IMG_4211.jpg
- CS_Warwick.pfm (captured using Spheron camera by WMG, Warwick, UK)

If you would like to use these images in publications, demos, or for other
purposes please contact Francesco Banterle at support@advancedhdrbook.com
639 changes: 639 additions & 0 deletions demos/Oxford_Church.hdr

Large diffs are not rendered by default.

Binary file added demos/Venice01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 40 additions & 0 deletions demos/demo_build_hdr.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
%
% This HDR Toolbox demo creates an HDR radiance map:
% 1) Read a stack of LDR images
% 2) Read exposure values from the EXIF
% 3) Estimate the Camera Response Function (CRF)
% 4) Build the radiance map using the stack and stack_exposure
% 5) Save the radiance map in .hdr format
% 6) Show the tone mapped version of the radiance map
%
% Author: Francesco Banterle
% Copyright 2015 (c)
%

clear all;

name_folder = 'stack';
format = 'jpg';

disp('1) Read a stack of LDR images');
[stack, norm_value] = ReadLDRStack(name_folder, format, 1);

disp('2) Read exposure values from the exif');
stack_exposure = ReadLDRStackInfo(name_folder, format);

disp('3) Estimate the Camera Response Function (CRF)');
[lin_fun, ~] = DebevecCRF(stack, stack_exposure);
h = figure(1);
set(h, 'Name', 'The Camera Response Function (CRF)');
plot(0:255, lin_fun(:,1), 'r', 0:255, lin_fun(:,2),'g', 0:255, lin_fun(:,3), 'b');

disp('4) Build the radiance map using the stack and stack_exposure');
imgHDR = BuildHDR(stack, stack_exposure, 'LUT', lin_fun, 'Deb97', 'log');

disp('5) Save the radiance map in the .hdr format');
hdrimwrite(imgHDR, 'stack_hdr_image.exr');

disp('6) Show the tone mapped version of the radiance map with gamma encoding');
h = figure(2);
set(h, 'Name', 'Tone mapped version of the built HDR image');
GammaTMO(ReinhardTMO(imgHDR, 0.18), 2.2, 0, 1);
46 changes: 46 additions & 0 deletions demos/demo_build_hdr_sift_alignment.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
%
% HDR Toolbox demo build radiance map:
% 1) Read a stack of LDR images
% 2) Read exposure values from the EXIF
% 3) Estimate the Camera Response Function (CRF)
% 4) Align image using VLFeat''s SIFT
% 5) Build the radiance map using the stack and stack_exposure
% 6) Save the radiance map in .hdr format
% 7) Show the tone mapped version of the radiance map
%
% Author: Francesco Banterle
% Copyright 2013-15 (c)
%

clear all;

name_folder = 'stack_alignment';
format = 'jpg';

disp('1) Read a stack of LDR images');
[stack, norm_value] = ReadLDRStack(name_folder, format, 1);

disp('2) Read exposure values from the EXIF');
stack_exposure = ReadLDRStackInfo(name_folder, format);

disp('3) Align the stack using VLFeat''s SIFT');
stackOut = SiftAlignment(stack, 1);

disp('4) Estimage the CRF');
[lin_fun, ~] = DebevecCRF(stackOut, stack_exposure);
h = figure(1);
set(h, 'Name', 'The Camera Response Function (CRF)');
plot(0:255, lin_fun(:,1), 'r', 0:255, lin_fun(:,2),'g', 0:255, lin_fun(:,3), 'b');

disp('5) Build the radiance map using the stack and stack_exposure');
imgHDR = BuildHDR(stackOut, stack_exposure, 'LUT', lin_fun, 'Deb97', 'log');

disp('6) Save the radiance map in the .hdr format');
hdrimwrite(imgHDR, 'hdr_image_sift_alignment.hdr');

disp('7) Show the tone mapped version of the radiance map');
h = figure(2);
set(h, 'Name', 'Tone mapped version of the built HDR image');
GammaTMO(ReinhardTMO(imgHDR), 2.2, 0, 1);

disp('Note that the image needs to be cropped due to alignment');
46 changes: 46 additions & 0 deletions demos/demo_build_hdr_ward_alignment.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
%
% HDR Toolbox demo build radiance map:
% 1) Read a stack of LDR images
% 2) Align the stack
% 3) Read exposure values from the exif
% 4) Estimate the Camera Response Function (CRF)
% 5) Build the radiance map using the stack and stack_exposure
% 6) Save the radiance map in .hdr format
% 7) Show the tone mapped version of the radiance map
%
% Author: Francesco Banterle
% Copyright 2013-15 (c)
%

clear all;

name_folder = 'stack_alignment';
format = 'jpg';

disp('1) Read a stack of LDR images');
[stack, norm_value] = ReadLDRStack(name_folder, format, 1);

disp('2) Align the stack');
stackOut = WardAlignment(stack, 1);

disp('3) Read exposure values from the exif');
stack_exposure = ReadLDRStackInfo(name_folder, format);

disp('4) Estimate the Camera Response Function (CRF)');
[lin_fun, ~] = DebevecCRF(stackOut, stack_exposure);
h = figure(1);
set(h, 'Name', 'The Camera Response Function (CRF)');
plot(0:255, lin_fun(:,1), 'r', 0:255, lin_fun(:,2),'g', 0:255, lin_fun(:,3), 'b');

disp('5) Build the radiance map using the stack and stack_exposure');
[imgHDR, lin_fun] = BuildHDR(stackOut, stack_exposure, 'LUT', lin_fun, 'Deb97', 'log', 0);

disp('6) Save the radiance map in the .hdr format');
hdrimwrite(imgHDR, 'hdr_image_ward_alignment.hdr');

disp('7) Show the tone mapped version of the radiance map');
h = figure(2);
set(h, 'Name', 'Tone mapped built HDR Image from stack_alignment');
GammaTMO(ReinhardTMO(imgHDR), 2.2, 0, 1);

disp('Note that the image needs to be cropped due to alignment');
Loading

0 comments on commit 835314f

Please sign in to comment.