No the demo, but the library has a function for that: getKeypointsRectangle() in include/openpose/utilities/keypoint.hpp
Usage example:
const auto thresholdRectangle = 0.1f;
const auto numberKeypoints = keypoints.getSize(1);
const auto areaKeypoints = numberKeypoints * keypoints.getSize(2);
const auto personRectangle = getKeypointsRectangle(&keypoints[personIndex*areaKeypoints], numberKeypoints, thresholdRectangle);
Given there is no further answer, I'll assume it was solved.
Is there a way to access getKeypointsRectangle() in python?
@soulslicer
Currently this API is not exposed via Python. I guess it would be worth it to add the utility functions to Python which is something we can do.
@taraprasad73
If you want to add custom functions, for your interest, it is very easy to do. Simply open openpose_python.cpp in the python folder. Then under the PYBIND11_MODULE section, just add say
m.def("get_keypoints_rectangle", &op::getKeypointsRectangle<float>, "Get Keypoints From Rectangle");
@soulslicer Hi, thanks for your answer. I'm not familiar with pybind11. when adding that line of code in openpose_python.cpp, I got an error. Do I have to compile openpose again to make it work?
many thanks.
Yes you would have to recompile it
@gineshidalgo99 thanks for your reply. I recompiled it, unfortunately, I got an error due to the unity plugin is only available on Windows. I am using Ubuntu and don't need to use unity, is there a way to work around and avoid this kind of error? thank you
Can you paste the error? When does it happen?
@soulslicer I think it's an OS support issue. I am using Ubuntu 16.04, the error explained the reason:
Error:
Unity plugin only available on Windows.
Coming from:
You can enabled WITH_UNITY, which you do not wanna enable. Disable it from CMake
@gineshidalgo99 Many thanks, perfectly solved ! Then I realized the rectangle is drawn by using the maximum and minimum of estimated keypoints (as shown in the image below) , which is not able to cover the whole body. Please bear with me if I have asked too much, is there a way to find an accurate bounding box where the whole body can be fully covered? thanks

No there is not, it is based on the body pose keypoints.
Was it working fine when you have more than one persons in the frame?
@gineshidalgo99 Many thanks, perfectly solved ! Then I realized the rectangle is drawn by using the maximum and minimum of estimated keypoints (as shown in the image below) , which is not able to cover the whole body. Please bear with me if I have asked too much, is there a way to find an accurate bounding box where the whole body can be fully covered? thanks
Hi
Could you please mention how did you run the program to get the rectangle?
Most helpful comment
Currently this API is not exposed via Python. I guess it would be worth it to add the utility functions to Python which is something we can do.
@taraprasad73
If you want to add custom functions, for your interest, it is very easy to do. Simply open
openpose_python.cppin the python folder. Then under thePYBIND11_MODULEsection, just add saym.def("get_keypoints_rectangle", &op::getKeypointsRectangle<float>, "Get Keypoints From Rectangle");