GestureRecognitionToolkit  Version: 0.1.0
The Gesture Recognition Toolkit (GRT) is a cross-platform, open-source, c++ machine learning library for real-time gesture recognition.
MovementDetector.h
Go to the documentation of this file.
1 
31 #ifndef GRT_MOVEMENT_DETECTOR_HEADER
32 #define GRT_MOVEMENT_DETECTOR_HEADER
33 
34 #include "../../CoreModules/MLBase.h"
35 
36 GRT_BEGIN_NAMESPACE
37 
38 class MovementDetector : public MLBase{
39 public:
40  MovementDetector( const UINT numDimensions = 1, const Float upperThreshold = 1, const Float lowerThreshold = 0.9, const Float gamma = 0.95, const UINT searchTimeout = 0);
41 
42  virtual ~MovementDetector();
43 
44  virtual bool predict_( VectorFloat &input );
45 
52  virtual bool clear();
53 
60  virtual bool reset();
61 
69  virtual bool saveModelToFile( std::fstream &file ) const;
70 
78  virtual bool loadModelFromFile( std::fstream &file );
79 
80  Float getUpperThreshold() const;
81 
82  Float getLowerThreshold() const;
83 
84  Float getMovementIndex() const;
85 
86  Float getGamma() const;
87 
88  bool getMovementDetected() const;
89 
90  bool getNoMovementDetect() const;
91 
92  UINT getState() const;
93 
94  UINT getSearchTimeout() const;
95 
96  bool setUpperThreshold(const Float upperThreshold);
97 
98  bool setLowerThreshold(const Float lowerThreshold);
99 
100  bool setGamma(const Float gamma);
101 
102  bool setSearchTimeout(const UINT searchTimeout);
103 
104  //Tell the compiler we are using the base class train method to stop hidden virtual function warnings
107 
108 protected:
109 
110  UINT state;
111  UINT searchTimeout;
112  Float upperThreshold;
113  Float lowerThreshold;
114  Float movementIndex;
115  Float gamma;
116  bool firstSample;
117  bool movementDetected;
118  bool noMovementDetected;
119  Timer searchTimer;
120  VectorFloat lastSample;
121 
122 public:
123  enum SearchStates{SEARCHING_FOR_MOVEMENT=0,SEARCHING_FOR_NO_MOVEMENT,SEARCH_TIMEOUT};
124 
125 };
126 
127 GRT_END_NAMESPACE
128 
129 #endif //GRT_MOVEMENT_DETECTOR_HEADER
Definition: Timer.h:43
virtual bool saveModelToFile(std::string filename) const
Definition: MLBase.cpp:146
virtual bool saveModelToFile(std::fstream &file) const
virtual bool loadModelFromFile(std::string filename)
Definition: MLBase.cpp:168
virtual bool clear()
virtual bool predict_(VectorFloat &input)
virtual bool reset()
Definition: MLBase.h:70
virtual bool loadModelFromFile(std::fstream &file)