forked from HPCL/pedestrian-counting
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Target.hpp
84 lines (59 loc) · 1.74 KB
/
Target.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
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
/*
* Target.hpp
* wrapper to manage data going in and out of Kalman filter
* Brian J Gravelle
* ix.cs.uoregon.edu/~gravelle
* See LICENSE file for licensing information and boring legal stuff
* If by some miricale you find this software useful, thanks are accepted in
* the form of chocolate, coffee, or introductions to potential employers.
*/
#ifndef __TARGET_HPP__
#define __TARGET_HPP__
// my Kalman stuff
extern "C" {
#include "../kalman-filters/basic-c/kalman_filter.h"
#include "../kalman-filters/basic-c/linear_algebra.h"
}
// ped counting stuff
#include "object.h"
// opencv
#include <opencv/cv.hpp>
#include "opencv2/core.hpp"
// generic c++ things
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctime>
class Target {
public:
Target(int _n, int _m, KALMAN_TYPE* A_init, KALMAN_TYPE* C_init, KALMAN_TYPE* Q_init, KALMAN_TYPE* R_init, KALMAN_TYPE* P_init, KALMAN_TYPE* x_hat_init);
~Target();
void update(vector<Object> &objects, double dt);
void predict();
void correct(bool found);
bool choose_next_point(vector<Object> &objects);
int get_num_steps();
void set_num_steps(int steps);
int get_num_empty_steps();
void set_num_empty_steps(int steps);
double get_radius();
void set_radius(double r);
int get_id_num();
void set_id_num(int _id_num);
bool get_is_counted();
void set_is_counted(bool new_ic = true);
static int next_id;
static double max_dist_sqd;
Object prev_obj;
private:
KALMAN_TYPE *A, *C, *Q, *R, *P, *K, *x, *y, *x_hat,
*x_hat_new, *A_T, *C_T, *id,
*temp_1, *temp_2, *temp_3, *temp_4;
int num_steps, num_empty_steps;
int n, m;
double radius; //note this is radius squared
int id_num;
bool is_counted;
};
#endif