ST / Mbed 2 deprecated 53L0A1_HandGestureRecognition

Dependencies:   X_NUCLEO_53L0A1 mbed

Fork of 53L0A1_HandGestureRecognition by Licio Mapelli

Embed: (wiki syntax)

« Back to documentation index

Single SWIPE (1)

Single SWIPE (1)
[Tof_gestures]

Single Swipe gesture detection based on dynamic thresholds applied on range (single ToF device) More...

Data Structures

struct  Gesture_SWIPE_1_Data_t
 Data structure for single swipe gesture detection. More...

Functions

int tof_gestures_initSWIPE_1 (Gesture_SWIPE_1_Data_t *data)
 Initialize gesture data.
int tof_gestures_detectSWIPE_1 (int32_t range_mm, Gesture_SWIPE_1_Data_t *data)
 Detect gesture.

Detailed Description

Single Swipe gesture detection based on dynamic thresholds applied on range (single ToF device)

Description
This tof_gestures module allows to detect in a very robust way a single SWIPE (hand, finger, object) with a single ToF device. Returned gestures code are one of the following ones : GESTURES_HAND_ENTERING, GESTURES_HAND_LEAVING, GESTURES_SINGLE_SWIPE during swipe detection or GESTURES_NULL, GESTURES_DISCARDED, GESTURES_DISCARDED_TOO_SLOW in case SWIPE is not detected or discarded.
Algorithm Description
The approach consists in collecting __range__ samples over the time to get the background distance when no object is crossing the device FoV. A variation of the returned distance versus the background is detected as a hand/object entering in the FoV. A simple state machine is used to detect when the object will go out from the FoV. This module allows to detect any kind of swipes at all speeds (very low, medium and very fast) and with any tilts of the hand.
Algorithm tuning
A set of macros are defined in the module header file to tune the swipe detection.
Known Limitations
  • A gesture with hand leaving the FoV from the top direction (instead of left/right) may be detected as Swipe
  • A Swipe may be wrongly detected when an object is placed at the border of the device FoV

Function Documentation

int tof_gestures_detectSWIPE_1 ( int32_t  range_mm,
Gesture_SWIPE_1_Data_t data 
)

Detect gesture.

Returns:
One of these gestures code from Gestures_Code_t : GESTURES_HAND_ENTERING, GESTURES_HAND_LEAVING, GESTURES_SINGLE_SWIPE or GESTURES_NULL, GESTURES_DISCARDED, GESTURES_DISCARDED_TOO_SLOW
Warning:
This function must be called all the time, even if no valid range_mm is available from the ToF device. In that case, call the function with the typical max ranging capability of the device

Definition at line 49 of file tof_gestures_SWIPE_1.c.

int tof_gestures_initSWIPE_1 ( Gesture_SWIPE_1_Data_t data )

Initialize gesture data.

Returns:
0 on success

Definition at line 39 of file tof_gestures_SWIPE_1.c.