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.
PrincipalComponentAnalysis.h
Go to the documentation of this file.
1 
43 #ifndef GRT_PRINCIPAL_COMPONENT_ANALYSIS_HEADER
44 #define GRT_PRINCIPAL_COMPONENT_ANALYSIS_HEADER
45 
46 #include "../../Util/GRTCommon.h"
47 #include "../../CoreModules/GRTBase.h"
48 
49 namespace GRT{
50 
52  public:
57 
62 
76  bool computeFeatureVector(const MatrixDouble &data,double maxVariance=0.95,bool normData=false);
77 
89  bool computeFeatureVector(const MatrixDouble &data,UINT numPrincipalComponents,bool normData=false);
90 
100  bool project(const MatrixDouble &data,MatrixDouble &prjData);
101 
111  bool project(const VectorDouble &data,VectorDouble &prjData);
112 
117  bool getTrained() const { return trained; }
118 
123  bool getNormData() const { return normData; }
124 
129  UINT getNumInputDimensions() const { return numInputDimensions; }
130 
135  UINT getNumPrincipalComponents() const { return numPrincipalComponents; }
136 
141  double getMaxVariance() const { return maxVariance; }
142 
148  VectorDouble getMeanVector() const { return mean; }
149 
156  VectorDouble getStdDevVector() const { return stdDev; }
157 
162  VectorDouble getComponentWeights() const { return componentWeights; }
163 
168  VectorDouble getEigenValues() const { return eigenvalues; }
169 
174  virtual bool print(string title="") const;
175 
181 
182 protected:
183  bool computeFeatureVector_(const MatrixDouble &data,UINT analysisMode);
184 
185  bool trained;
186  bool normData;
187  UINT numInputDimensions;
188  UINT numPrincipalComponents;
189  double maxVariance;
190  VectorDouble mean;
191  VectorDouble stdDev;
192  VectorDouble componentWeights;
193  VectorDouble eigenvalues;
194  vector< IndexedDouble > sortedEigenvalues;
195  MatrixDouble eigenvectors;
196 
197  ErrorLog errorLog;
198  WarningLog warningLog;
199 
200  enum AnalysisMode{MAX_VARIANCE=0,MAX_NUM_PCS};
201 
202 };
203 
204 }//End of namespace GRT
205 
206 #endif //GRT_PRINCIPAL_COMPONENT_ANALYSIS_HEADER
207 
208 
Definition: AdaBoost.cpp:25
virtual bool print(string title="") const
bool computeFeatureVector(const MatrixDouble &data, double maxVariance=0.95, bool normData=false)
bool project(const MatrixDouble &data, MatrixDouble &prjData)