-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathrunBatch.m
80 lines (63 loc) · 1.91 KB
/
runBatch.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
% Demo of the edge guided single depth image super resolution + evaluation
% (batched version)
% (c)2016 Jun Xie
clc;clear;close all;
warning off;
addpath('mainCode/');
addpath('funcs/');
names{1}='cones';
names{2}='teddy';
names{3}='tsukuba';
names{4}='venus';
names{5}='11_250';
names{6}='scan042_cave_statue_smNN';
names{7}='scan030_cave_statue_smNN';
names{8}='scan021_cave_statue_smNN';
global window sigma_d;
window = 7;
sigma_d = 0.5;
w1 = 3;
w2 = 1;
localSize = 1;
scale = 4;
threshold = [0.08, 0.1, 0.1, 0.1 0.05, 0.06, 0.06, 0.06];
para.window = window;
para.sigma_d = sigma_d;
para.w1 = w1;
para.w2 = w2;
para.localSize = localSize;
para.scale = scale;
% flags:
print2File = 0;
% ---------- Enable self-similarity --------------%
self_similarity = 0;
% ------------------------------------------------%
% ---------- Enable visualize results ------------%
show = 0;
% ------------------------------------------------%
% run the code for each image
for i = 1:numel(names)
% The scale fact is fixed (please refer to the Middlebury Dataset)
scaleFact = 1;
if (i == 1 || i == 2)
scaleFact = 4;
elseif (i == 3)
scaleFact = 16;
elseif (i == 4)
scaleFact = 8;
end
para.threshold = threshold(i);
inputFile = names{i};
disp('===============================');
fprintf('runnning image %s X %d \n', names{i}, scale);
disp('===============================');
[highres{i}, edges{i}] = mrfLearning(names, i, w1, w2, localSize, ...
scale, threshold(i), self_similarity, show);
border = 2*window;
if ~strcmp(names{i}, '11_250')
runEvaluation(inputFile, scale, highres{i}, scaleFact, border, print2File);
end
highRes = highres{i};
highEdges = edges{i};
save(sprintf('outputs/%s', inputFile), 'highRes', 'highEdges', 'para');
end