OpenPose 1.0.0rc2 OpenPose: A Real-Time Multi-Person Key-Point Detection And Multi-Threading C++ Library

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
handDetector.hpp
Go to the documentation of this file.
1 #ifndef OPENPOSE_HAND_HAND_DETECTOR_HPP
2 #define OPENPOSE_HAND_HAND_DETECTOR_HPP
3
4 #include <mutex>
5 #include <openpose/core/common.hpp>
6 #include <openpose/pose/enumClasses.hpp>
7
8 namespace op
9 {
10 // Note: This class is thread-safe, so several GPUs can be running hands and using `updateTracker`, and updateTracker will keep the latest known
11 // tracking
12 class OP_API HandDetector
13 {
14 public:
15 explicit HandDetector(const PoseModel poseModel);
16
17 virtual ~HandDetector();
18
19 std::vector<std::array<Rectangle<float>, 2>> detectHands(const Array<float>& poseKeypoints) const;
20
21 std::vector<std::array<Rectangle<float>, 2>> trackHands(const Array<float>& poseKeypoints);
22
23 void updateTracker(const std::array<Array<float>, 2>& handKeypoints, const unsigned long long id);
24
25 private:
26 enum class PosePart : unsigned int
27 {
28 LWrist = 0,
29 LElbow,
30 LShoulder,
31 RWrist,
32 RElbow,
33 RShoulder,
34 Size,
35 };
36
37 const std::array<unsigned int, (int)PosePart::Size> mPoseIndexes;
38 std::vector<std::array<Point<float>, (int)PosePart::Size>> mPoseTrack;
39 std::vector<Rectangle<float>> mHandLeftPrevious;
40 std::vector<Rectangle<float>> mHandRightPrevious;
41 unsigned long long mCurrentId;
42 std::mutex mMutex;
43
44 std::array<unsigned int, (int)PosePart::Size> getPoseKeypoints(const PoseModel poseModel,
45 const std::array<std::string, (int)PosePart::Size>& poseStrings) const;
46
47 DELETE_COPY(HandDetector);
48 };
49 }
50
51 #endif // OPENPOSE_HAND_HAND_DETECTOR_HPP
op::CocoJsonFormat::Size
DELETE_COPY
#define DELETE_COPY(className)
Definition: macros.hpp:34
enumClasses.hpp
cl::array
std::array< T, N > array
Definition: cl2.hpp:594
op::HandDetector
Definition: handDetector.hpp:12
op::PoseModel
PoseModel
Definition: enumClasses.hpp:9
common.hpp
op::Array< float >
OP_API
#define OP_API
Definition: macros.hpp:19
cl::string
std::string string
Definition: cl2.hpp:574