lab4d-org / lab4d

A framework for 4D reconstruction from monocular videos.
https://lab4d-org.github.io/lab4d/
MIT License
274 stars 17 forks source link

Question about motion info from fg-motion.json #49

Open Batwho opened 4 months ago

Batwho commented 4 months ago

Hi,

I'm trying to get motion information from fg-motion.json and reproduce them in blender. I have two questions at the moment.

  1. I assume the joint_so3 is applied gradually on each joints based on previous frame's skeleton. Then, I tried to apply the first element of the joint_so3 on the rest pose, but the output doesn't match with the fg-0000-bone.obj. If I start with the fg-0000-bone.obj's pose and apply the second elements from joint_so3, it also doesn't align with the next skeleton pose. My question would be what is joint_so3 and how to start from the rest pose and apply joint_so3 gradually to get deformed skeleton pose?

  2. If joint_so3 should be used as what I assumed, then I think it applies rotations on all children joints, except the root joints. My second question is how to get the displacement of the skeleton? I checked 't_articulation' and I think it is the 3d coordinates of the joints per keyframe. But seems like blender cannot generate animations by inserting keyframe of 3d bone location.

Here is the fg-motion i'm using: fg-motion.json, extracted from cat-pikachu-0 Thank you so much in advance for this specific blender-related question

gengshan-y commented 4 months ago

Hi, I have limited experience with blender. It would be good to clarify what blender takes as input. For now I can only answer how fk is done inside lab4d.

To get from joint angles (joint_so3) to rigid transformation of each bone (t_articulations), there are 3 steps

  1. get local rest joint coordinates, defined as (current - parent) while assuming rotation of each rest bone is identity.
  2. apply fk It traverse a kinematic tree, rotate local rest joint according to joint_so3, and compose the local se3 with the parents se3.
  3. optionally shifting from joint (starting position of bone) to bone centers, as done here

As a sanity check, if you pass joint_so3 as all zeros, it should produce the rest pose.