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.
DoubleMovingAverageFilter.h
Go to the documentation of this file.
1 
28 #ifndef GRT_DOUBLE_MOVING_AVERAGE_FILTER_HEADER
29 #define GRT_DOUBLE_MOVING_AVERAGE_FILTER_HEADER
30 
31 #include "../CoreModules/PreProcessing.h"
32 #include "MovingAverageFilter.h"
33 
34 GRT_BEGIN_NAMESPACE
35 
39 class GRT_API DoubleMovingAverageFilter : public PreProcessing {
40 public:
47  DoubleMovingAverageFilter(const UINT filterSize = 5,const UINT numDimensions = 1);
48 
55 
59  virtual ~DoubleMovingAverageFilter();
60 
68 
77  virtual bool deepCopyFrom(const PreProcessing *preProcessing);
78 
87  virtual bool process(const VectorFloat &inputVector);
88 
96  virtual bool reset();
97 
105  virtual bool save(std::fstream &file) const;
106 
114  virtual bool load(std::fstream &file);
115 
124  bool init(UINT filterSize,UINT numDimensions);
125 
132  Float filter(const Float x);
133 
140  VectorFloat filter(const VectorFloat &x);
141 
147  VectorFloat getFilteredData() const;
148 
154  static std::string getId();
155 
156  //Tell the compiler we are using the following functions from the MLBase class to stop hidden virtual function warnings
157  using MLBase::save;
158  using MLBase::load;
159 
160 protected:
161  UINT filterSize;
164 
165 private:
166  static const std::string id;
168 
169 };
170 
171 GRT_END_NAMESPACE
172 
173 #endif //GRT_DOUBLE_MOVING_AVERAGE_FILTER_HEADER
174 
std::string getId() const
Definition: GRTBase.cpp:85
virtual bool deepCopyFrom(const PreProcessing *rhs)
Definition: PreProcessing.h:58
MovingAverageFilter filter2
The second moving average filter.
The MovingAverageFilter implements a low pass moving average filter.
virtual bool save(const std::string &filename) const
Definition: MLBase.cpp:167
virtual bool reset() override
UINT filterSize
The size of the filter.
virtual bool process(const VectorFloat &inputVector)
Definition: PreProcessing.h:74
MovingAverageFilter filter1
The first moving average filter.
virtual bool load(const std::string &filename)
Definition: MLBase.cpp:190
The class implements a Float moving average filter.