OpenPose  1.0.0rc2
OpenPose: A Real-Time Multi-Person Key-Point Detection And Multi-Threading C++ Library
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros
handExtractorCaffe.hpp
Go to the documentation of this file.
1 #ifndef OPENPOSE_HAND_HAND_EXTRACTOR_CAFFE_HPP
2 #define OPENPOSE_HAND_HAND_EXTRACTOR_CAFFE_HPP
3 
4 #include <opencv2/core/core.hpp> // cv::Mat
8 
9 namespace op
10 {
15  {
16  public:
27  HandExtractorCaffe(const Point<int>& netInputSize, const Point<int>& netOutputSize,
28  const std::string& modelFolder, const int gpuId,
29  const unsigned short numberScales = 1, const float rangeScales = 0.4f,
30  const std::vector<HeatMapType>& heatMapTypes = {},
31  const ScaleMode heatMapScale = ScaleMode::ZeroToOne,
32  const bool enableGoogleLogging = true);
33 
38  virtual ~HandExtractorCaffe();
39 
44  void netInitializationOnThread();
45 
57  void forwardPass(const std::vector<std::array<Rectangle<float>, 2>> handRectangles, const cv::Mat& cvInputData,
58  const double scaleInputToOutput);
59 
60  private:
61  // PIMPL idiom
62  // http://www.cppsamples.com/common-tasks/pimpl.html
63  struct ImplHandExtractorCaffe;
64  std::unique_ptr<ImplHandExtractorCaffe> upImpl;
65 
66  void detectHandKeypoints(Array<float>& handCurrent, const double scaleInputToOutput, const int person,
67  const cv::Mat& affineMatrix);
68 
69  Array<float> getHeatMapsFromLastPass() const;
70 
71  // PIMP requires DELETE_COPY & destructor, or extra code
72  // http://oliora.github.io/2015/12/29/pimpl-and-rule-of-zero.html
74  };
75 }
76 
77 #endif // OPENPOSE_HAND_HAND_EXTRACTOR_CAFFE_HPP
#define DELETE_COPY(className)
Definition: macros.hpp:24
Definition: handExtractor.hpp:14
ScaleMode
Definition: enumClasses.hpp:6
Definition: rectangle.hpp:11
Definition: handExtractorCaffe.hpp:14
#define OP_API
Definition: macros.hpp:9