GestureRecognitionToolkit  Version: 0.2.5
The Gesture Recognition Toolkit (GRT) is a cross-platform, open-source, c++ machine learning library for real-time gesture recognition.
TimeDomainFeatures.h
Go to the documentation of this file.
1 
42 #ifndef GRT_TIME_DOMAIN_FEATURES_HEADER
43 #define GRT_TIME_DOMAIN_FEATURES_HEADER
44 
45 #include "../../CoreModules/FeatureExtraction.h"
46 #include "../../Util/Util.h"
47 
48 GRT_BEGIN_NAMESPACE
49 
50 class GRT_API TimeDomainFeatures : public FeatureExtraction{
51 public:
54  TimeDomainFeatures(const UINT bufferLength=100,const UINT numFrames=10,const UINT numDimensions = 1,const bool offsetInput = false,const bool useMean = true,const bool useStdDev = true,const bool useEuclideanNorm = true,const bool useRMS = true);
55 
62 
66  virtual ~TimeDomainFeatures();
67 
74  TimeDomainFeatures& operator=(const TimeDomainFeatures &rhs);
75 
84  virtual bool deepCopyFrom(const FeatureExtraction *featureExtraction);
85 
94  virtual bool computeFeatures(const VectorFloat &inputVector);
95 
103  virtual bool reset();
104 
112  virtual bool save( std::fstream &file ) const;
113 
121  virtual bool load( std::fstream &file );
122 
126  bool init(const UINT bufferLength,const UINT numFrames,const UINT numDimensions,const bool offsetInput,const bool useMean,const bool useStdDev,const bool useEuclideanNorm,const bool useRMS);
127 
134  VectorFloat update(const Float x);
135 
142  VectorFloat update(const VectorFloat &x);
143 
149  const CircularBuffer< VectorFloat > &getBufferData() const;
150 
151  //Tell the compiler we are using the following functions from the MLBase class to stop hidden virtual function warnings
152  using MLBase::save;
153  using MLBase::load;
154  using MLBase::train;
155  using MLBase::train_;
156  using MLBase::predict;
157  using MLBase::predict_;
158 
164  static std::string getId();
165 
166 protected:
167  UINT bufferLength;
168  UINT numFrames;
169  bool offsetInput;
170  bool useMean;
171  bool useStdDev;
172  bool useEuclideanNorm;
173  bool useRMS;
175 
176 private:
178  static std::string id;
179 };
180 
181 GRT_END_NAMESPACE
182 
183 #endif //GRT_TIME_DOMAIN_FEATURES_HEADER
184 
std::string getId() const
Definition: GRTBase.cpp:85
virtual bool predict(VectorFloat inputVector)
Definition: MLBase.cpp:135
virtual bool predict_(VectorFloat &inputVector)
Definition: MLBase.cpp:137
virtual bool reset()
Definition: MLBase.cpp:147
virtual bool train(ClassificationData trainingData)
Definition: MLBase.cpp:107
virtual bool save(const std::string &filename) const
Definition: MLBase.cpp:167
virtual bool computeFeatures(const VectorFloat &inputVector)
virtual bool train_(ClassificationData &trainingData)
Definition: MLBase.cpp:109
virtual bool load(const std::string &filename)
Definition: MLBase.cpp:190
virtual bool deepCopyFrom(const FeatureExtraction *rhs)