-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
38 lines (37 loc) · 1.05 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
#include <opencv2/opencv.hpp>
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <exception>
#include <cmath>
#include "PicInfo.h"
#include "PicPool.h"
#include "PicRetriever.h"
using namespace std;
using namespace cv;
const char DATASET_RELA_DIR[] = "DataSet/";
int main(){
// Create PicRetriver with DataSet directory
PicRetriever retriever(DATASET_RELA_DIR);
// Read images info from AllImage.txt
retriever.loadPicPool("AllImages.txt");
// Read query info from QueryImages.txt
retriever.loadQueries("QueryImages.txt");
vector<double> preciResults;
// Do all combinations queries
for (int i = 0; i < 10; ++i) {
string dirName = "Result/" + to_string(i) + "/";
if (i < 5) {
// use BIN16
preciResults.push_back(retriever.retrieveAll((PicRetriever::DistanceMethod)i, BIN_16));
retriever.dumpAllQueries(dirName, dirName);
}
else {
// use BIN128
preciResults.push_back(retriever.retrieveAll((PicRetriever::DistanceMethod)(i - 5), BIN_128));
retriever.dumpAllQueries(dirName, dirName);
}
}
return 0;
}