-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCVRecoMain.cpp
More file actions
47 lines (39 loc) · 1.07 KB
/
Copy pathCVRecoMain.cpp
File metadata and controls
47 lines (39 loc) · 1.07 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
#include "RecoManager.h"
#include <stdlib.h>
#include <iostream>
using namespace std;
#define NUMARGUMENTS 5
void Usage(char* argv[])
{
cout << "Usage: " << argv[0] << " <Base Folder Path> <Name of Log File> <number of features to detect> <dictionary size (kmeans clusters> <0 for validation image prediction, 1 for test image prediction>" << endl;
exit(-2);
}
int main(int argc, char* argv[])
{
//Check usage
if(argc != NUMARGUMENTS+1)
{
Usage(argv);
}
CRecoManager recoMgr;
unsigned int numFeatures = (unsigned int)atoi(argv[3]);
unsigned int dictionarySize = (unsigned int)atoi(argv[4]);
unsigned int validationOrTest = (unsigned int)atoi(argv[5]);
if(!recoMgr.Init(string (argv[1]), string(argv[2]), string(argv[3]), string(argv[4]), string(argv[5]))) //Initialize
{
return -1;
}
//Populate images
cout << "Populating Image List..." << endl;
recoMgr.PopulateImages(validationOrTest);
cout << "Building Model..." << endl;
if(!recoMgr.BuildModel(numFeatures, dictionarySize))
{
return -1;
}
if(!recoMgr.TestModel(numFeatures))
{
return -1;
}
return 0;
}