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
163 lines (144 loc) · 2.73 KB
/
defines.h
File metadata and controls
163 lines (144 loc) · 2.73 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
#pragma once
#include <vector>
#include <string>
#include <map>
#include <opencv2/opencv.hpp>
// ---------------------------------------------------------------------------
//
// ---------------------------------------------------------------------------
typedef float track_t;
typedef cv::Point_<track_t> Point_t;
#define Mat_t CV_32FC
///
/// \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_brect(rect), m_type(type), m_confidence(confidence)
{
B2RRect();
}
cv::RotatedRect m_rrect;
cv::Rect m_brect;
std::string m_type;
float m_confidence = -1;
mutable cv::Mat m_hist;
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,
Motion_MOG,
Motion_GMG,
Motion_CNT,
Motion_SuBSENSE,
Motion_LOBSTER,
Motion_MOG2,
Face_HAAR,
Pedestrian_HOG,
Pedestrian_C4,
SSD_MobileNet,
Yolo_OCV,
Yolo_Darknet
};
///
/// \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]
DistHOG, // Euclidean distance between HOG descriptors, [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
};
}