Simulated Reality SDK 7500c78d v1.30.2.51085 2024-04-26T11:23:03Z
Stable
gestureRecognizer.h
Go to the documentation of this file.
1
10#pragma once
11
12// The gesture recognizer functionality is only available for 64-bit Windows applications
13#ifdef _WIN64
14
16#include "opencv2/opencv.hpp"
17#include <fstream>
18#include <cstring>
20#include "sr/utility/logging.h"
21#include <memory>
22
23#ifdef WIN32
24# ifdef COMPILING_DLL_SimulatedRealityHandTrackers
25# define DIMENCOSR_API __declspec(dllexport)
26# else
27# define DIMENCOSR_API __declspec(dllimport)
28# endif
29#else
30# define DIMENCOSR_API
31#endif
32
33namespace SR {
38 class DIMENCOSR_API GestureRecognizerException : public SR::Exception {
39 public:
44 GestureRecognizerException(std::string specificErrorMessage);
45 };
46
51 enum SR_gestureName {
52 FIST,
53 POINT,
54 PINCH,
55 FLAT,
56 PINCHGRABRELEASE
57 };
58
63 enum SR_gestureClassificationModel {
64 NN4,
65 NN5
66 };
67
72 struct SR_gestureData {
73 SR_gestureName gestureName;
74 float prob;
75 };
76
85 class DIMENCOSR_API GestureRecognizer {
86 private:
87 class Impl;
93#pragma warning(suppress: 4251)
94 std::unique_ptr<Impl> pimpl;
95
96 public:
105 GestureRecognizer(SR_gestureClassificationModel nnModel);
106
110 ~GestureRecognizer();
111
117 SR_gestureData predict(SR_handPose pose);
118 };
119}
120
121#undef DIMENCOSR_API
122
123#endif
Class of exception which indicates a general SR logic error.
Definition: exception.h:40
Namespace containing all C++ Simulated Reality classes.
Definition: srconfiguration.h:25
#define DIMENCOSR_API
Definition: srconfiguration.h:22
C-compatible struct containing the pose of a hand.
Definition: handpose.h:124