-
Notifications
You must be signed in to change notification settings - Fork 0
/
experiment2.cpp
109 lines (88 loc) · 4.83 KB
/
experiment2.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#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 initiated on : " << asctime(localtime(&timetoday)) << std::endl;
if (argc < 1)
{
throw std::runtime_error("Required arguments: number of iterations");
}
std::string charNumberIter = argv[1];
int numberIter = std::stoi(charNumberIter);
Settings pipelineSettings = getPipelineDefaultSettings();
// define maps that can be filled with algorithm-specific settings (e.g. for SAC-IA)
// Harris runs y675_58_5025_17 data file (experiment 2)
std::cout << "\nHARRIS RUNS\n"
<< std::endl;
double seedRef(0.0), seedSource(0.1), seedCustomRotation(0.2);
// Harris y675_58_5025_17
std::ofstream outfileHarris;
std::string folderNameHarris = "../data/", parametersFilenameHarris = "harris_600m-40deg-FOV_rotation-Z.txt";
std::string fullParametersFilenameHarris = folderNameHarris + parametersFilenameHarris; // including path
std::string parametersFilenameReducedHarris = removeExtension(parametersFilenameHarris);
std::string savedFilenameHarris = "../results/" + parametersFilenameReducedHarris + "_results";
outfileHarris.open(savedFilenameHarris + ".csv", std::ios_base::app);
outfileHarris << "Pipeline" << "," << "MRTE" << "," << "Bias error on x" << "," << "Bias error on y"
<< "," << "Bias error on z" << "," << "Custom angle on x" << "," << "Custom angle on y" << ","
<< "Custom angle on z" << "," << "[SEED] Reference cutout" << ","
<< "[SEED] Source cutout" << "," << "[SEED] Custom rotation" << ","
<< "MapString" << "," << "mapDouble" << std::endl;
for (size_t i = 1; i <= numberIter; i++)
{
seedRef += 0.37913, seedSource += 0.3913, seedCustomRotation += 0.313;
fullRegistration(fullParametersFilenameHarris, pipelineSettings, savedFilenameHarris,
&seedRef, &seedSource, &seedCustomRotation);
}
// Sift runs y675_58_5025_17 data file
std::cout << "\nSIFT RUNS\n"
<< std::endl;
seedRef = 0;
seedSource = 0.1111;
seedCustomRotation = 0.22222;
// SIFT y675_58_5025_17
std::ofstream outfileSift;
std::string folderNameSift = "../data/", parametersFilenameSift = "sift_600m-40deg-FOV_rotation-Z.txt";
std::string fullParametersFilenameSift = folderNameSift + parametersFilenameSift; // including path
std::string parametersFilenameReducedSift = removeExtension(parametersFilenameSift);
std::string savedFilenameSift = "../results/" + parametersFilenameReducedSift + "_results";
outfileSift.open(savedFilenameSift + ".csv", std::ios_base::app);
outfileSift << "Pipeline" << "," << "MRTE" << "," << "Bias error on x" << "," << "Bias error on y"
<< "," << "Bias error on z" << "," << "Custom angle on x" << "," << "Custom angle on y" << ","
<< "Custom angle on z" << "," << "[SEED] Reference cutout" << ","
<< "[SEED] Source cutout" << "," << "[SEED] Custom rotation" << ","
<< "MapString" << "," << "mapDouble" << std::endl;
for (size_t i = 1; i <= numberIter; i++)
{
seedRef += 0.37913, seedSource = 0.1111, seedCustomRotation = 0.22222;
fullRegistration(fullParametersFilenameSift, pipelineSettings, savedFilenameSift,
&seedRef, &seedSource, &seedCustomRotation);
}
// Sift runs y675_58_5025_17 data file
std::cout << "\nPipeline for all points RUNS\n"
<< std::endl;
seedRef = 0;
seedSource = 0.22222;
seedCustomRotation = 0.333333;
// SIFT y675_58_5025_17
std::ofstream outfile;
std::string folderName = "../data/", parametersFilename = "all_600m-40deg-FOV_rotation-Z.txt";
std::string fullParametersFilename = folderName + parametersFilename; // including path
std::string parametersFilenameReduced = removeExtension(parametersFilename);
std::string savedFilename = "../results/" + parametersFilenameReduced + "_results";
outfile.open(savedFilename + ".csv", std::ios_base::app);
outfile << "Pipeline" << "," << "MRTE" << "," << "Bias error on x" << "," << "Bias error on y"
<< "," << "Bias error on z" << "," << "Custom angle on x" << "," << "Custom angle on y" << ","
<< "Custom angle on z" << "," << "[SEED] Reference cutout" << ","
<< "[SEED] Source cutout" << "," << "[SEED] Custom rotation" << ","
<< "MapString" << "," << "mapDouble" << std::endl;
for (size_t i = 1; i <= numberIter; i++)
{
seedRef += 0.37913, seedSource = 0.1111, seedCustomRotation = 0.22222;
fullRegistration(fullParametersFilename, pipelineSettings, savedFilename,
&seedRef, &seedSource, &seedCustomRotation);
}
return 0;
}