31 #ifndef GRT_SWIPE_DETECTION_HEADER
32 #define GRT_SWIPE_DETECTION_HEADER
34 #include "../../CoreModules/Classifier.h"
35 #include "../../Util/ThresholdCrossingDetector.h"
36 #include "../../PreProcessingModules/MedianFilter.h"
48 SwipeDetector(
const unsigned int swipeIndex = 0,
const unsigned int swipeThreshold = 100,
49 const unsigned int hysteresisThreshold =0,
const unsigned int swipeDirection = POSITIVE_SWIPE,
bool useScaling=
false);
80 bool init(
const unsigned int numInputDimensions);
106 virtual bool clear();
113 virtual bool reset();
122 virtual bool save( std::fstream &file )
const;
131 virtual bool load( std::fstream &file );
136 bool getSwipeDetected()
const;
141 Float getSwipeValue()
const;
146 Float getSwipeThreshold()
const ;
151 Float getHysteresisThreshold()
const;
158 Float getMovementVelocity()
const;
163 Float getMovementThreshold()
const;
168 Float getContextValue()
const;
173 Float getSwipeIntegrationCoeff()
const;
179 bool setContext(
const bool context);
188 bool setSwipeIndex(
const unsigned int swipeIndex);
195 bool setSwipeDirection(
const unsigned int swipeDirection);
203 bool setSwipeThreshold(
const Float swipeThreshold);
211 bool setHysteresisThreshold(
const Float hysteresisThreshold);
220 bool setMovementThreshold(
const Float movementThreshold);
228 bool setSwipeIntegrationCoeff(
const Float swipeIntegrationCoeff);
241 unsigned int swipeIndex;
242 unsigned int swipeDirection;
243 unsigned int contextFilterSize;
244 Float swipeIntegrationCoeff;
245 Float movementIntegrationCoeff;
246 Float swipeThreshold;
247 Float hysteresisThreshold;
249 Float movementVelocity;
250 Float movementThreshold;
251 Float contextFilteredValue;
253 GRT::ThresholdCrossingDetector thresholdDetector;
254 GRT::MedianFilter contextFilter;
259 enum SwipeDirections{POSITIVE_SWIPE=0,NEGATIVE_SWIPE};
264 #endif //GRT_SWIPE_DETECTION_HEADER
virtual bool predict_(VectorFloat &inputVector)
virtual bool save(const std::string filename) const
virtual bool load(const std::string filename)
virtual bool deepCopyFrom(const Classifier *classifier)
virtual bool train_(ClassificationData &trainingData)