-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.cpp
More file actions
49 lines (35 loc) · 1.05 KB
/
Copy pathmain.cpp
File metadata and controls
49 lines (35 loc) · 1.05 KB
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
#include <iostream>
#include <fstream>
#include <cmath>
#include <cfloat>
#include <omp.h> // add OpenMP support in Configuration Properties
#define NUM_THREADS omp_get_max_threads() // number of threads
#include "common.h"
#include "math.h"
#include "synthData.h"
#include "p4p.h"
#include "r4p3v.h"
#include "r4p3v_ns.h"
#include "stats.h"
int main()
{
Stats stats;
char dataOut[100];
sprintf_s(dataOut, "%sdata_%i_%i.txt", FOLDER_OUT, SCENE, MOTION);
std::ofstream exportData(dataOut,std::ios::out);
exportData.precision(DBL_DIG);
for (int i=1; i<=NTRIALS; ++i)
{
double q[NVIEWS][NPOINTS][3];
Camera cam_gt, cam_est;
synthData(q,cam_gt); // generate synthetic image points and ground truth cameras
stats.timer.start(); // start timer
if (!r4p3v_ns(q,cam_est)) continue; // run solver
stats.totalTime+=stats.timer.stop(); // stop timer
stats.updateStats(cam_est,cam_gt); // update statistics
//exportData << stats.errNum << "\n"; // export errors to file
}
exportData.close();
stats.printStats(); // print results
return 0;
}