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.
MovingAverageFilter.h
Go to the documentation of this file.
1 
31 #ifndef GRT_MOVING_AVERAGE_FILTER_HEADER
32 #define GRT_MOVING_AVERAGE_FILTER_HEADER
33 
34 #include "../CoreModules/PreProcessing.h"
35 
36 namespace GRT{
37 
39 public:
46  MovingAverageFilter(UINT filterSize = 5,UINT numDimensions = 1);
47 
54 
58  virtual ~MovingAverageFilter();
59 
67 
76  virtual bool deepCopyFrom(const PreProcessing *preProcessing);
77 
86  virtual bool process(const VectorDouble &inputVector);
87 
95  virtual bool reset();
96 
104  virtual bool saveModelToFile(string filename) const;
105 
113  virtual bool saveModelToFile(fstream &file) const;
114 
122  virtual bool loadModelFromFile(string filename);
123 
131  virtual bool loadModelFromFile(fstream &file);
132 
140  bool init(UINT filterSize,UINT numDimensions);
141 
148  double filter(const double x);
149 
156  VectorDouble filter(const VectorDouble &x);
157 
163  UINT getFilterSize() const { return filterSize; }
164 
170  VectorDouble getFilteredData() const { return processedData; }
171 
172 protected:
173  UINT filterSize;
176 
178 };
179 
180 }//End of namespace GRT
181 
182 #endif //GRT_MOVING_AVERAGE_FILTER_HEADER
VectorDouble getFilteredData() const
virtual bool loadModelFromFile(string filename)
UINT filterSize
The size of the filter.
Definition: AdaBoost.cpp:25
double filter(const double x)
virtual bool deepCopyFrom(const PreProcessing *preProcessing)
CircularBuffer< VectorDouble > dataBuffer
A buffer to store the previous N values, N = filterSize.
MovingAverageFilter & operator=(const MovingAverageFilter &rhs)
virtual bool saveModelToFile(string filename) const
UINT inputSampleCounter
A counter to keep track of the number of input samples.
MovingAverageFilter(UINT filterSize=5, UINT numDimensions=1)
virtual bool process(const VectorDouble &inputVector)