human_pose_estimation_demo的進一步研究
- 2019 年 10 月 30 日
- 筆記
一、demo能力

–iE:/OpenVINO_modelZoo/head-pose-face-detection-female-and-male.mp4 -mE:/OpenVINO_modelZoo/human-pose-estimation-0001.xml -d CPU
基於這篇論文:



{
return a.x > b.x;
}
//而後對所有的點進行這樣處理
HumanPose firstHumanPose = poses[0];
std::vector<cv::Point2f> firstKeypoints = firstHumanPose.keypoints;
sort( firstKeypoints .begin(), firstKeypoints .end(), SortbyYaxis );
if (! (firstKeypoints[0].x < 369 || firstKeypoints[firstKeypoints.size() – 1].x > 544))
{
std::stringstream inRanges;
inRanges << “inRanges! “;
cv::putText(image, inRanges.str(), cv::Point(16, 64),
cv::FONT_HERSHEY_COMPLEX, 1, cv::Scalar(0, 0, 255));
}


{
//邊界外直接返回
if (point.x < 0)
return false;
if (point.x <= PointLineLeft.x)
return true;
if (point.x > PointLineRight.x)
return false;
//在邊界內的情況,通過計算斜率
if (PointLineRight.x == PointLineLeft.x)
assert(“error PointLineRight.x == PointLineLeft.x”);
float kLine = (PointLineRight.y – PointLineLeft.y) / (PointLineRight.x – PointLineLeft.x);
float k = (point.y – PointLineLeft.y) / (point.x – PointLineLeft.x);
return (k >= kLine);
}
bLeft = PointIsLeftLine(pointLeftFoot, cv::Point2f(1017, 513), cv::Point2f(433, image.rows – 1));
{
line(image, cv::Point(1017, 513), cv::Point(433, image.rows – 1), cv::Scalar(0, 0, 255), 8);
}
else
{
line(image, cv::Point(1017, 513), cv::Point(433, image.rows – 1), cv::Scalar(0, 255, 0), 8);
}


