-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
70 lines (59 loc) · 1.68 KB
/
main.cpp
File metadata and controls
70 lines (59 loc) · 1.68 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
#include <QCoreApplication>
#include <opencv/cv.h>
#include <opencv/highgui.h>
#include "frameproducers/webcameraframeproducer.h"
#include "common/utils/displayframeconsumer.h"
#include "gda/histogramgda.h"
#include "gda/neurobsgda.h"
#include "common/utils/descriptorwriter.h"
#include "descriptors/pose/allinoneposedescriptor.h"
AllInOnePoseDescriptor* acc = new AllInOnePoseDescriptor();
AbstractPoseDescriptor* createDescriptor(cv::Mat& nextFrame)
{
acc->accumulateNext(nextFrame);
if (acc->featuresCount() > 0)
return acc;
else
return NULL;
}
int main(int argc, char *argv[])
{
/*
* Typical main will be like this:
*
* auto fproducer = NetFrameProducer(9090);
*
* auto algorithm = AdaptiveGDA(new AbstractGDA[] {
* new SkinColorGDA(),
* new HistogramGDA(),
* new BlackMagicGDA()
* });
*
* auto gestureListener = ConsoleLogGL(std::out);
*
* int exitCode = 0; bool repeatCloseGestureTwice = true;
* auto closeListener = AppCloseGestureListener(exitCode, repeatCloseGestureTwice);
*
* algorithm.consume(fproducer);
* gestureListener.listen(algorithm);
* closeListener.listen(algorithm);
*
* return fproducer.startProducing();
*/
QCoreApplication a(argc, argv);
WebCameraFrameProducer fproducer;
// DisplayFrameConsumer displayer("Obtained image");
// displayer.consume(fproducer);
setlocale(LC_ALL, "C");
NeuroBSGDA gda("classifier.net", 1, 3);
gda.consume(fproducer);
// HistogramGDA gda(0);
// gda.enableOutput(true, true);
// gda.consume(fproducer);
// DescriptorWriter dw('s', 60, "test.txt");
// dw.setDescriptorCreator(createDescriptor);
// dw.postfix = "0.0 0.0 0.0";
// dw.consume(fproducer);
fproducer.startProducing();
return a.exec();
}