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.
DeadZone.h
Go to the documentation of this file.
1 
32 #ifndef GRT_DEADZONE_HEADER
33 #define GRT_DEADZONE_HEADER
34 
35 #include "../CoreModules/PreProcessing.h"
36 
37 GRT_BEGIN_NAMESPACE
38 
39 class DeadZone : public PreProcessing{
40 public:
48  DeadZone(Float lowerLimit = -0.1,Float upperLimit = 0.1,UINT numDimensions = 1);
49 
55  DeadZone(const DeadZone &rhs);
56 
60  virtual ~DeadZone();
61 
68  DeadZone& operator=(const DeadZone &rhs);
69 
78  virtual bool deepCopyFrom(const PreProcessing *preProcessing);
79 
88  virtual bool process(const VectorFloat &inputVector);
89 
97  virtual bool reset();
98 
106  virtual bool saveModelToFile(std::string filename) const;
107 
115  virtual bool saveModelToFile(std::fstream &file) const;
116 
124  virtual bool loadModelFromFile(std::string filename);
125 
133  virtual bool loadModelFromFile(std::fstream &file);
134 
143  bool init(Float lowerLimit,Float upperLimit,UINT numDimensions);
144 
151  Float filter(const Float x);
152 
159  VectorFloat filter(const VectorFloat &x);
160 
167  bool setLowerLimit(Float lowerLimit);
168 
175  bool setUpperLimit(Float upperLimit);
176 
182  Float getLowerLimit(){ if( initialized ){ return lowerLimit; } return 0; }
183 
189  Float getUpperLimit(){ if( initialized ){ return upperLimit; } return 0; }
190 
191 protected:
192  Float lowerLimit;
193  Float upperLimit;
194 
195  static RegisterPreProcessingModule< DeadZone > registerModule;
196 
197 };
198 
199 GRT_END_NAMESPACE
200 
201 #endif //GRT_DEADZONE_HEADER
virtual bool saveModelToFile(std::string filename) const
Definition: DeadZone.cpp:103
Float upperLimit
The upper limit of the dead-zone region.
Definition: DeadZone.h:193
DeadZone & operator=(const DeadZone &rhs)
Definition: DeadZone.cpp:52
virtual bool process(const VectorFloat &inputVector)
Definition: DeadZone.cpp:81
Float filter(const Float x)
Definition: DeadZone.cpp:233
bool setUpperLimit(Float upperLimit)
Definition: DeadZone.cpp:267
Float getLowerLimit()
Definition: DeadZone.h:182
virtual bool deepCopyFrom(const PreProcessing *preProcessing)
Definition: DeadZone.cpp:61
virtual ~DeadZone()
Definition: DeadZone.cpp:48
virtual bool reset()
Definition: DeadZone.cpp:99
Float getUpperLimit()
Definition: DeadZone.h:189
Float lowerLimit
The lower limit of the dead-zone region.
Definition: DeadZone.h:192
bool setLowerLimit(Float lowerLimit)
Definition: DeadZone.cpp:262
DeadZone(Float lowerLimit=-0.1, Float upperLimit=0.1, UINT numDimensions=1)
Definition: DeadZone.cpp:28
virtual bool loadModelFromFile(std::string filename)
Definition: DeadZone.cpp:140