23 #include <opencv2/core.hpp>
26 explicit Peak(
const cv::Point2f& keypoint = cv::Point2f(-1, -1),
const float score = 0.0f,
const float tag = 0.0f)
38 explicit Pose(
size_t numJoints) : peaks(numJoints) {}
40 void add(
size_t index,
Peak peak) {
43 poseTag = poseTag *
static_cast<float>(validPointsNum) + peak.tag;
44 poseCenter = poseCenter *
static_cast<float>(validPointsNum) + peak.keypoint;
46 poseTag = poseTag /
static_cast<float>(validPointsNum);
47 poseCenter = poseCenter /
static_cast<float>(validPointsNum);
50 float getPoseTag()
const {
54 float getMeanScore()
const {
55 return sum /
static_cast<float>(size());
58 Peak& getPeak(
size_t index) {
62 cv::Point2f& getPoseCenter() {
71 std::vector<Peak> peaks;
72 cv::Point2f poseCenter = cv::Point2f(0.f, 0.f);
73 int validPointsNum = 0;
78 void findPeaks(
const std::vector<cv::Mat>& nmsHeatMaps,
79 const std::vector<cv::Mat>& aembdsMaps,
80 std::vector<std::vector<Peak>>& allPeaks,
83 float detectionThreshold);
85 std::vector<Pose> matchByTag(std::vector<std::vector<Peak>>& allPeaks,
90 void adjustAndRefine(std::vector<Pose>& allPoses,
91 const std::vector<cv::Mat>& heatMaps,
92 const std::vector<cv::Mat>& aembdsMaps,
Definition: associative_embedding_decoder.h:36
Definition: associative_embedding_decoder.h:25