-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain_LFCS.m
executable file
·56 lines (52 loc) · 2.09 KB
/
main_LFCS.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
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% Color Stabilization for Lightfield data Algorithm
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
folder = strcat(pwd,'/../LFColorSample/take4_5/');
subdir = dir(folder);
saved_data = '/saved_data/cropped20/';
output = '/output/nocropped20/';
%% save outputs in a .mat file
if isempty(dir(strcat(pwd,saved_data)))
mkdir(pwd,saved_data);
end
save_file = strcat(pwd,saved_data);
%% save images as .exr files
if isempty(dir(strcat(pwd,output)))
mkdir(pwd,output);
end
save_im = strcat(pwd,output);
%% Set up parameters for the algorithm
options.save_file = []; % name of the folder to save results
options.save_im = []; % name of the folder to save images
options.exp0 = -1; % if exp0 < 0, the algorithm takes the middle exposure at the center
options.clipping = [15 240]; % min & max values for clipping e.g. [0 255]
options.factor = [1 sqrt(0.3)]; % first value is for final result, second value for computational purposes.
options.spread = 1; % enables spreading references, 0 single ref at the center
options.sift = 1;
options.dense = 0;
options.id_lut = [];%strcat(pwd,'/src/lut/id_lut.mat');
options.limit = 0.5; % limit after which the homography will be less applied (in linear color space)
startTime = tic;
lfcs_method( folder, options );
% prefixe = strcat(pwd,'/output/spreadvsnospread/0');
% for i=[0.2 0.4 0.6 1]
% options.factor(2) = sqrt(i);
% % spread
% options.spread = 1;
% % options.save_im = strcat(prefixe,num2str(10*i),'0/spread/');
% % if isempty(dir(options.save_im))
% % mkdir(options.save_im);
% % end
% lfcs_method( folder, options );
% % nospread
% options.spread = 0;
% % options.save_im = strcat(prefixe,num2str(10*i),'0/nospread/');
% % if isempty(dir(options.save_im))
% % mkdir(options.save_im);
% % end
% lfcs_method( strcat(folder, '/'), options );
% end
t = toc( startTime );
disp([' It took ' , num2str(t), ' s'])