-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathmain.cpp
96 lines (76 loc) · 2.46 KB
/
main.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
//main function for image location
#include <fstream>
#include <iostream>
#include <set>
#include <utility>
#include <vector>
#include <opencv/cv.h>
#include "global.h"
#include "geometry.h"
#include "visualwords.h"
#include "preprocess/picture.h"
#include "preprocess/bundlercamera.h"
#include "preprocess/parsebundler.h"
int main(int * argc, char** argv)
{
if (false == global::OpenRunningTimeFile()){
return false;
}
//pre-proscess the original bundler.out
//to get the query pictures pose ground truth
#if 0
PARSE_BUNDLER parse_bundler("E:/Dubrovnik6K/bundle/bundle.orig.out");
parse_bundler.ParseBundlerFile();
parse_bundler.FindQueryPicture("E:/Dubrovnik6K/bundle/list.orig.txt");
parse_bundler.WriteQueryBundler( "E:/Dubrovnik6K/bundle/bundle.query.point.out", true );
return 1;
#endif
//test geometry
#if 0
Test();
//Geometry geo;
//geo.TestGeometry();
return 1;
#endif
// modify the original bundler, add feature point x, y
#if 0
VISUALWORDS_3DPOINT_HANDLER vw_3d_pointhandler( "E:/Dubrovnik6K",
"list.query.txt", "E:/Dubrovnik6K/bundle/bundle.query.cam.out" );
vw_3d_pointhandler.Init();
// when write bundle, should not load desc, and not release pictures
vw_3d_pointhandler.mParse_bundler.WriteBundlerWithXY( "E:/Dubrovnik6K/bundle/bundle.query.xy.out" );
return 1;
#endif
#if 0
/* VISUALWORDS_3DPOINT_HANDLER(const std::string &bundle_path,
const std::string &list_txt,
const std::string &bundle_file)
*/
VISUALWORDS_3DPOINT_HANDLER vw_3d_point_handler("E:/statue",
"list.db.txt", "E:/statue/bundle/bundle.db.out");
vw_3d_point_handler.Init();
//define query images:
ALL_PICTURES pic_query("E:/statue", "list.query.txt");
pic_query.SetQueryFlag(true);
pic_query.LoadPicturesKeyFile();
//load the query images pose ground truth
pic_query.LoadCamerasPose("E:/statue/bundle/bundle.query.out");
vw_3d_point_handler.LocatePictures(pic_query);
#else
VISUALWORDS_3DPOINT_HANDLER vw_3d_point_handler("E:/Dubrovnik6K",
"list.db.txt", "E:/Dubrovnik6K/bundle/bundle.db.out");
vw_3d_point_handler.Init();
//define query images:
ALL_PICTURES pic_query("E:/Dubrovnik6K", "list.query.txt");
pic_query.SetQueryFlag(true);
pic_query.LoadPicturesKeyFile(true);
//load the query images pose ground truth
pic_query.LoadCamerasPose("E:/Dubrovnik6K/bundle/bundle.query.out");
//test the performance of CasHash
vw_3d_point_handler.LocatePictures(pic_query);
#endif
if (false == global::CloseRunningTimeFile()){
return false;
}
return 1;
}