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
handExtractorNet.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 <atomic>
5 #include <opencv2/core/core.hpp> // cv::Mat
6 #include <openpose/core/common.hpp>
7 #include <openpose/core/enumClasses.hpp>
8
9 namespace op
10 {
14 class OP_API HandExtractorNet
15 {
16 public:
25 explicit HandExtractorNet(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 ~HandExtractorNet();
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 bool getEnabled() const;
66
67 void setEnabled(const bool enabled);
68
69 protected:
70 const std::pair<unsigned short, float> mMultiScaleNumberAndRange;
71 const Point<int> mNetOutputSize;
72 Array<float> mHandImageCrop;
73 std::array<Array<float>, 2> mHandKeypoints;
74 // HeatMaps parameters
75 const ScaleMode mHeatMapScaleMode;
76 const std::vector<HeatMapType> mHeatMapTypes;
77 std::array<Array<float>, 2> mHeatMaps;
78 // Temporarily disable it
79 std::atomic<bool> mEnabled;
80
81 virtual void netInitializationOnThread() = 0;
82
83 private:
84 // Init with thread
85 std::thread::id mThreadId;
86
87 void checkThread() const;
88
89 DELETE_COPY(HandExtractorNet);
90 };
91 }
92
93 #endif // OPENPOSE_HAND_HAND_EXTRACTOR_HPP
DELETE_COPY
#define DELETE_COPY(className)
Definition: macros.hpp:34
cl::array
std::array< T, N > array
Definition: cl2.hpp:594
op::Point< int >
op::HandExtractorNet::mEnabled
std::atomic< bool > mEnabled
Definition: handExtractorNet.hpp:79
op::HandExtractorNet::mHandImageCrop
Array< float > mHandImageCrop
Definition: handExtractorNet.hpp:72
op::HandExtractorNet::mHeatMapScaleMode
const ScaleMode mHeatMapScaleMode
Definition: handExtractorNet.hpp:75
op::HandExtractorNet::mNetOutputSize
const Point< int > mNetOutputSize
Definition: handExtractorNet.hpp:71
common.hpp
op::ScaleMode::ZeroToOne
op::HandExtractorNet::mMultiScaleNumberAndRange
const std::pair< unsigned short, float > mMultiScaleNumberAndRange
Definition: handExtractorNet.hpp:70
op::HandExtractorNet::mHandKeypoints
std::array< Array< float >, 2 > mHandKeypoints
Definition: handExtractorNet.hpp:73
op::HandExtractorNet::mHeatMaps
std::array< Array< float >, 2 > mHeatMaps
Definition: handExtractorNet.hpp:77
op::ScaleMode
ScaleMode
Definition: enumClasses.hpp:6
op::Array< float >
op::Rectangle
Definition: rectangle.hpp:11
op::HandExtractorNet
Definition: handExtractorNet.hpp:14
cl::vector
std::vector< T, Alloc > vector
Definition: cl2.hpp:567
OP_API
#define OP_API
Definition: macros.hpp:19
enumClasses.hpp
op::HandExtractorNet::mHeatMapTypes
const std::vector< HeatMapType > mHeatMapTypes
Definition: handExtractorNet.hpp:76