-
Notifications
You must be signed in to change notification settings - Fork 140
/
installHDRToolbox.m
135 lines (120 loc) · 4.91 KB
/
installHDRToolbox.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
%
% HDR Toolbox Installer
%
% Copyright (C) 2011-2013 Francesco Banterle
%
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with this program. If not, see <http://www.gnu.org/licenses/>.
%
disp('Installing the HDR Toolbox...');
folder = cellstr('Alignment');
folder = [folder, cellstr('Analysis')];
folder = [folder, cellstr('Alignment/util')];
folder = [folder, cellstr('BatchFunctions')];
folder = [folder, cellstr('ColorCorrection')];
folder = [folder, cellstr('ColorSpace')];
folder = [folder, cellstr('Compression')];
folder = [folder, cellstr('Deghosting')];
folder = [folder, cellstr('Deghosting/util')];
folder = [folder, cellstr('EnvironmentMaps')];
folder = [folder, cellstr('EO')];
folder = [folder, cellstr('EO/util')];
folder = [folder, cellstr('Formats')];
folder = [folder, cellstr('Generation')];
folder = [folder, cellstr('Generation/util')];
folder = [folder, cellstr('Generation_video')];
folder = [folder, cellstr('Generation_video/util')];
folder = [folder, cellstr('IBL')];
folder = [folder, cellstr('IBL/util')];
folder = [folder, cellstr('IO')];
folder = [folder, cellstr('IO_stack')];
folder = [folder, cellstr('IO_video')];
folder = [folder, cellstr('LaplacianPyramids')];
folder = [folder, cellstr('Metrics')];
folder = [folder, cellstr('Metrics/util')];
folder = [folder, cellstr('NativeVisualization')];
folder = [folder, cellstr('Tmo')];
folder = [folder, cellstr('Tmo/util')];
folder = [folder, cellstr('Tmo_video')];
folder = [folder, cellstr('Tools')];
folder = [folder, cellstr('util')];
for i=1:length(folder)
addpath([pwd(), '/source_code/', char(folder(i))], '-begin');
end
addpath([pwd(), '/demos/'], '-begin');
addpath([pwd(), '/demos/ldr_v'], '-begin');
addpath([pwd(), '/demos/output'], '-begin');
addpath([pwd(), '/demos/stack'], '-begin');
addpath([pwd(), '/demos/stack_alignment'], '-begin');
addpath([pwd(), '/demos/stack_ghost'], '-begin');
savepath
clear('folder');
disp('done!');
disp(' ');
disp('Check demos in the folder ''demos'' for learning how to use the HDR Toolbox!');
disp(' ');
disp('If you use the toolbox in your research, please reference the book in your papers:');
disp('@book{Banterle:2017,');
disp(' author = {Banterle, Francesco and Artusi, Alessandro and Debattista, Kurt and Chalmers, Alan},');
disp(' title = {Advanced High Dynamic Range Imaging (2nd Edition)},');
disp(' year = {2017},');
disp(' month={July},');
disp(' isbn = {9781498706940},');
disp(' publisher = {AK Peters (CRC Press)},');
disp(' address = {Natick, MA, USA},');
disp(' }');
disp(' ');
disp('NOTE ON TONE MAPPING:');
disp('=====================');
disp('The majority of TMOs return tone mapped images with linear values. This means that gamma encoding');
disp('needs to be applied to the output of these TMOs before visualization or before writing tone mapped images');
disp(' on the disk; otherwise these images may appear dark.');
disp('A few operators (e.g. Mertens et al.''s operator) return gamma encoded values,');
disp('so there is no need to apply gamma to them; in this case a message (e.g. a Warning) is displayed');
disp('after tone mapping alerting that there is no need of gamma encoding.');
disp(' ');
disp('NOTE ON EXPANSION OPERATORS (INVERSE/REVERSE TONE MAPPING):');
disp('=====================');
disp('The majority of EOs require to have as input LDR images in the range [0,1] that are LINEARIZED.');
disp('This means that the camera response function (CRF) or the gamma encoding has been removed.');
disp('This operation is MANDATORY in order to generate fair comparisons; please do use the gammaRemoval');
disp('parameter to remove gamma if you do not have the CRF of the input image. RAW files do not require ');
disp('this step because they are already linear.');
str_cur = pwd();
try
cd([str_cur, '/source_code/IO/']);
mex('read_exr.cpp');
mex('write_exr.cpp');
catch err
disp('read_exr.cpp and write_exr.cpp were not compiled');
mex -setup cpp;
try
mex('read_exr.cpp');
mex('write_exr.cpp');
catch err
disp('read_exr.cpp and write_exr.cpp were not compiled');
end
end
try
cd([str_cur, '/source_code/util/']);
mex('bilateralFilterS.cpp');
catch err
disp('bilateralFilterS.cpp was not compiled');
mex -setup cpp;
try
mex('bilateralFilterS.cpp');
catch err
disp('bilateralFilterS.cpp was not compiled');
end
end
cd(str_cur);