mad-lab-fau / BASH-Model

We developed a method animating a statistical 3D human model for biomechanical analysis to increase accessibility for non-experts, like patients, athletes, or designers.
Apache License 2.0
86 stars 9 forks source link

markers.obj #2

Closed antoinefalisse closed 3 years ago

antoinefalisse commented 3 years ago

Hello,

I am trying to use your package with some of my data. I managed to build everything on windows (I think), and I am now loading my data. I get the following error: Error: No corresponding marker was found: AnkL @ line 180 in file: c:\users\u0101727\documents\myrepositories\bash-model\src\model.cpp, which is expected since there is no such marker in my model. My question is therefore the following: can I use a different marker set with your package? I see that the markers of the baseline model are defined in markers.obj, so I could potentially adjust this file. But I don't know where the values come from. I can also try to adjust my marker set to reflect what is in markers.obj. Any thoughts on that?

I have also tried loading the data provided with Nitschke et al. (2020), and I think it worked fine. At least I get a lot of .ply files in cache\mesh\.... Is it what it is supposed to output? How are you then converting those files into animation as in your example? Sorry for the basic questions, but it is not super clear to me how to use the tool and what to expect as output.

Thanks in advance for your help, I hope I can make it work - it looks great!

robbyte commented 3 years ago

Hi Antoine,

thank you for the interest in our work.

When using your own OpenSim model, you have to adjust the baseline model. In particular, you have to rig the skeletal hierarchy and place the same set of markers on your new baseline model. The markers on the baseline model have be the same set (=same landmark positions & naming) as in your OpenSim model. We placed the markers on the surface of the baseline model's mesh by hand and exported their coordinates (markers.obj). You can also do this with your set of markers as well, e.g. in Blender. Just provide enough markers since they are used for matching the initial pose and scaling of the BASH model.

Also make sure to adjust the marker-pairs that are used to compute the scaling factors in the model.cpp at line 349 as this is currently hard-coded...

The overall output should be a interactive window where you can playback the animation of the resulting 3D-model. The .ply files in the cache folder are for caching and debugging.

Best regards, Robert

antoinefalisse commented 3 years ago

Hi Robert,

Thanks for your answer and sorry for the delay. I did not have time to look into that before. A couple of follow-up questions:

  1. I think a way for me to make it work with minimal change is to add the expected markers to my model. But I am still a little confused: are the marker positions reported in markers.obj for a scaled or a generic model? If they are for a generic model, then I might not need to adjust them, since I use an OpenSim model very similar to the one used in the demo (basically the same generic model). I could then just add the expected markers to my scaled model I guess?

  2. Could you elaborate on what is expected for the "scale" file asked when running start.bat? You mentioned that the marker pairs are hard coded, so maybe it is not useful?

  3. I managed to get the tool to run with data found in Nitschke et al. (2020). But I don't get an interactive window where I can playback the animation of the resulting 3D-model. I get something like this:

Picture1

It looks like a good start, but I cannot get it to play.

Thanks a lot for your help, Btw if it is easier and if you have a little bit of time, maybe we could set up a quick zoom call to get it to work? I've been in touch with lots of people from your group: Eva, Ann, etc. So happy to reach out to them too.

Many thanks, Antoine

antoinefalisse commented 3 years ago

Okay, I think I figured a couple of things myself:

  1. I think the marker positions in markers.obj are for a generic model. Those positions are then scaled, and exported to the TRC file used to get the initial pose matching. I set ESTIMATE_SCALEFACTORS_MARKERDATA to true so as to use the markers from my scaled model to scale the SCAPE model.

  2. I don't think the scale file is needed when setting ESTIMATE_SCALEFACTORS_MARKERDATA to true. Can you confirm?

  3. I figured that just pressing the right key makes the animation play forward. Will try to find a way to run and save automatically the animations with pre-defined views.

This toolbox is awesome, I will keep playing with it. Thanks.

robbyte commented 3 years ago
  1. yes, this is correct.
  2. You can either provide an OpenSim-Scale file for the factors (exact) or use my code to estimate these factors (approximation).
  3. Have a look at the settings.h where the keybindings and predefined camera positions are defined. To export a video I would suggest to write a script which image-captures each frame (next frame 'shitf' + 'right') and then joins them to a video file.

Thank you for the kind words!