MarilynKeller / SKEL

Release for the Siggraph Asia 2023 SKEL paper "From Skin to Skeleton: Towards Biomechanically Accurate 3D Digital Humans".
https://skel.is.tue.mpg.de/
Other
194 stars 24 forks source link

Pose parameters and their equivalence to the coordinate values of BSM in the arms #24

Open jerela opened 1 month ago

jerela commented 1 month ago

I wish to use SKEL to generate a skin mesh with a given pose of BSM. I worked under the assumption that the pose parameters of SKEL match the coordinates of BSM, albeit in a slightly different order, as defined in https://github.com/MarilynKeller/SKEL/blob/master/skel/kin_skel.py#L29

For instance, when trying to set the skin mesh arms to the default pose of BSM (the default pose of SKEL is T-pose while the default pose of BSM has arms pointing roughly 45 degrees downwards compared to the T-pose), I set the pose parameters as follows, with values for scapula abduction/elevation/upward rotation taken from the default values of the BSM .osim file:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
-1.31156113764349197 # line 27 corresponding to scapula_abduction_r at index 26, because indices start from 0
-0.050497870894562202
0.20820491154386678
0
0
0
0
0
0
0
-1.31156113764349197
-0.050497870894562202
0.20820491154386678
0
0
0
0
0
0
0

With these pose parameters, I expected the skin mesh of SKEL to be in a similar pose to the default pose of BSM, with arms to the side but pointing slightly downwards from the T-pose. However, I get this as a result: image

I thought that the joint coordinate axes of SKEL and BSM were aligned similarly. If so, I don't understand why the arms of the SKEL skin mesh point in the wrong directions (and also in different directions between left and right side) when given pose values from BSM. Can you give me any guidance so I can generate SKEL skin meshes that are posed according to the default pose of BSM properly?

As a workaround I'm planning to extract the global translations of joints of the BSM model using the OpenSim API and then adapting https://github.com/MarilynKeller/SKEL/blob/master/examples/fit2joints.py to fit SKEL to those joints, but I feel there must be an easier solution I'm missing.

chags1313 commented 3 weeks ago

I think you need to modify the shoulder x, y, and z with these values instead of the scapula parameters. I've noticed in the fit2joints script that the author modifies the shoulder x values by -np.pi/2 and np.pi/2 to move arms to the side. The scapula parameters only move the scapular orientation. Here is my example:

{F0EA0720-24F4-4E5F-85A5-B49FB4DB8584}

I'm not sure if this is exactly what you were intending, but hopefully this is helpful. I'm still working on learning the best ways to work with SKEL as well. I'm interested in learning more about your workaround in extracting the global translations if you feel like sharing.

jerela commented 3 weeks ago

Thanks for the suggestion, Cole. However, modifying the shoulder parameters does not lead to a matching pose with BSM as described by its OSIM model, and I need the two to match fairly well: image Even if I were to adjust the shoulder values such that the arms of the mesh align with the skeletal structure of BSM, the sagittal view still wouldn't match. I'll probably go with the original plan of fitting the pose of SKEL to BSM joint locations.

For extracting the global translations, I wrote a MATLAB script extending the OpenSim API to read the translations of joints with respect to the Ground coordinate system of the musculoskeletal model after initializing the physics system in the default pose. I can clean and share it if you want @chags1313 . You'd need MATLAB configured for OpenSim scripting to use it.