GestureRecognitionToolkit
Version: 0.2.0
The Gesture Recognition Toolkit (GRT) is a cross-platform, open-source, c++ machine learning library for real-time gesture recognition.
Main Page
Related Pages
Classes
Files
Examples
File List
File Members
ClassLabelTimeoutFilter.h
Go to the documentation of this file.
1
35
#ifndef GRT_CLASS_LABEL_TIMEOUT_FILTER_HEADER
36
#define GRT_CLASS_LABEL_TIMEOUT_FILTER_HEADER
37
38
#include "../Util/GRTCommon.h"
39
#include "../CoreModules/PostProcessing.h"
40
41
GRT_BEGIN_NAMESPACE
42
43
class
GRT_API
ClassLabelAndTimer
{
44
public
:
45
ClassLabelAndTimer
(){
46
classLabel = 0;
47
}
48
ClassLabelAndTimer
(UINT classLabel,
unsigned
long
timeoutDuration){
49
this->classLabel = classLabel;
50
timer.start(timeoutDuration);
51
}
52
53
//Setters
54
bool
set(UINT classLabel,
unsigned
long
timeoutDuration){
55
if
( classLabel > 0 && timeoutDuration > 0 ){
56
this->classLabel = classLabel;
57
timer.start(timeoutDuration);
58
return
true
;
59
}
60
return
false
;
61
}
62
63
//Getters
64
UINT getClassLabel(){
return
classLabel; }
65
bool
timerReached(){
return
timer.timerReached(); }
66
unsigned
long
getRemainingTime(){
return
timer.getMilliSeconds(); }
67
68
protected
:
69
UINT classLabel;
70
Timer
timer;
71
};
72
73
class
GRT_API
ClassLabelTimeoutFilter
:
public
PostProcessing
{
74
public
:
95
ClassLabelTimeoutFilter
(
unsigned
long
timeoutDuration = 1000,UINT filterMode = ALL_CLASS_LABELS);
96
104
ClassLabelTimeoutFilter
(
const
ClassLabelTimeoutFilter
&rhs);
105
109
virtual
~
ClassLabelTimeoutFilter
();
110
117
ClassLabelTimeoutFilter
& operator=(
const
ClassLabelTimeoutFilter
&rhs);
118
127
virtual
bool
deepCopyFrom
(
const
PostProcessing
*postProcessing);
128
137
virtual
bool
process
(
const
VectorDouble
&inputVector);
138
146
virtual
bool
reset
();
147
155
virtual
bool
saveModelToFile
( std::string filename )
const
;
156
164
virtual
bool
saveModelToFile
( std::fstream &file )
const
;
165
173
virtual
bool
loadModelFromFile
( std::string filename );
174
182
virtual
bool
loadModelFromFile
( std::fstream &file );
183
191
bool
init
(
unsigned
long
timeoutDuration,UINT filterMode = ALL_CLASS_LABELS);
192
199
UINT filter(UINT predictedClassLabel);
200
206
UINT
getFilteredClassLabel
(){
return
filteredClassLabel; }
207
213
bool
isTimeoutActive();
214
227
bool
setTimeoutDuration(
unsigned
long
timeoutDuration);
228
248
bool
setFilterMode(UINT filterMode);
249
250
enum
FilterModes{ALL_CLASS_LABELS=0,INDEPENDENT_CLASS_LABELS};
251
252
protected
:
253
UINT filteredClassLabel;
254
UINT filterMode;
255
unsigned
long
timeoutDuration;
256
Vector< ClassLabelAndTimer >
classLabelTimers;
257
258
static
RegisterPostProcessingModule< ClassLabelTimeoutFilter >
registerModule;
259
};
260
261
GRT_END_NAMESPACE
262
263
#endif //GRT_CLASS_LABEL_TIMEOUT_FILTER_HEADER
PostProcessing::deepCopyFrom
virtual bool deepCopyFrom(const PostProcessing *postProcessing)
Definition:
PostProcessing.h:57
Timer
Definition:
Timer.h:43
ClassLabelTimeoutFilter
Definition:
ClassLabelTimeoutFilter.h:73
PostProcessing::process
virtual bool process(const VectorFloat &inputVector)
Definition:
PostProcessing.h:73
RegisterPostProcessingModule< ClassLabelTimeoutFilter >
ClassLabelTimeoutFilter::getFilteredClassLabel
UINT getFilteredClassLabel()
Definition:
ClassLabelTimeoutFilter.h:206
PostProcessing
Definition:
PostProcessing.h:38
PostProcessing::loadModelFromFile
virtual bool loadModelFromFile(std::string filename)
Definition:
PostProcessing.cpp:110
VectorFloat
Definition:
VectorFloat.h:33
ClassLabelAndTimer
Definition:
ClassLabelTimeoutFilter.h:43
PostProcessing::reset
virtual bool reset()
Definition:
PostProcessing.h:81
PostProcessing::init
bool init()
Definition:
PostProcessing.cpp:79
Vector< ClassLabelAndTimer >
PostProcessing::saveModelToFile
virtual bool saveModelToFile(std::string filename) const
Definition:
PostProcessing.cpp:96
GRT
PostProcessingModules
ClassLabelTimeoutFilter.h
Generated on Sun Aug 7 2016 19:16:03 for GestureRecognitionToolkit by
1.8.11