26 #ifndef GRT_SWIPE_DETECTION_HEADER 27 #define GRT_SWIPE_DETECTION_HEADER 29 #include "../../CoreModules/Classifier.h" 30 #include "../../Util/ThresholdCrossingDetector.h" 31 #include "../../PreProcessingModules/MedianFilter.h" 43 enum SwipeDirections{POSITIVE_SWIPE=0,NEGATIVE_SWIPE};
50 SwipeDetector(
const unsigned int swipeIndex = 0,
const unsigned int swipeThreshold = 100,
51 const unsigned int hysteresisThreshold =0,
const unsigned int swipeDirection = POSITIVE_SWIPE,
bool useScaling=
false);
82 bool init(
const unsigned int numInputDimensions);
108 virtual bool clear();
115 virtual bool reset();
124 virtual bool save( std::fstream &file )
const;
133 virtual bool load( std::fstream &file );
138 bool getSwipeDetected()
const;
143 Float getSwipeValue()
const;
148 Float getSwipeThreshold()
const ;
153 Float getHysteresisThreshold()
const;
160 Float getMovementVelocity()
const;
165 Float getMovementThreshold()
const;
170 Float getContextValue()
const;
175 Float getSwipeIntegrationCoeff()
const;
181 bool setContext(
const bool context);
190 bool setSwipeIndex(
const unsigned int swipeIndex);
197 bool setSwipeDirection(
const unsigned int swipeDirection);
205 bool setSwipeThreshold(
const Float swipeThreshold);
213 bool setHysteresisThreshold(
const Float hysteresisThreshold);
222 bool setMovementThreshold(
const Float movementThreshold);
230 bool setSwipeIntegrationCoeff(
const Float swipeIntegrationCoeff);
237 static std::string
getId();
250 unsigned int swipeIndex;
251 unsigned int swipeDirection;
252 unsigned int contextFilterSize;
253 Float swipeIntegrationCoeff;
254 Float movementIntegrationCoeff;
255 Float swipeThreshold;
256 Float hysteresisThreshold;
258 Float movementVelocity;
259 Float movementThreshold;
260 Float contextFilteredValue;
262 GRT::ThresholdCrossingDetector thresholdDetector;
263 GRT::MedianFilter contextFilter;
266 static const std::string id;
272 #endif //GRT_SWIPE_DETECTION_HEADER std::string getId() const
virtual bool predict_(VectorFloat &inputVector)
virtual bool save(const std::string &filename) const
virtual bool deepCopyFrom(const Classifier *classifier)
virtual bool train_(ClassificationData &trainingData)
This class implements a basic swipe detection classification algorithm.
virtual bool load(const std::string &filename)
This is the main base class that all GRT Classification algorithms should inherit from...