Questions about C++ Open-Pose Programming

2019-08-23 11:52发布

问题:

I am Heo Ji Wook, majoring in information communication at a university in Korea. Please let us know that you are using an English translator and understand even if the flow of words is awkward.

I am creating a C++ program that can check 'Do I use my computer in my right posture using Openpose?' We used openforce to test for smleton tracking, and here I'd like to know if the key point of the shoulder was in line. I've seen through Google that data is being stored on JSON, but I'm not sure.

I would really appreciate it if you could give me a hint. Thank you for reading my question. Have a nice day.

openpose test image

*Development environment

  • Win 10 64 Pro

  • Visual Studio 2017 Community

  • CMake 3.13.3

  • Openpose 1.4.0

  • CUDA 8.0.61 win 10

  • Cudnn 8.0 win 10 64 v5.1

回答1:

You can follow what @nchaumont suggested with the key points are exported to an json file. Or you could directly get them inside openpose by

  1. Download the source code from github Dlib on github
  2. Implement by the function void work(TDatums& tDatums) in the file /include/openpose/pose/wPoseExtractor.hpp
  3. Get the keypoints as below code

auto &ProceedData = (*tDatums)[0]; //get the key points of the first person

Array keypoints = ProceedData.poseKeypoints;

  1. You can then proceed with the keypoint


回答2:

You can definitely do this. The easiest way would be to: 1-run OpenPoseDemo and save the keypoints in a json file (--write_json option -- see the Main Flags section here) 2-Parse the json files for the keypoints that you need. See OpenPose outputs conventions here for the keyoint IDs and the json format.