geaxgx / depthai_blazepose

MIT License
338 stars 68 forks source link

3d absolute position of any keypoint #20

Open eman-ant opened 2 years ago

eman-ant commented 2 years ago

Hi, how would I go about determining the absolute 3d location of a key point besides the refrence point? Right now, I'm able to find what the 3d positions of the mid point between my hips or shoulders are, but I haven't been able to figure out a way to do this for say, my right hand, or any other arbitrary body part. For my project, I'm able to assume certain keypoints such as the hand are in frame, so I'm not sure if the points mentioned in the readme would still be an issue.

geaxgx commented 2 years ago

So I understand that the keypoints for which you want to determine the absolute 3d location are visible in the image (not hidden by another body part or not behind a object). That's good, but you may still have the problem from time to time that the inferred keypoint (= the drawn keypoint) is not precisely superimposed with the real corresponding body part. In that case, if you ask for the absolute 3d location of the inferred keypoint, you can get the 3d location of "something else" (like the wall behind you). To alleviate this problem, you may play with parameters of the SpatialLocation configuration data structure: https://docs.luxonis.com/projects/api/en/latest/references/python/#depthai.SpatialLocationCalculatorConfigData For instance, use a larger roi (in order to be sure that the real body part you are interested in is in the roi) and set calculationAlgorithm to min (it supposes that the body part is the object that is the closest to the camera).