forked from taygunk/multiple-tracking-master
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBgs.hpp
53 lines (41 loc) · 1.44 KB
/
Bgs.hpp
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
/****************************************************************************
*
* Bgs.hpp
*
* Purpose: Base class for BGS algorithms.
*
* Author: Donovan Parks, October 2007
*
******************************************************************************/
#ifndef BGS_H_
#define BGS_H_
#include "Image.hpp"
#include "BgsParams.hpp"
namespace Algorithms
{
namespace BackgroundSubtraction
{
class Bgs
{
public:
static const int BACKGROUND = 0;
static const int FOREGROUND = 255;
virtual ~Bgs() {}
// Initialize any data required by the BGS algorithm. Should be called once before calling
// any of the following functions.
virtual void Initalize(const BgsParams& param) = 0;
// Initialize the background model. Typically, the background model is initialized using the first
// frame of the incoming video stream, but alternatives are possible.
virtual void InitModel(const RgbImage& data) = 0;
// Subtract the current frame from the background model and produce a binary foreground mask using
// both a low and high threshold value.
virtual void Subtract(int frame_num, const RgbImage& data,
BwImage& low_threshold_mask, BwImage& high_threshold_mask) = 0;
// Update the background model. Only pixels set to background in update_mask are updated.
virtual void Update(int frame_num, const RgbImage& data, const BwImage& update_mask) = 0;
// Return the current background model.
virtual RgbImage *Background() = 0;
};
};
};
#endif