forked from Slifers/MS-TLD
-
Notifications
You must be signed in to change notification settings - Fork 0
/
histogram.h
44 lines (33 loc) · 951 Bytes
/
histogram.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
//Öù״ͼ
#ifndef HISTOGRAM_H
#define HISTOGRAM_H
#include <vector>
#include <numeric>
class Bin;
class Histogram
{
public:
std::vector<double> data;
int dimSize;
int range;
int rangePerBin;
float rangePerBinInv;
bool initialized;
Histogram(int _dimSize = 16, int _range = 256);
~Histogram(){}
void insertValues(std::vector<int> & data1,
std::vector<int> & data2,
std::vector<int> & data3,
std::vector<double> & weight);
double computeSimilarity(Histogram * hist);
double getValue(int val1, int val2, int val3);
void addValue(int val1, int val2, int val3, double weight);
double getMin();
void transformToWeights();
void transformByWeight(double min);
void multiplyByWeights(Histogram * hist);
void clear();
void normalize();
void addExpHist(double alpha, Histogram & hist);
};
#endif //HISTOGRAM_H