-
Notifications
You must be signed in to change notification settings - Fork 0
/
experiment2_ds.cpp
81 lines (60 loc) · 2.94 KB
/
experiment2_ds.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
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
#include "./include/tools.hpp"
#include <ctime>
// RUN FROM THE BUILD FOLDER
int main(int argc, char **argv)
{
time_t timetoday;
time(&timetoday);
std::cout << "experiment2_ds initiated on : " << asctime(localtime(&timetoday)) << std::endl;
// Input by the user
/* if (argc < 2)
{
throw std::runtime_error("Required arguments: folder_name file_name");
}
std::string folderName = argv[1];
std::string parametersFileName = argv[2];
std::string fullParametersFilename = folderName + parametersFileName; // including path
*/
if (argc < 1)
{
throw std::runtime_error("Required arguments: number of iterations");
}
std::string charNumberIter = argv[1];
int numberIter = std::stoi(charNumberIter);
std::string fullParametersFilename = "../data/params_simple_setup_ds_all.txt"; // including path
std::string paramFilenameSift = "../data/params_simple_setup_ds_sift.txt";
std::string paramFilenameHarris = "../data/params_simple_setup_ds_harris.txt";
std::string savedFilename = appendTimestamp("../results/param_search_ds_results");
// define maps that can be filled with algorithm-specific settings (e.g. for SAC-IA)
Settings pipelineSettings = getPipelineDefaultSettings();
// set up all required settings
pipelineSettings.setValue(SACIA_NUM_SAMPLES, 50.0f);
pipelineSettings.setValue(SACIA_MIN_SAMPLE_DIST, 1.5f);
pipelineSettings.setValue(VISUALIZER_PARAMETER, 2.0f);
double seedRef(0.1), seedSource(0.2), seedCustomRotation(0.3);
double inc = 0.37;
/*
for (size_t i = 1; i <= numberIter; i++)
{
//seedRef += inc, seedSource += inc, seedCustomRotation += inc;
// for assessing stability of pose estimation, use same seed for several iterations and observe if pose estimation is stable
seedRef = 0.19, seedSource = 0.344, seedCustomRotation = .7668;
fullRegistration(fullParametersFilename, pipelineSettings, savedFilename, &seedRef, &seedSource, &seedCustomRotation);
}
for (size_t i = 1; i <= numberIter; i++)
{
//seedRef += inc, seedSource += inc, seedCustomRotation += inc;
// for assessing stability of pose estimation, use same seed for several iterations and observe if pose estimation is stable
seedRef = 0.19, seedSource = 0.344, seedCustomRotation = .7668;
fullRegistration(paramFilenameSift, pipelineSettings, savedFilename, &seedRef, &seedSource, &seedCustomRotation);
}
*/
for (size_t i = 1; i <= numberIter; i++)
{
//seedRef += inc, seedSource += inc, seedCustomRotation += inc;
// for assessing stability of pose estimation, use same seed for several iterations and observe if pose estimation is stable
seedRef = 0.19, seedSource = 0.344, seedCustomRotation = .7668;
fullRegistration(paramFilenameHarris, pipelineSettings, savedFilename, &seedRef, &seedSource, &seedCustomRotation);
}
return 0;
}