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.
ClassLabelFilter.h
Go to the documentation of this file.
1 
33 #ifndef GRT_CLASS_LABEL_FILTER_HEADER
34 #define GRT_CLASS_LABEL_FILTER_HEADER
35 
36 #include "../Util/GRTCommon.h"
37 #include "../CoreModules/PostProcessing.h"
38 
39 GRT_BEGIN_NAMESPACE
40 
41 class GRT_API ClassLabelFilter : public PostProcessing{
42 public:
54  ClassLabelFilter(const UINT minimumCount = 1,const UINT bufferSize = 1);
55 
64 
68  virtual ~ClassLabelFilter();
69 
76  ClassLabelFilter& operator=(const ClassLabelFilter &rhs);
77 
86  virtual bool deepCopyFrom(const PostProcessing *postProcessing) override;
87 
96  virtual bool process(const VectorDouble &inputVector) override;
97 
105  virtual bool reset() override;
106 
114  virtual bool save( std::fstream &file ) const override;
115 
123  virtual bool load( std::fstream &file ) override;
124 
132  bool init(const UINT minimumCount,const UINT bufferSize);
133 
140  UINT filter(const UINT predictedClassLabel);
141 
147  UINT getFilteredClassLabel() const { return filteredClassLabel; }
148 
158  bool setMinimumCount(const UINT minimumCount);
159 
168  bool setBufferSize(const UINT bufferSize);
169 
175  static std::string getId();
176 
177  //Tell the compiler we are using the following functions from the MLBase class to stop hidden virtual function warnings
178  using MLBase::save;
179  using MLBase::load;
180 
181 protected:
184  UINT bufferSize;
186 
187 private:
188  static const std::string id;
190 };
191 
192 GRT_END_NAMESPACE
193 
194 #endif //GRT_CLASS_LABEL_FILTER_HEADER
std::string getId() const
Definition: GRTBase.cpp:85
virtual bool deepCopyFrom(const PostProcessing *postProcessing)
virtual bool reset()
Definition: MLBase.cpp:147
virtual bool process(const VectorFloat &inputVector)
virtual bool save(const std::string &filename) const
Definition: MLBase.cpp:167
This is the main base class that all GRT PostProcessing algorithms should inherit from...
UINT minimumCount
The minimum count sets the minimum number of class label values that must be present in the class lab...
CircularBuffer< UINT > buffer
The class label filter buffer.
UINT bufferSize
The size of the Class Label Filter buffer.
bool init()
virtual bool load(const std::string &filename)
Definition: MLBase.cpp:190
UINT getFilteredClassLabel() const
UINT filteredClassLabel
The most recent filtered class label value.