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
51 lines (37 loc) · 945 Bytes
/
vibe.hpp
File metadata and controls
51 lines (37 loc) · 945 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
49
50
51
#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, int samples, int pixel_neighbor, int distance_threshold, int matching_threshold, int update_factor);
~VIBE();
void update(const cv::Mat& img);
cv::Mat& getMask();
int GetChannels() const
{
return m_channels;
}
void ResetModel(const cv::Mat& img, const cv::Rect& roiRect);
private:
int m_samples = 20;
int m_channels = 1;
int m_pixelNeighbor = 1;
int m_distanceThreshold = 20;
int m_matchingThreshold = 3;
int m_updateFactor = 16;
cv::Size m_size;
typedef std::vector<uchar> model_t;
model_t m_model;
cv::Mat m_mask;
unsigned int m_rng[RANDOM_BUFFER_SIZE];
int m_rngIdx = 0;
cv::Vec2i getRndNeighbor(int i, int j);
void init(const cv::Mat& img);
};
}
#endif /*__VIBE_HPP__*/