-
Notifications
You must be signed in to change notification settings - Fork 2
/
MotionEstimator.hxx
56 lines (37 loc) · 1.17 KB
/
MotionEstimator.hxx
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
54
55
56
#ifndef __MOTION_ESTIMATOR_HXX__
#define __MOTION_ESTIMATOR_HXX__
#include <iostream>
#include <deque>
#include <libconfig.h++>
#include <opencv2/opencv.hpp>
#include <opencv2/highgui.hpp>
#include "FrameProcessor.hxx"
#include "MotionState.hxx"
namespace ISentry
{
class MotionEstimator:public FrameProcessor, public MotionState
{
public:
MotionEstimator(const libconfig::Setting& cfg);
void reset();
virtual void addFrame(std::pair<cv::Mat,time_t> &m);
virtual std::vector<float> getSignals();
virtual std::vector<cv::Mat> getFrames();
protected:
const cv::Mat &getLastScaledFrame() const { return small;}
const cv::Mat &getLastDiff() const { return diff;}
float getLastSmoothedMotion() const;
float getLastRawMotion() const;
void saveFrame(cv::Mat &f);
void saveRawMotion(float v);
cv::Mat diff;
cv::Mat small;
size_t detection_window_size;
int internal_frame_width;
size_t smoothing_window_size;
std::deque<cv::Mat> buf;
std::vector<float> raw_motion;
private:
};
};
#endif //__MOTION_ESTIMATOR_HXX__