GestureRecognitionToolkit  Version: 0.2.0
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(UINT bufferSize = 5,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 
101  virtual bool saveModelToFile( std::string filename ) const;
102 
109  virtual bool loadModelFromFile( std::string filename );
110 
118  virtual bool saveModelToFile( std::fstream &file ) const;
119 
127  virtual bool loadModelFromFile( std::fstream &file );
128 
138  bool init(UINT bufferSize,UINT numDimensions);
139 
146  VectorFloat update(Float x);
147 
154  VectorFloat update(const VectorFloat &x);
155 
163  bool setBufferSize(UINT bufferSize);
164 
170  UINT getBufferSize();
171 
178  Vector< VectorFloat > getDataBuffer();
179 
180  //Tell the compiler we are using the following functions from the MLBase class to stop hidden virtual function warnings
181  using MLBase::train;
182  using MLBase::train_;
183  using MLBase::predict;
184  using MLBase::predict_;
185 
186 protected:
187  UINT bufferSize;
189 
191 };
192 
193 GRT_END_NAMESPACE
194 
195 #endif //GRT_TIMESERIES_BUFFER_HEADER
virtual bool predict(VectorFloat inputVector)
Definition: MLBase.cpp:113
virtual bool predict_(VectorFloat &inputVector)
Definition: MLBase.cpp:115
virtual bool saveModelToFile(std::fstream &file) const
virtual bool train(ClassificationData trainingData)
Definition: MLBase.cpp:89
virtual bool loadModelFromFile(std::fstream &file)
virtual bool computeFeatures(const VectorFloat &inputVector)
virtual bool reset()
virtual bool train_(ClassificationData &trainingData)
Definition: MLBase.cpp:91
virtual bool deepCopyFrom(const FeatureExtraction *rhs)
CircularBuffer< VectorFloat > dataBuffer
A buffer used to store the timeseries data.