-
Notifications
You must be signed in to change notification settings - Fork 1
/
Ctracker.h
46 lines (38 loc) · 1.08 KB
/
Ctracker.h
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
#pragma once
#include "Kalman.h"
#include "HungarianAlg.h"
#include "opencv2/opencv.hpp"
#include <iostream>
#include <vector>
using namespace cv;
using namespace std;
class CTrack
{
public:
vector<Point2d> trace;
static size_t NextTrackID;
size_t track_id;
size_t skipped_frames;
Point2d prediction;
TKalmanFilter* KF;
CTrack(Point2f p, float dt, float Accel_noise_mag);
~CTrack();
};
class CTracker
{
public:
// Øàã âðåìåíè îïðîñà ôèëüòðà
float dt;
float Accel_noise_mag;
// Ïîðîã ðàññòîÿíèÿ. Åñëè òî÷êè íàõîäÿòñÿ äóã îò äðóãà íà ðàññòîÿíèè,
// ïðåâûøàþùåì ýòîò ïîðîã, òî ýòà ïàðà íå ðàññìàòðèâàåòñÿ â çàäà÷å î íàçíà÷åíèÿõ.
double dist_thres;
// Ìàêñèìàëüíîå êîëè÷åñòâî êàäðîâ êîòîðîå òðåê ñîõðàíÿåòñÿ íå ïîëó÷àÿ äàííûõ î èçìåðåíèé.
int maximum_allowed_skipped_frames;
// Ìàêñèìàëüíàÿ äëèíà ñëåäà
int max_trace_length;
vector<CTrack*> tracks;
void Update(vector<Point2d>& detections, int& counter_in, int & counter_out);
CTracker(float _dt, float _Accel_noise_mag, double _dist_thres=60, int _maximum_allowed_skipped_frames=10,int _max_trace_length=10);
~CTracker(void);
};