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 
53  virtual void forwardPass(const std::vector<std::array<Rectangle<float>, 2>> handRectangles,
54  const cv::Mat& cvInputData,
55  const double scaleInputToOutput) = 0;
56 
57  std::array<Array<float>, 2> getHeatMaps() const;
58 
66  std::array<Array<float>, 2> getHandKeypoints() const;
67 
68  protected:
69  const std::pair<unsigned short, float> mMultiScaleNumberAndRange;
72  std::array<Array<float>, 2> mHandKeypoints;
73  // HeatMaps parameters
75  const std::vector<HeatMapType> mHeatMapTypes;
76  std::array<Array<float>, 2> mHeatMaps;
77 
78  virtual void netInitializationOnThread() = 0;
79 
80  private:
81  // Init with thread
82  std::thread::id mThreadId;
83 
84  void checkThread() const;
85 
87  };
88 }
89 
90 #endif // OPENPOSE_HAND_HAND_EXTRACTOR_HPP
const ScaleMode mHeatMapScaleMode
Definition: handExtractor.hpp:74
#define DELETE_COPY(className)
Definition: macros.hpp:30
const Point< int > mNetOutputSize
Definition: handExtractor.hpp:70
std::array< T, N > array
Definition: cl2.hpp:594
Array< float > mHandImageCrop
Definition: handExtractor.hpp:71
std::array< Array< float >, 2 > mHeatMaps
Definition: handExtractor.hpp:76
Definition: handExtractor.hpp:14
std::array< Array< float >, 2 > mHandKeypoints
Definition: handExtractor.hpp:72
const std::vector< HeatMapType > mHeatMapTypes
Definition: handExtractor.hpp:75
const std::pair< unsigned short, float > mMultiScaleNumberAndRange
Definition: handExtractor.hpp:69
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