Openpose: Bounding Box around hand

Created on 22 Mar 2018  路  8Comments  路  Source: CMU-Perceptual-Computing-Lab/openpose

Issue Summary

I am looking for a way to draw a bounding box / rectangle around the hands that OpenPose detects. Is there any simple way to achieve this?

Looking through previous questions/answers on git, I could not find a solution to my problem. Any help is appreciated, thanks!

Type of Issue

  • Help wanted
  • Question
C++ API help wantequestion

Most helpful comment

Update to this post, there is an example in which you can provide your own hand bounding boxes, check examples/tutorial (either c++ or python) and the hand example.

All 8 comments

While not optimal, I found a solution that worked for my case. Anyone looking to do something similar, here is what I did:

  1. I ran OpenPose on the desired images and wrote the keypoints to a file with the following flag.
    --write_keypoint_json
    This allowed me to generate keypoint files for each picture. I also made sure to set the scale to match the input picture.
    --keypoint_scale 0
  2. Using OpenCV, I wrote some code to import the generated JSON files and draw a bounding box around the images, using the keypoints from said file.

I am still looking to make this more streamlined, any suggestions to optimise this or allow me to do all this in OpenPose itself are more than welcome!

Looks like the optimal thing to do for me.

(If you need it in real time and/or prefer not to write in disk, you can check tutorial_wrapper/ and read the keypoint output directly from those examples rather than from disk)

Thanks for the guidance! I was able to draw the bounding boxes in real time by making a wrapper based on tutorial_wrapper/2_user_synchronous.cpp

Hi KrisofDR, can you tell me some more details about how you get keypoints around the hands? I'm struggling with it.

Sure!

As recommended, based my code on examples/tutorial_wrapper/2_user_synchronous.cpp.

Getting the hand keypoints is very easy, check the other examples in /tutorial_wrapper for how it is done.

Drawing the bounding boxes was done in the WUserPostProcessing class.

Hi @KristofDR, could you share with us how the code of how you did it? thanks in advance for any help since I'm stuck doing the same thing :(

Update to this post, there is an example in which you can provide your own hand bounding boxes, check examples/tutorial (either c++ or python) and the hand example.

Hi,

Using 07_hand_from_image.py example, how can I detect the bounding box around the hand automatically? So, it automatically preserves 10%-20% margin from the hand board to the (top, bottom, right, and left) side of the image to maximise the detection accuracy of keypoints. Please I need a help..

Was this page helpful?
0 / 5 - 0 ratings