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
poseExtractor.hpp
Go to the documentation of this file.
1 #ifndef OPENPOSE_POSE_POSE_EXTRACTOR_HPP
2 #define OPENPOSE_POSE_POSE_EXTRACTOR_HPP
3
4 #include <openpose/core/common.hpp>
5 #include <openpose/core/enumClasses.hpp>
6 #include <openpose/core/keepTopNPeople.hpp>
7 #include <openpose/pose/poseParameters.hpp>
8 #include <openpose/pose/poseExtractorNet.hpp>
9 #include <openpose/tracking/personIdExtractor.hpp>
10 #include <openpose/tracking/personTracker.hpp>
11
12 namespace op
13 {
14 class OP_API PoseExtractor
15 {
16 public:
17 PoseExtractor(const std::shared_ptr<PoseExtractorNet>& poseExtractorNet,
18 const std::shared_ptr<KeepTopNPeople>& keepTopNPeople = nullptr,
19 const std::shared_ptr<PersonIdExtractor>& personIdExtractor = nullptr,
20 const std::shared_ptr<std::vector<std::shared_ptr<PersonTracker>>>& personTracker = {},
21 const int numberPeopleMax = -1, const int tracking = -1);
22
23 virtual ~PoseExtractor();
24
25 void initializationOnThread();
26
27 void forwardPass(const std::vector<Array<float>>& inputNetData,
28 const Point<int>& inputDataSize,
29 const std::vector<double>& scaleRatios,
30 const long long frameId = -1ll);
31
32 // PoseExtractorNet functions
33 Array<float> getHeatMapsCopy() const;
34
35 std::vector<std::vector<std::array<float, 3>>> getCandidatesCopy() const;
36
37 Array<float> getPoseKeypoints() const;
38
39 Array<float> getPoseScores() const;
40
41 float getScaleNetToOutput() const;
42
43 // KeepTopNPeople functions
44 void keepTopPeople(Array<float>& poseKeypoints, const Array<float>& poseScores) const;
45
46 // PersonIdExtractor functions
47 // Not thread-safe
48 Array<long long> extractIds(const Array<float>& poseKeypoints, const cv::Mat& cvMatInput,
49 const unsigned long long imageIndex = 0ull);
50
51 // Same than extractIds but thread-safe
52 Array<long long> extractIdsLockThread(const Array<float>& poseKeypoints, const cv::Mat& cvMatInput,
53 const unsigned long long imageIndex,
54 const long long frameId);
55
56 // PersonTracker functions
57 void track(Array<float>& poseKeypoints, Array<long long>& poseIds,
58 const cv::Mat& cvMatInput, const unsigned long long imageViewIndex = 0ull);
59
60 void trackLockThread(Array<float>& poseKeypoints, Array<long long>& poseIds,
61 const cv::Mat& cvMatInput,
62 const unsigned long long imageViewIndex,
63 const long long frameId);
64
65 private:
66 const int mNumberPeopleMax;
67 const int mTracking;
68 const std::shared_ptr<PoseExtractorNet> spPoseExtractorNet;
69 const std::shared_ptr<KeepTopNPeople> spKeepTopNPeople;
70 const std::shared_ptr<PersonIdExtractor> spPersonIdExtractor;
71 const std::shared_ptr<std::vector<std::shared_ptr<PersonTracker>>> spPersonTrackers;
72
73 DELETE_COPY(PoseExtractor);
74 };
75 }
76
77 #endif // OPENPOSE_POSE_POSE_EXTRACTOR_HPP
DELETE_COPY
#define DELETE_COPY(className)
Definition: macros.hpp:34
keepTopNPeople.hpp
op::PoseExtractor
Definition: poseExtractor.hpp:14
poseParameters.hpp
poseExtractorNet.hpp
op::Point< int >
common.hpp
personIdExtractor.hpp
op::Array< float >
cl::vector
std::vector< T, Alloc > vector
Definition: cl2.hpp:567
OP_API
#define OP_API
Definition: macros.hpp:19
enumClasses.hpp
personTracker.hpp