GECKO 1.0
Human-computer interface based on hand gesture recognition
|
00001 //------------------------------------------------------------------------------ 00002 //-- StateMachine 00003 //------------------------------------------------------------------------------ 00004 //-- 00005 //-- Simple state machine for value tracking and event recognition 00006 //-- 00007 //------------------------------------------------------------------------------ 00008 //-- 00009 //-- This file belongs to the "Gecko - Gesture Recognition" project 00010 //-- (https://github.com/David-Estevez/gecko) 00011 //-- 00012 //------------------------------------------------------------------------------ 00013 //-- Authors: David Estevez Fernandez 00014 //-- Irene Sanz Nieto 00015 //-- 00016 //-- Released under the GPL license (more info on LICENSE.txt file) 00017 //------------------------------------------------------------------------------ 00018 00027 #ifndef STATEMACHINE_H 00028 #define STATEMACHINE_H 00029 00041 class StateMachine 00042 { 00043 public: 00049 StateMachine( int value_to_track, unsigned int min_positive_matches, unsigned int max_negative_matches ); 00050 00054 void update(int current_value ); 00055 00057 void reset( ); 00058 00059 00060 int getValue_to_track() const; 00061 void setValue_to_track(const int &value); 00062 00063 float getPercentageMatches(); 00064 00065 bool getFound(); 00066 00067 private: 00068 int value_to_track; 00069 00070 unsigned int min_positive_matches; 00071 unsigned int current_positive_matches; 00072 00073 unsigned int max_negative_matches; 00074 unsigned int current_negative_matches; 00075 00076 bool found; 00077 00078 }; 00079 00080 #endif