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.
ParticleClassifier.h
1 /*
2  GRT MIT License
3  Copyright (c) <2012> <Nicholas Gillian, Media Lab, MIT>
4 
5  Permission is hereby granted, free of charge, to any person obtaining a copy of this software
6  and associated documentation files (the "Software"), to deal in the Software without restriction,
7  including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
8  and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
9  subject to the following conditions:
10 
11  The above copyright notice and this permission notice shall be included in all copies or substantial
12  portions of the Software.
13 
14  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
15  LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
16  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
17  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
18  SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19  */
20 
21 #ifndef GRT_PARTICLE_CLASSIFIER_HEADER
22 #define GRT_PARTICLE_CLASSIFIER_HEADER
23 
24 #include "../../CoreModules/Classifier.h"
25 #include "ParticleClassifierParticleFilter.h"
26 
27 namespace GRT{
28 
30 {
31 public:
32 
36  ParticleClassifier(const unsigned int numParticles = 2000,const double sensorNoise = 20.0,const double transitionSigma = 0.005,const double phaseSigma = 0.1,const double velocitySigma = 0.01);
37 
46 
50  virtual ~ParticleClassifier(void);
51 
59 
67  virtual bool deepCopyFrom(const Classifier *classifier);
68 
76  virtual bool train_(TimeSeriesClassificationData &trainingData);
77 
85  virtual bool predict_(VectorDouble &inputVector);
86 
94  virtual bool saveModelToFile(fstream &file) const;
95 
103  virtual bool loadModelFromFile(fstream &file);
104 
110  virtual bool clear();
111 
117  virtual bool reset();
118 
119  const vector< ParticleClassifierGestureTemplate >& getGestureTemplates() const;
120 
121  const ParticleClassifierParticleFilter& getParticleFilter() const;
122 
123  VectorDouble getStateEstimation() const;
124 
125  double getPhase() const;
126 
127  double getVelocity() const;
128 
129  bool setNumParticles(const unsigned int numParticles);
130 
131  bool setSensorNoise(const unsigned int sensorNoise);
132 
133  bool setTransitionSigma(const unsigned int transitionSigma);
134 
135  bool setPhaseSigma(const unsigned int phaseSigma);
136 
137  bool setVelocitySigma(const unsigned int velocitySigma);
138 
139 
140  using MLBase::predict;
141  using MLBase::train;
142 
143 protected:
144  unsigned int numParticles;
145  double sensorNoise;
146  double transitionSigma;
147  double phaseSigma;
148  double velocitySigma;
149  ParticleClassifierParticleFilter particleFilter;
150 
151 private:
153 
154 
155 };
156 
157 }//End of namespace GRT
158 
159 #endif
Definition: AdaBoost.cpp:25
ParticleClassifier(const unsigned int numParticles=2000, const double sensorNoise=20.0, const double transitionSigma=0.005, const double phaseSigma=0.1, const double velocitySigma=0.01)
virtual bool saveModelToFile(fstream &file) const
virtual bool train(ClassificationData trainingData)
Definition: MLBase.cpp:80
virtual bool loadModelFromFile(fstream &file)
virtual bool predict(VectorDouble inputVector)
Definition: MLBase.cpp:104
virtual bool train_(TimeSeriesClassificationData &trainingData)
virtual bool deepCopyFrom(const Classifier *classifier)
ParticleClassifier & operator=(const ParticleClassifier &rhs)
virtual bool predict_(VectorDouble &inputVector)