forked from Smorodov/Multitarget-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMotionDetector.h
More file actions
38 lines (27 loc) · 951 Bytes
/
MotionDetector.h
File metadata and controls
38 lines (27 loc) · 951 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
#pragma once
#include "BaseDetector.h"
#include "BackgroundSubtract.h"
///
/// \brief The MotionDetector class
///
class MotionDetector : public BaseDetector
{
public:
MotionDetector(BackgroundSubtract::BGFG_ALGS algType, const cv::UMat& gray);
MotionDetector(BackgroundSubtract::BGFG_ALGS algType, const cv::Mat& gray);
~MotionDetector(void) = default;
bool Init(const config_t& config) override;
void Detect(const cv::UMat& gray) override;
bool CanGrayProcessing() const override
{
return true;
}
void CalcMotionMap(cv::Mat& frame) override;
void ResetModel(const cv::UMat& img, const cv::Rect& roiRect) override;
private:
void DetectContour();
std::unique_ptr<BackgroundSubtract> m_backgroundSubst;
cv::UMat m_fg;
BackgroundSubtract::BGFG_ALGS m_algType = BackgroundSubtract::BGFG_ALGS::ALG_MOG2;
bool m_useRotatedRect = false;
};