forked from Smorodov/Multitarget-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBackgroundSubtract.h
More file actions
43 lines (35 loc) · 852 Bytes
/
BackgroundSubtract.h
File metadata and controls
43 lines (35 loc) · 852 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
#pragma once
#include "defines.h"
#include "vibe_src/vibe.hpp"
#include "Subsense/BackgroundSubtractorSuBSENSE.h"
#include "Subsense/BackgroundSubtractorLOBSTER.h"
#ifdef USE_OCV_BGFG
#include <opencv2/bgsegm.hpp>
#endif
///
/// \brief The BackgroundSubtract class
///
class BackgroundSubtract
{
public:
enum BGFG_ALGS
{
ALG_VIBE,
ALG_MOG,
ALG_GMG,
ALG_CNT,
ALG_SuBSENSE,
ALG_LOBSTER,
ALG_MOG2
};
BackgroundSubtract(BGFG_ALGS algType, int channels);
~BackgroundSubtract();
bool Init(const config_t& config);
void Subtract(const cv::UMat& image, cv::UMat& foreground);
int m_channels;
BGFG_ALGS m_algType;
private:
std::unique_ptr<vibe::VIBE> m_modelVibe;
cv::Ptr<cv::BackgroundSubtractor> m_modelOCV;
std::unique_ptr<BackgroundSubtractorLBSP> m_modelSuBSENSE;
};