Gesture Classification System
APIs for the Gesture Classification system. More...
Classes
Name | |
---|---|
struct | MLGestureClassificationStaticData Static information about the gesture classification. |
struct | MLGestureClassificationPostureFingerData Gesture classification posture related finger data. |
struct | MLGestureClassificationFingerState Gesture classification state of a single finger. |
struct | MLGestureClassificationState Gesture classification state of a single hand. |
struct | MLGestureClassificationData Data which is received when querying tracker from MLGestureClassificationGetData(). |
Types
Name | |
---|---|
typedef struct MLGestureClassificationStaticData | MLGestureClassificationStaticData Static information about the gesture classification. |
typedef struct MLGestureClassificationPostureFingerData | MLGestureClassificationPostureFingerData Gesture classification posture related finger data. |
typedef struct MLGestureClassificationFingerState | MLGestureClassificationFingerState Gesture classification state of a single finger. |
typedef struct MLGestureClassificationState | MLGestureClassificationState Gesture classification state of a single hand. |
typedef struct MLGestureClassificationData | MLGestureClassificationData Data which is received when querying tracker from MLGestureClassificationGetData(). |
Enums
Functions
Name | |
---|---|
void | MLGestureClassificationStaticDataInit(MLGestureClassificationStaticData * inout_data) Initializes default values for MLGestureClassificationStaticData. |
void | MLGestureClassificationDataInit(MLGestureClassificationData * inout_data) Initializes default values for MLGestureClassificationData. |
MLResult | MLGestureClassificationCreate(MLHandle * out_handle) Creates a gesture classification tracker. |
MLResult | MLGestureClassificationDestroy(MLHandle handle) Destroys a gesture classification tracker. |
MLResult | MLGestureClassificationGetStaticData(MLHandle handle, MLGestureClassificationStaticData * out_data) Gets static information about the gesture classification. |
MLResult | MLGestureClassificationGetData(MLHandle handle, MLGestureClassificationData * out_data) Queries the state of the gesture classification. |
Detailed Description
APIs for the Gesture Classification system.
- Postures (MLGestureClassificationPostureType).
- Key Poses (MLGestureClassificationKeyPoseType).
Postures
Postures is a collection of hand configuration that allows for meaningful variations of the same configuration. For example a hand configuration is classified as pinch posture when the index and thumb tip is touching while the other three fingers are fully extended. At the same time a hand configuration where the index and thumb tips are touching but the other three fingers are partially curled will still be treated as a pinch posture.
Postures will be more accommodative to variations seen between users and the same user doing the gesture in slightly different ways.
Postures will work well for use cases where the user is interacting with the UI over time. Examples: grab and move, point and click.
KeyPoses
KeyPoses on the other hand is a discrete collection of static hand configurations. It looks for specific geometric relationship between the hand key points.
KeyPoses will work well for use cases where the user need a on-off switch, a button. Examples: start capture, save session.
Point
The interaction point is a transform which dynamically adapts, in both translation and rotation, based on the current classified posture (MLGestureClassificationPostureType). It provides a single optimal point of reference to simplify common direct and indirect hand interactions.
Shared Object:
- perception.magicleap*
Enums Documentation
MLGestureClassificationHandType
Enumerator | Value | Description |
---|---|---|
MLGestureClassificationHandType_Left | 0 | Left hand. |
MLGestureClassificationHandType_Right | 1 | Right hand. |
MLGestureClassificationHandType_Count | 2 | Number of hands. |
MLGestureClassificationHandType_Ensure32Bits | 0x7FFFFFFF | Ensure enum is represented as 32 bits. |
Available hand types.
MLGestureClassificationPostureType
Enumerator | Value | Description |
---|---|---|
MLGestureClassificationPostureType_None | 0 | None. |
MLGestureClassificationPostureType_Pinch | 1 | Pinch posture. |
MLGestureClassificationPostureType_Point | 2 | Point posture. |
MLGestureClassificationPostureType_Grasp | 3 | Grasp posture. |
MLGestureClassificationPostureType_Open | 4 | Open hand. |
MLGestureClassificationPostureType_Ensure32Bits | 0x7FFFFFFF | Ensure enum is represented as 32 bits. |
System gesture classification posture type.
API Level:
- 20
MLGestureClassificationKeyPoseType
Enumerator | Value | Description |
---|---|---|
MLGestureClassificationKeyPoseType_None | 0 | None. |
MLGestureClassificationKeyPoseType_OK | 1 | OK pose. |
MLGestureClassificationKeyPoseType_C | 2 | C pose. |
MLGestureClassificationKeyPoseType_Pinch | 3 | Pinch pose. |
MLGestureClassificationKeyPoseType_Finger | 4 | Finger pose. |
MLGestureClassificationKeyPoseType_L | 5 | L pose. |
MLGestureClassificationKeyPoseType_Thumb | 6 | Thumb up pose. |
MLGestureClassificationKeyPoseType_Fist | 7 | Fist pose. |
MLGestureClassificationKeyPoseType_Open | 8 | Open pose. |
MLGestureClassificationKeyPoseType_Ensure32Bits | 0x7FFFFFFF | Ensure enum is represented as 32 bits. |
System gesture classification key pose type.
API Level:
- 20
Types Documentation
MLGestureClassificationStaticData
typedef struct MLGestureClassificationStaticData MLGestureClassificationStaticData;
Static information about the gesture classification.
Populate with MLGestureClassificationGetStaticData(). This structure must be initialized by calling MLGestureClassificationStaticDataInit() before use.
API Level:
- 20
MLGestureClassificationPostureFingerData
typedef struct MLGestureClassificationPostureFingerData MLGestureClassificationPostureFingerData;
Gesture classification posture related finger data.
Pinch values are measured between the finger and thumb. In case thumb is the finger, values are same with index's values.
API Level:
- 20
MLGestureClassificationFingerState
typedef struct MLGestureClassificationFingerState MLGestureClassificationFingerState;
Gesture classification state of a single finger.
API Level:
- 20
MLGestureClassificationState
typedef struct MLGestureClassificationState MLGestureClassificationState;
Gesture classification state of a single hand.
API Level:
- 20
MLGestureClassificationData
typedef struct MLGestureClassificationData MLGestureClassificationData;
Data which is received when querying tracker from MLGestureClassificationGetData().
This structure must be initialized by calling MLGestureClassificationDataInit() before use.
API Level:
- 20
Functions Documentation
MLGestureClassificationStaticDataInit
static inline void MLGestureClassificationStaticDataInit(
MLGestureClassificationStaticData * inout_data
)
Initializes default values for MLGestureClassificationStaticData.
Parameters
MLGestureClassificationStaticData * | inout_data | The object to initialize with default settings. |
API Level:
- 20
MLGestureClassificationDataInit
static inline void MLGestureClassificationDataInit(
MLGestureClassificationData * inout_data
)
Initializes default values for MLGestureClassificationData.
Parameters
MLGestureClassificationData * | inout_data | The object to initialize with default settings. |
API Level:
- 20
MLGestureClassificationCreate
MLResult MLGestureClassificationCreate(
MLHandle * out_handle
)
Creates a gesture classification tracker.
Parameters
MLHandle * | out_handle | A handle to the created gesture classification tracker. Only valid if the return value is MLResult_Ok. |
Returns
MLResult | MLResult_InvalidParam | Failed to create a tracker due to an invalid parameter. |
MLResult | MLResult_Ok | The tracker was created successfully. |
MLResult | MLResult_PerceptionSystemNotStarted | Perception System has not been started. |
MLResult | MLResult_PrivilegeDenied | The application lacks privilege. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- com.magicleap.permission.HAND_TRACKING (protection level: normal)
API Level:
- 20
MLGestureClassificationDestroy
MLResult MLGestureClassificationDestroy(
MLHandle handle
)
Destroys a gesture classification tracker.
Parameters
MLHandle | handle | A handle to a gesture classification tracker created by MLGestureClassificationCreate(). |
Returns
MLResult | MLResult_InvalidParam | Failed to destroy a tracker due to an invalid parameter. |
MLResult | MLResult_Ok | It successfully destroyed the tracker. |
MLResult | MLResult_PerceptionSystemNotStarted | Perception System has not been started. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
API Level:
- 20
MLGestureClassificationGetStaticData
MLResult MLGestureClassificationGetStaticData(
MLHandle handle,
MLGestureClassificationStaticData * out_data
)
Gets static information about the gesture classification.
Parameters
MLHandle | handle | A handle to a gesture classification tracker created by MLGestureClassificationCreate(). |
MLGestureClassificationStaticData * | out_data | Target to populate the data about the gesture classification. |
Returns
MLResult | MLResult_InvalidParam | Failed to get static data due to an invalid parameter. |
MLResult | MLResult_Ok | Gesture classification static data was successfully received. |
MLResult | MLResult_PerceptionSystemNotStarted | Perception System has not been started. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
API Level:
- 20
MLGestureClassificationGetData
MLResult MLGestureClassificationGetData(
MLHandle handle,
MLGestureClassificationData * out_data
)
Queries the state of the gesture classification.
Parameters
MLHandle | handle | A handle to a gesture classification tracker created by MLGestureClassificationCreate(). |
MLGestureClassificationData * | out_data | Pointer to MLGestureClassificationData structure. |
Returns
MLResult | MLResult_InvalidParam | Failed to retrieve data due to an invalid parameter. |
MLResult | MLResult_Ok | The state information was available and the information in out_data is valid. |
MLResult | MLResult_PerceptionSystemNotStarted | Perception System has not been started. |
MLResult | MLResult_UnspecifiedFailure | The operation failed with an unspecified error. |
Required Permissions:
- None
API Level:
- 20