-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBOF.cpp
More file actions
74 lines (68 loc) · 1.49 KB
/
BOF.cpp
File metadata and controls
74 lines (68 loc) · 1.49 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
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
/*
* main.cpp
*
* Created on: Oct 29, 2014
* Author: romba
*/
#include "functions.hpp"
Mat image;
vector<KeyPoint> keypoints;
Mat descriptors;
char input;
int main(int argc , char **argv){
// cout << argv[1] << endl;
// image = imread(argv[1],CV_LOAD_IMAGE_GRAYSCALE);
// if(image.empty()) return -1;
// keypoints = calcKeyPoints(image);
// descriptors = getDescriptors(image,keypoints);
// namedWindow("Window");
// drawKeyPoints(image,keypoints);
// waitKey(0);
// openCamera(1);
// if(buildVocabulary("images")==0)
// cout << "Success";
vision* dev = new vision();
// image = imread("test.jpg",CV_LOAD_IMAGE_GRAYSCALE);
// cout << keypoints.size() << endl;
// keypoints = dev->getKeyPoints(image);
// cout << keypoints.size();
while(1){
cin >> input;
if(input == '1'){
dev->loadTrainingSet();
}else
if(input == '2'){
dev->buildVocabulary();
}else
if(input=='3'){
dev->trainSVM();
}else
if(input=='q'){
break;
}else
if(input=='4')
dev->initClassifiers();
else
if(input=='5'){
image = imread("test.jpg",CV_LOAD_IMAGE_GRAYSCALE);
dev->testImage(image);
}
else
if(input=='6'){
VideoCapture cap(1);
dev->openCamera(cap);
}
}
// dev->initVocabulary();
// dev->trainSVM();
// if(*argv[1] == '1'){
// if(dev->buildVocabulary("images")==0)
// cout << "Success Vocabulary";
//
// }
// else
// if(dev->trainSVM()==0){
// cout << "Success SVM";
// }
return 0;
}