forked from Smorodov/Multitarget-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvibe.hpp
More file actions
48 lines (35 loc) · 840 Bytes
/
vibe.hpp
File metadata and controls
48 lines (35 loc) · 840 Bytes
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
#ifndef __VIBE_HPP__
#define __VIBE_HPP__
#include <opencv2/core/core.hpp>
#include <memory>
#define RANDOM_BUFFER_SIZE (65535)
namespace vibe
{
class VIBE
{
public:
VIBE(int channels = 1, int samples = 20, int pixel_neighbor = 1, int distance_threshold = 20, int matching_threshold = 3, int update_factor = 16);
~VIBE();
void update(const cv::Mat& img);
cv::Mat& getMask();
int GetChannels() const
{
return channels_;
}
private:
int samples_;
int channels_;
int pixel_neighbor_;
int distance_threshold_;
int matching_threshold_;
int update_factor_;
cv::Size size_;
unsigned char *model_;
cv::Mat mask_;
unsigned int rng_[RANDOM_BUFFER_SIZE];
int rng_idx_;
cv::Vec2i getRndNeighbor(int i, int j);
void init(const cv::Mat& img);
};
}
#endif /*__VIBE_HPP__*/