GestureRecognitionToolkit  Version: 1.0 Revision: 04-03-15
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 namespace GRT {
37 
38 class MovementDetector : public MLBase{
39 public:
40  MovementDetector( const UINT numDimensions = 1, const double upperThreshold = 1, const double lowerThreshold = 0.9, const double gamma = 0.95, const UINT searchTimeout = 0);
41 
42  virtual ~MovementDetector();
43 
44  virtual bool predict_( VectorDouble &input );
45 
52  virtual bool clear();
53 
60  virtual bool reset();
61 
69  virtual bool saveModelToFile(fstream &file) const;
70 
78  virtual bool loadModelFromFile(fstream &file);
79 
80  double getUpperThreshold() const;
81 
82  double getLowerThreshold() const;
83 
84  double getMovementIndex() const;
85 
86  double 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 double upperThreshold);
97 
98  bool setLowerThreshold(const double lowerThreshold);
99 
100  bool setGamma(const double 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  double upperThreshold;
113  double lowerThreshold;
114  double movementIndex;
115  double gamma;
116  bool firstSample;
117  bool movementDetected;
118  bool noMovementDetected;
119  Timer searchTimer;
120  VectorDouble lastSample;
121 
122 public:
123  enum SearchStates{SEARCHING_FOR_MOVEMENT=0,SEARCHING_FOR_NO_MOVEMENT,SEARCH_TIMEOUT};
124 
125 };
126 
127 }
128 
129 #endif //GRT_MOVEMENT_DETECTOR_HEADER
virtual bool saveModelToFile(string filename) const
Definition: MLBase.cpp:135
virtual bool predict_(VectorDouble &input)
virtual bool loadModelFromFile(string filename)
Definition: MLBase.cpp:157
Definition: AdaBoost.cpp:25
virtual bool saveModelToFile(fstream &file) const
virtual bool loadModelFromFile(fstream &file)