-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmanager.h
More file actions
52 lines (48 loc) · 1.43 KB
/
manager.h
File metadata and controls
52 lines (48 loc) · 1.43 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
#ifndef __MANAGER_H__
#define __MANAGER_H__
#include <opencv2/opencv.hpp>
#include "alerter.h"
#include "detector.h"
#include "distance.h"
#include "dynamic_tracker.h"
#include "log_manager.h"
#include "velocity.h"
#include "communication.h"
class Manager {
public:
static logger imgLogger;
Manager(int processID);
// Gets the currentFrame and sends it for detection and then tracking,
// finally if necessary sends a alert
int processing(const cv::Mat &newFrame, bool mode);
void mainDemo();
// init all variabels and creat the instance of distance
void init();
private:
Communication communication;
std::shared_ptr<cv::Mat> prevFrame;
std::shared_ptr<cv::Mat> currentFrame;
std::vector<ObjectInformation> prevOutput;
std::vector<ObjectInformation> currentOutput;
Detector detector;
Velocity velocity;
DynamicTracker dynamicTracker;
Distance distance;
Alerter alerter;
int iterationCnt;
uint32_t destID;
uint32_t processID;
bool isTravel;
// Moves the current image to the prevFrame
// and clears the memory of the currentFrame;
void prepareForTheNext();
int drawOutput();
bool isDetect();
bool isResetTracker();
bool isTrack();
bool isCalcVelocity();
void sendAlerts(std::vector<std::vector<uint8_t>> &alerts);
void runOnVideo(std::string videoPath);
int readIdFromJson(const char *target);
};
#endif //__MANAGER_H__