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.
TimeseriesBuffer.h
Go to the documentation of this file.
1 
29 #ifndef GRT_TIMESERIES_BUFFER_HEADER
30 #define GRT_TIMESERIES_BUFFER_HEADER
31 
32 #include "../../CoreModules/FeatureExtraction.h"
33 
34 GRT_BEGIN_NAMESPACE
35 
36 class GRT_API TimeseriesBuffer : public FeatureExtraction{
37 public:
44  TimeseriesBuffer(const UINT bufferSize = 5,const UINT numDimensions = 1);
45 
52 
56  virtual ~TimeseriesBuffer();
57 
64  TimeseriesBuffer& operator=(const TimeseriesBuffer &rhs);
65 
74  virtual bool deepCopyFrom(const FeatureExtraction *featureExtraction);
75 
84  virtual bool computeFeatures(const VectorFloat &inputVector);
85 
93  virtual bool reset();
94 
102  virtual bool save( std::fstream &file ) const;
103 
111  virtual bool load( std::fstream &file );
112 
122  bool init(const UINT bufferSize,const UINT numDimensions);
123 
130  VectorFloat update(const Float x);
131 
138  VectorFloat update(const VectorFloat &x);
139 
147  bool setBufferSize(const UINT bufferSize);
148 
154  UINT getBufferSize() const;
155 
162  Vector< VectorFloat > getDataBuffer() const;
163 
164  //Tell the compiler we are using the following functions from the MLBase class to stop hidden virtual function warnings
165  using MLBase::save;
166  using MLBase::load;
167  using MLBase::train;
168  using MLBase::train_;
169  using MLBase::predict;
170  using MLBase::predict_;
171 
177  static std::string getId();
178 
179 protected:
180  UINT bufferSize;
182 
183 private:
185  static std::string id;
186 };
187 
188 GRT_END_NAMESPACE
189 
190 #endif //GRT_TIMESERIES_BUFFER_HEADER
191 
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)
CircularBuffer< VectorFloat > dataBuffer
A buffer used to store the timeseries data.