OpenPose  1.0.0rc2
OpenPose: A Real-Time Multi-Person Key-Point Detection And Multi-Threading C++ Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
handExtractor.hpp
Go to the documentation of this file.
1 #ifndef OPENPOSE_HAND_HAND_EXTRACTOR_HPP
2 #define OPENPOSE_HAND_HAND_EXTRACTOR_HPP
3 
4 #include <thread>
5 #include <opencv2/core/core.hpp> // cv::Mat
8 
9 namespace op
10 {
15  {
16  public:
25  explicit HandExtractor(const Point<int>& netInputSize, const Point<int>& netOutputSize,
26  const unsigned short numberScales = 1, const float rangeScales = 0.4f,
27  const std::vector<HeatMapType>& heatMapTypes = {},
28  const ScaleMode heatMapScale = ScaleMode::ZeroToOne);
29 
34  virtual ~HandExtractor();
35 
40  void initializationOnThread();
41 
51  virtual void forwardPass(const std::vector<std::array<Rectangle<float>, 2>> handRectangles,
52  const cv::Mat& cvInputData) = 0;
53 
54  std::array<Array<float>, 2> getHeatMaps() const;
55 
63  std::array<Array<float>, 2> getHandKeypoints() const;
64 
65  protected:
66  const std::pair<unsigned short, float> mMultiScaleNumberAndRange;
69  std::array<Array<float>, 2> mHandKeypoints;
70  // HeatMaps parameters
72  const std::vector<HeatMapType> mHeatMapTypes;
73  std::array<Array<float>, 2> mHeatMaps;
74 
75  virtual void netInitializationOnThread() = 0;
76 
77  private:
78  // Init with thread
79  std::thread::id mThreadId;
80 
81  void checkThread() const;
82 
84  };
85 }
86 
87 #endif // OPENPOSE_HAND_HAND_EXTRACTOR_HPP
const ScaleMode mHeatMapScaleMode
Definition: handExtractor.hpp:71
#define DELETE_COPY(className)
Definition: macros.hpp:30
const Point< int > mNetOutputSize
Definition: handExtractor.hpp:67
std::array< T, N > array
Definition: cl2.hpp:594
Array< float > mHandImageCrop
Definition: handExtractor.hpp:68
std::array< Array< float >, 2 > mHeatMaps
Definition: handExtractor.hpp:73
Definition: handExtractor.hpp:14
std::array< Array< float >, 2 > mHandKeypoints
Definition: handExtractor.hpp:69
const std::vector< HeatMapType > mHeatMapTypes
Definition: handExtractor.hpp:72
const std::pair< unsigned short, float > mMultiScaleNumberAndRange
Definition: handExtractor.hpp:66
ScaleMode
Definition: enumClasses.hpp:6
Definition: rectangle.hpp:11
std::vector< T, Alloc > vector
Definition: cl2.hpp:567
#define OP_API
Definition: macros.hpp:15