-
Notifications
You must be signed in to change notification settings - Fork 16
/
parse_cfg.m
48 lines (39 loc) · 1.37 KB
/
parse_cfg.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
function [solver_cfg, sampler_cfg, ransac_cfg, opt_cfg] = parse_cfg(varargin)
% Default configurations
cfg = struct();
cfg.sample_size = 14;
cfg.solver_complexity = 2;
cfg.target_model = 'kb';
cfg.target_complexity = 4;
cfg.min_trial_count = 20;
cfg.max_trial_count = 50;
cfg.max_num_retries = 50;
cfg.confidence = 0.995;
cfg.display = true;
cfg.display_freq = 1;
cfg.irT = 0;
cfg.reprojT = 1.5;
cfg.max_iter = 50;
[cfg, ~] = cmp_argparse(cfg, varargin{:});
% Configurations of the solver
solver_cfg = {'sample_size', cfg.sample_size,...
'solver_complexity', cfg.solver_complexity,...
'target_model', cfg.target_model,...
'target_complexity', cfg.target_complexity,...
};
% Configurations of the sampler
sampler_cfg = {'min_trial_count', cfg.min_trial_count,...
'max_trial_count', cfg.max_trial_count,...
'max_num_retries', cfg.max_num_retries,...
'confidence', cfg.confidence,...
};
% Configurations of RANSAC
ransac_cfg = {'display', cfg.display,...
'display_freq', cfg.display_freq,...
'irT', cfg.irT,...
};
% Configurations of the refinement
opt_cfg = {'reprojT', cfg.reprojT,...
'max_iter', cfg.max_iter,...
};
end