-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdog.h
69 lines (53 loc) · 1.4 KB
/
dog.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#ifndef DOG_H
#define DOG_H
/* from local library */
#include "colorhistogram.h"
/* from OpenCV library */
#include <opencv2/core.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/imgproc.hpp>
/* from gsl library */
#include <gsl/gsl_rng.h>
#include <gsl/gsl_randist.h>
/* from gflags library */
//#include <gflags/gflags.h>
// use console flag
//DECLARE_double(std);
class Dog {
public:
Dog();
Dog(const int fw, const int fh, const cv::Rect &rect, cv::Mat *hist);
void run(cv::Mat &frame, gsl_rng *rng);
void run2(cv::Mat &frame, gsl_rng *rng);
void run3(cv::Mat &frame, gsl_rng *rng);
//bool operator<(const Dog &p) { return weight < p.weight; }
/* coefficient for normalizing */
static const int LAMBDA;
/* autoregressive dynamics parameters for transition model */
static const float A1;
static const float A2;
static const float B0;
/* standard deviations for gaussian sampling in transition model */
static const double TRANS_X_STD;
static const double TRANS_Y_STD;
static const double TRANS_S_STD;
int fw;
int fh;
float x0;
float y0;
float xp;
float yp;
float x;
float y;
float sp;
float s;
float width;
float height;
cv::Mat *hist;
float weight;
private:
static ColorHistogram *pHist;
float _likelihood(const cv::Mat &frame);
float _histo_dist_sq(cv::Mat *h1, cv::Mat *h2);
};
#endif