-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.cpp
50 lines (40 loc) · 1.29 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
#include <iostream>
#include "Dataset.h"
#include "FrameManager.h"
#include "SURF.h"
using namespace cv;
using namespace std;
int main(int argc, char** argv){
if( argc != 2)
{
cout << " Usage: display_image ImageToLoadAndDisplay" << endl;
return -1;
}
// Import all images
Dataset dataset(argv[1]);
if(dataset._images.size() == 0) {
cerr << "Can't get image files" << endl;
return 1;
}
if(dataset._images.size() < dataset._filenames.size()) {
cerr << "Can't read all files! Read " << dataset._images.size() << " files but should've read " << dataset._filenames.size() << " files." << endl;
return 1;
}
// keypoint detection and extracting decriptors within class SURF
vector<vector<KeyPoint>> imgpts;
vector<vector<KeyPoint>> imgpts_pruned;
vector<Mat> descriptors;
SURF surf(dataset._images, imgpts, descriptors);
// for (int i = 0; i < dataset._images.size(); ++i){
// cout << "size of each keypoint vector " << imgpts[i].size() << endl;
// }
// for (int i = 0; i < dataset._images.size(); ++i){
// cout << "size of descriptor matrix "<< descriptors[i].size << endl;
// }
//
FrameManager fm(dataset._images, imgpts, imgpts_pruned, descriptors);
if (!fm.features_matched_already)
fm.matchFeatures();
fm.GetBaseline3D();
return 0;
}