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 TAP (1)

Single Tap gesture detection based on simple analysis (MAD) of range (single ToF device) More...

Data Structures

struct  Gesture_TAP_1_Data_t
 Data structure for single tap gesture detection. More...

Functions

int tof_gestures_initTAP_1 (int MinBackGroundDistance, Gesture_TAP_1_Data_t *data)
 Initialize gesture data.
int tof_gestures_detectTAP_1 (int32_t range_mm, Gesture_TAP_1_Data_t *data)
 Detect gesture.

Detailed Description

Single Tap gesture detection based on simple analysis (MAD) of range (single ToF device)

Description
This tof_gestures module allows to detect in a very robust way a single TAP (flat hand going down) with a single ToF device. Returned gestures code are one of the following ones : GESTURES_SINGLE_TAP or GESTURES_NULL in case no TAP is detected.
Algorithm Description
The approach consists in collecting __range__ samples when a target (hand) is detected by the ranging device. Then, MAD (Mean of Absolute Difference versus the mean) is calculated and TAP gesture is detected based on a threshold. Some false TAP detections could happen in case a target is detected in the background (behind the han). To avoid these false detections, set the MinBackGroundDistance to the minimum distance a background target can be detected in the application. If no background, set MinBackGroundDistance to a big value

Function Documentation

int tof_gestures_detectTAP_1 ( int32_t  range_mm,
Gesture_TAP_1_Data_t data 
)

Detect gesture.

Returns:
One of these gestures code from Gestures_Code_t : GESTURES_SINGLE_TAP or GESTURES_NULL
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 51 of file tof_gestures_TAP_1.c.

int tof_gestures_initTAP_1 ( int  MinBackGroundDistance,
Gesture_TAP_1_Data_t data 
)

Initialize gesture data.

Returns:
0 on success

Definition at line 39 of file tof_gestures_TAP_1.c.