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
personIdExtractor.hpp
Go to the documentation of this file.
1 #ifndef OPENPOSE_TRACKING_PERSON_ID_EXTRACTOR_HPP
2 #define OPENPOSE_TRACKING_PERSON_ID_EXTRACTOR_HPP
3 
4 #include <atomic>
5 #include <tuple>
6 #include <unordered_map>
7 #include <unordered_set>
9 
10 namespace op
11 {
12  struct PersonEntry
13  {
15  std::vector<cv::Point2f> keypoints;
16  std::vector<char> status;
17  /*
18  PersonEntry(long long _last_frame,
19  std::vector<cv::Point2f> _keypoints,
20  std::vector<char> _active):
21  last_frame(_last_frame), keypoints(_keypoints),
22  active(_active)
23  {}
24  */
25  };
27  {
28 
29  public:
30  PersonIdExtractor(const float confidenceThreshold = 0.1f, const float inlierRatioThreshold = 0.5f,
31  const float distanceThreshold = 30.f, const int numberFramesToDeletePerson = 10);
32 
33  virtual ~PersonIdExtractor();
34 
35  Array<long long> extractIds(const Array<float>& poseKeypoints, const cv::Mat& cvMatInput,
36  const unsigned long long imageViewIndex = 0ull);
37 
38  Array<long long> extractIdsLockThread(const Array<float>& poseKeypoints, const cv::Mat& cvMatInput,
39  const unsigned long long imageViewIndex,
40  const long long frameId);
41 
42  private:
43  const float mConfidenceThreshold;
44  const float mInlierRatioThreshold;
45  const float mDistanceThreshold;
46  const int mNumberFramesToDeletePerson;
47  long long mNextPersonId;
48  cv::Mat mImagePrevious;
49  std::vector<cv::Mat> mPyramidImagesPrevious;
50  std::unordered_map<int, PersonEntry> mPersonEntries;
51  // Thread-safe variables
52  std::atomic<long long> mLastFrameId;
53 
55  };
56 }
57 
58 #endif // OPENPOSE_TRACKING_PERSON_ID_EXTRACTOR_HPP
#define DELETE_COPY(className)
Definition: macros.hpp:34
Definition: personIdExtractor.hpp:12
std::vector< cv::Point2f > keypoints
Definition: personIdExtractor.hpp:15
long long counterLastDetection
Definition: personIdExtractor.hpp:14
Definition: personIdExtractor.hpp:26
std::vector< char > status
Definition: personIdExtractor.hpp:16
#define OP_API
Definition: macros.hpp:19