LeiaSR SDK 720218b2 v1.32.7.6322 2025-02-13T14:55:38Z
Stable
gestureRecognizer.h
Go to the documentation of this file.
1
5#pragma once
6
7// The gesture recognizer functionality is only available for 64-bit Windows applications
8#ifdef _WIN64
9
11#include "opencv2/opencv.hpp"
12#include <fstream>
13#include <cstring>
15#include "sr/utility/logging.h"
16#include <memory>
17
18#ifdef WIN32
19# ifdef COMPILING_DLL_SimulatedRealityHandTrackers
20# define DIMENCOSR_API __declspec(dllexport)
21# else
22# define DIMENCOSR_API __declspec(dllimport)
23# endif
24#else
25# define DIMENCOSR_API
26#endif
27
28namespace SR {
33 class DIMENCOSR_API GestureRecognizerException : public SR::Exception {
34 public:
39 GestureRecognizerException(std::string specificErrorMessage);
40 };
41
46 enum SR_gestureName {
47 FIST,
48 POINT,
49 PINCH,
50 FLAT,
51 PINCHGRABRELEASE
52 };
53
58 enum SR_gestureClassificationModel {
59 NN4,
60 NN5
61 };
62
67 struct SR_gestureData {
68 SR_gestureName gestureName;
69 float prob;
70 };
71
80 class DIMENCOSR_API GestureRecognizer {
81 private:
82 class Impl;
88#pragma warning(suppress: 4251)
89 std::unique_ptr<Impl> pimpl;
90
91 public:
100 GestureRecognizer(SR_gestureClassificationModel nnModel);
101
105 ~GestureRecognizer();
106
112 SR_gestureData predict(SR_handPose pose);
113 };
114}
115
116#undef DIMENCOSR_API
117
118#endif
Class of exception which indicates a general SR logic error.
Definition: exception.h:35
Namespace containing all C++ Simulated Reality classes.
Definition: srconfiguration.h:20
#define DIMENCOSR_API
Definition: srconfiguration.h:17
C-compatible struct containing the pose of a hand.
Definition: handpose.h:119