OpenPose  1.7.0
The first real-time multi-person system to jointly detect human body, hand, facial, and foot keypoints
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>
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
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 
48  };
49 }
50 
51 #endif // OPENPOSE_HAND_HAND_DETECTOR_HPP
HandDetector(const PoseModel poseModel)
void updateTracker(const std::array< Array< float >, 2 > &handKeypoints, const unsigned long long id)
std::vector< std::array< Rectangle< float >, 2 > > detectHands(const Array< float > &poseKeypoints) const
std::vector< std::array< Rectangle< float >, 2 > > trackHands(const Array< float > &poseKeypoints)
virtual ~HandDetector()
#define OP_API
Definition: macros.hpp:18
#define DELETE_COPY(className)
Definition: macros.hpp:32
PoseModel
Definition: enumClasses.hpp:10