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.
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 namespace GRT{
35 
37 public:
44  TimeseriesBuffer(UINT bufferSize = 5,UINT numDimensions = 1);
45 
52 
56  virtual ~TimeseriesBuffer();
57 
65 
74  virtual bool deepCopyFrom(const FeatureExtraction *featureExtraction);
75 
84  virtual bool computeFeatures(const VectorDouble &inputVector);
85 
93  virtual bool reset();
94 
101  virtual bool saveModelToFile(string filename) const;
102 
109  virtual bool loadModelFromFile(string filename);
110 
118  virtual bool saveModelToFile(fstream &file) const;
119 
127  virtual bool loadModelFromFile(fstream &file);
128 
138  bool init(UINT bufferSize,UINT numDimensions);
139 
146  VectorDouble update(double x);
147 
154  VectorDouble update(const VectorDouble &x);
155 
163  bool setBufferSize(UINT bufferSize);
164 
170  UINT getBufferSize();
171 
178  vector< VectorDouble > 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 }//End of namespace GRT
194 
195 #endif //GRT_TIMESERIES_BUFFER_HEADER
virtual bool loadModelFromFile(string filename)
bool setBufferSize(UINT bufferSize)
Definition: AdaBoost.cpp:25
VectorDouble update(double x)
TimeseriesBuffer & operator=(const TimeseriesBuffer &rhs)
virtual bool train(ClassificationData trainingData)
Definition: MLBase.cpp:80
TimeseriesBuffer(UINT bufferSize=5, UINT numDimensions=1)
virtual bool predict(VectorDouble inputVector)
Definition: MLBase.cpp:104
virtual bool predict_(VectorDouble &inputVector)
Definition: MLBase.cpp:106
virtual bool deepCopyFrom(const FeatureExtraction *featureExtraction)
virtual bool computeFeatures(const VectorDouble &inputVector)
virtual bool saveModelToFile(string filename) const
CircularBuffer< VectorDouble > dataBuffer
A buffer used to store the timeseries data.
vector< VectorDouble > getDataBuffer()
virtual bool train_(ClassificationData &trainingData)
Definition: MLBase.cpp:82