forked from LabProdam/ContadorDeCiclistas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPointTracker.hpp
36 lines (27 loc) · 838 Bytes
/
PointTracker.hpp
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
#ifndef POINT_TRACKER_HPP
#define POINT_TRACKER_HPP
#include <opencv2/opencv.hpp>
#include "TrackedObject.hpp"
class PointTracker {
private:
PointTracker *reference;
static unsigned int absolutePointNumber;
unsigned int point_id;
unsigned int maximum_threshold;
bool hasReference;
int DistanceInThreshold(cv::Point &a, cv::Point &b);
public:
std::map<int, TrackedObject> points;
PointTracker(unsigned int threshold = 10);
PointTracker(unsigned int threshold, PointTracker reference);
void AddPoint(cv::Point &point, cv::Rect &rectangle);
};
class RectangleTracker : public PointTracker {
private:
cv::Point GetRectangleCenter(cv::Rect &rec);
public:
RectangleTracker(unsigned int threshold);
RectangleTracker(unsigned int threshold, PointTracker reference);
void AddRectangle(cv::Rect &rectangle);
};
#endif