forked from bpaez/FILMopenfv-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrefocus.cpp
44 lines (34 loc) · 1.18 KB
/
refocus.cpp
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
#include "openfv/refocusing.h"
#include "openfv/parse_settings.h"
using namespace cv;
using namespace std;
DEFINE_bool(live, false, "live refocusing");
DEFINE_bool(fhelp, false, "show config file options");
DEFINE_string(config_file, "", "config file path");
DEFINE_bool(dump_stack, false, "dump stack");
DEFINE_string(save_path, "", "stack save path");
DEFINE_double(zmin, -10, "zmin");
DEFINE_double(zmax, 10, "zmax");
DEFINE_double(dz, 0.1, "dz");
DEFINE_double(thresh, 0, "thresholding level");
DEFINE_int32(v, 0, "logging level");
int main(int argc, char** argv) {
google::ParseCommandLineFlags(&argc, &argv, true);
google::InitGoogleLogging(argv[0]);
FLAGS_logtostderr=1;
refocus_settings settings;
parse_refocus_settings(FLAGS_config_file, settings, FLAGS_fhelp);
saRefocus refocus(settings);
if (FLAGS_live) {
if (settings.use_gpu) {
// B: commenting this out bc it messes with non-cuda build
//refocus.GPUliveView();
} else {
refocus.CPUliveView();
}
}
if (FLAGS_dump_stack) {
refocus.dump_stack(FLAGS_save_path, FLAGS_zmin, FLAGS_zmax, FLAGS_dz, FLAGS_thresh, "tif");
}
return 1;
}