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.
ClassificationSample.h
Go to the documentation of this file.
1 
26 #ifndef GRT_CLASSIFICATION_SAMPLE_HEADER
27 #define GRT_CLASSIFICATION_SAMPLE_HEADER
28 
29 #include "../Util/GRTCommon.h"
30 
31 GRT_BEGIN_NAMESPACE
32 
36 class GRT_API ClassificationSample{
37 public:
39  ClassificationSample(const UINT numDimensions);
40  ClassificationSample(const UINT classLabel,const VectorFloat &sample);
43 
44  ClassificationSample& operator= (const ClassificationSample &rhs){
45  if( this != &rhs){
46  this->classLabel = rhs.classLabel;
47  this->sample = rhs.sample;
48  this->numDimensions = rhs.numDimensions;
49  }
50  return *this;
51  }
52 
53  inline double& operator[] (const UINT &n){
54  return sample[n];
55  }
56 
57  inline const double& operator[] (const UINT &n) const{
58  return sample[n];
59  }
60 
61  bool clear();
62 
63  UINT getNumDimensions() const{ return numDimensions; }
64  UINT getClassLabel() const{ return classLabel; }
65  const VectorFloat& getSample() const{ return sample; }
66  VectorFloat& getSample() { return sample; }
67 
68  bool set(UINT classLabel,const VectorFloat &sample);
69  bool setClassLabel(const UINT classLabel);
70  bool setSample(const VectorFloat &sample);
71 
72 protected:
73  UINT numDimensions;
74  UINT classLabel;
75  VectorFloat sample;
76 
77 };
78 
79 GRT_END_NAMESPACE
80 
81 #endif // GRT_CLASSIFICATION_SAMPLE_HEADER
This class stores the class label and raw data for a single labelled classification sample...