-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
15 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,15 @@ | ||
# joint_angles_calculate | ||
Calculate the joint angles of a body pose | ||
**Calculating Joint Angles** | ||
|
||
This code calculates the joint angles of a 3D body pose that was output from my other repository: [Real time 3D body pose estimation using MediaPipe](https://github.com/TemugeB/bodypose3d). If you want to know how the joint angles are calculated, check my blog post [here](https://temugeb.github.io/python/motion_capture/2021/09/16/joint_rotations.html). The joint angles are calculated by defining a T pose and assigning right handed coordinate system at each joint, as shown below. | ||
|
||
![pose](media/tpose.png "T pose") | ||
|
||
I've included a sample keypoints file. Simply run the demo as: | ||
|
||
``` | ||
python calculate_joint_angles.py kpts_3d.dat | ||
``` | ||
|
||
The calculated joint angles are returned as "jointname_angles". We can use the calculated joint angles to put the motion on a standard skeleton. This is useful because keypoints estimators are not consistent with their estimations, which leads to varying bone lengths. In red, we show the original output of Blazepose[link](https://google.github.io/mediapipe/solutions/pose.html) estimated 3D keypoints. In blue, we show the pose applied on a standard skeleton from the joint angles. The discrepancy between the poses is due to inaccuracy in keypoints estimation leading to bone lengths changing. | ||
|
||
![example](media/poses.gif "poses") |