Fix nan issue in features
[trackerpp.git] / main.cpp
1 #include<iostream>
2 #include "Engine.h"
3 #include <string>
4 #include "Logger.h"
5
6 #define TAG "Main"
7
8 using namespace suanzi;
9
10 class Callback : public EngineObserver
11 {
12     void onPersonsIn(const std::vector<Person>& p){
13         LOG_DEBUG(TAG, "onPersonsIn");
14         for (const auto& i : p){
15             LOG_DEBUG(TAG, "OnPersonIn " << i.toString());
16         }
17     };
18
19     void onPersonsOut(const std::vector<Person>& p) {
20         LOG_DEBUG(TAG, "onPersonsOut");
21         for (const auto& i : p){
22             LOG_DEBUG(TAG, "OnPersonOut " << i.toString());
23         }
24     };
25 };
26
27 int main(int argc, char* argv[])
28 {
29     initLogger("./config/log4cpp.properties");
30     LOG_DEBUG(TAG, "==================================");
31     EnginePtr e = Engine::create();
32     e->addObserver(new Callback());
33     e->setVideoSrc(VideoSrcType::URL, "rtsp://192.168.1.75:554/stream1");
34     //e->setVideoSrc(VideoSrcType::URL, "rtsp://192.168.56.101:5454/test.mp4");
35     e->start();
36     e->destroy();
37     log4cpp::Category::shutdown();
38 }