forked from Smorodov/Multitarget-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdefines.h
More file actions
165 lines (147 loc) · 2.83 KB
/
defines.h
File metadata and controls
165 lines (147 loc) · 2.83 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
#pragma once
#include <vector>
#include <string>
#include <map>
#include <opencv2/opencv.hpp>
// ---------------------------------------------------------------------------
//
// ---------------------------------------------------------------------------
typedef float track_t;
typedef cv::Point_<track_t> Point_t;
#define El_t CV_32F
#define Mat_t CV_32FC
typedef std::vector<int> assignments_t;
typedef std::vector<track_t> distMatrix_t;
///
/// \brief config_t
///
typedef std::multimap<std::string, std::string> config_t;
///
/// \brief The CRegion class
///
class CRegion
{
public:
CRegion()
: m_type(""), m_confidence(-1)
{
}
CRegion(const cv::Rect& rect)
: m_brect(rect)
{
B2RRect();
}
CRegion(const cv::RotatedRect& rrect)
: m_rrect(rrect)
{
R2BRect();
}
CRegion(const cv::Rect& rect, const std::string& type, float confidence)
: m_type(type), m_brect(rect), m_confidence(confidence)
{
B2RRect();
}
std::string m_type;
cv::RotatedRect m_rrect;
cv::Rect m_brect;
float m_confidence = -1;
private:
///
/// \brief R2BRect
/// \return
///
cv::Rect R2BRect()
{
m_brect = m_rrect.boundingRect();
return m_brect;
}
///
/// \brief B2RRect
/// \return
///
cv::RotatedRect B2RRect()
{
m_rrect = cv::RotatedRect(m_brect.tl(), cv::Point2f(static_cast<float>(m_brect.x + m_brect.width), static_cast<float>(m_brect.y)), m_brect.br());
return m_rrect;
}
};
typedef std::vector<CRegion> regions_t;
///
///
///
namespace tracking
{
///
/// \brief The Detectors enum
///
enum Detectors
{
Motion_VIBE = 0,
Motion_MOG = 1,
Motion_GMG = 2,
Motion_CNT = 3,
Motion_SuBSENSE = 4,
Motion_LOBSTER = 5,
Motion_MOG2 = 6,
Face_HAAR = 7,
Pedestrian_HOG = 8,
Pedestrian_C4 = 9,
SSD_MobileNet = 10,
Yolo_OCV = 11,
Yolo_Darknet = 12,
Yolo_TensorRT = 13,
DNN_OCV = 14
};
///
/// \brief The DistType enum
///
enum DistType
{
DistCenters, // Euclidean distance between centers, pixels
DistRects, // Euclidean distance between bounding rectangles, pixels
DistJaccard, // Intersection over Union, IoU, [0, 1]
DistHist, // Bhatacharia distance between histograms, [0, 1]
DistsCount
};
///
/// \brief The FilterGoal enum
///
enum FilterGoal
{
FilterCenter,
FilterRect
};
///
/// \brief The KalmanType enum
///
enum KalmanType
{
KalmanLinear,
KalmanUnscented,
KalmanAugmentedUnscented
};
///
/// \brief The MatchType enum
///
enum MatchType
{
MatchHungrian,
MatchBipart
};
///
/// \brief The LostTrackType enum
///
enum LostTrackType
{
TrackNone,
TrackKCF,
TrackMIL,
TrackMedianFlow,
TrackGOTURN,
TrackMOSSE,
TrackCSRT,
TrackDAT,
TrackSTAPLE,
TrackLDES
};
}