GestureRecognitionToolkit  Version: 0.1.0
The Gesture Recognition Toolkit (GRT) is a cross-platform, open-source, c++ machine learning library for real-time gesture recognition.
MinDist.h
Go to the documentation of this file.
1 
33 #ifndef GRT_MINDIST_HEADER
34 #define GRT_MINDIST_HEADER
35 
36 #include "MinDistModel.h"
37 #include "../../CoreModules/Classifier.h"
38 
39 GRT_BEGIN_NAMESPACE
40 
41 class MinDist : public Classifier
42 {
43 public:
52  MinDist(bool useScaling=false,bool useNullRejection=false,Float nullRejectionCoeff=10.0,UINT numClusters=10);
53 
59  MinDist(const MinDist &rhs);
60 
64  virtual ~MinDist(void);
65 
72  MinDist &operator=(const MinDist &rhs);
73 
81  virtual bool deepCopyFrom(const Classifier *classifier);
82 
90  virtual bool train_(ClassificationData &trainingData);
91 
99  virtual bool predict_(VectorFloat &inputVector);
100 
107  virtual bool clear();
108 
116  virtual bool saveModelToFile( std::fstream &file ) const;
117 
125  virtual bool loadModelFromFile( std::fstream &file );
126 
134  virtual bool recomputeNullRejectionThresholds();
135 
141  UINT getNumClusters() const;
142 
149 
157  virtual bool setNullRejectionCoeff(Float nullRejectionCoeff);
158 
166  bool setNumClusters(UINT numClusters);
167 
168 protected:
169  bool loadLegacyModelFromFile( std::fstream &file );
170 
171  UINT numClusters;
172  Vector< MinDistModel > models; //A buffer to hold all the models
173 
174 private:
175  static RegisterClassifierModule< MinDist > registerModule;
176 };
177 
178 } //End of namespace GRT
179 
180 #endif //GRT_MINDIST_HEADER
181 
virtual bool saveModelToFile(std::fstream &file) const
Definition: MinDist.cpp:261
virtual bool deepCopyFrom(const Classifier *classifier)
Definition: MinDist.cpp:71
Vector< MinDistModel > getModels() const
Definition: MinDist.cpp:257
MinDist & operator=(const MinDist &rhs)
Definition: MinDist.cpp:59
virtual bool clear()
Definition: MinDist.cpp:220
virtual bool predict_(VectorFloat &inputVector)
Definition: MinDist.cpp:162
virtual bool loadModelFromFile(std::fstream &file)
Definition: MinDist.cpp:303
This class implements the MinDist classifier algorithm.
virtual bool recomputeNullRejectionThresholds()
Definition: MinDist.cpp:231
bool loadLegacyModelFromFile(std::fstream &file)
Definition: MinDist.cpp:433
virtual bool train_(ClassificationData &trainingData)
Definition: MinDist.cpp:89
virtual ~MinDist(void)
Definition: MinDist.cpp:55
MinDist(bool useScaling=false, bool useNullRejection=false, Float nullRejectionCoeff=10.0, UINT numClusters=10)
Definition: MinDist.cpp:28
virtual bool setNullRejectionCoeff(Float nullRejectionCoeff)
Definition: MinDist.cpp:243
UINT getNumClusters() const
Definition: MinDist.cpp:253
bool setNumClusters(UINT numClusters)
Definition: MinDist.cpp:425