Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The mesh position after deformation is far away from the reference mesh position. #3

Open
Owen1234560 opened this issue Jul 14, 2021 · 4 comments

Comments

@Owen1234560
Copy link

Hi,
The mesh position after deformation is far away from the reference mesh position.
How can I deal with this problem?
Thanks.
无标题

@mickare
Copy link
Owner

mickare commented Jul 14, 2021

Hi Owen,
the authors of the paper state a solution:
"In order to resolve the global positioning of the camel over time and to enforce foot/ground contact, we extracted the positions of one vertex on each foot of the horse over time, performed an overall scaling to better match the larger size of the camel, and added vertex constraints to match a vertex on each camel foot to these positions." [Ch.6 Sumner2004DTF by Sumner, Popović]

So basically it is up to the user to move the transformed mesh to a desired position.

corr_markers: List[(int,int)] = ...  # List of vertex-id-tuples (source, target)
source: meshlib.Mesh = ...
pose: meshlib.Mesh = ...
target: meshlib.Mesh = ...

foot_marker: int = ???

source_height = source.vertices.T[2].max() - source.vertices.T[2].min()
target_height = target.vertices.T[2].max() - target.vertices.T[2].min()
scale: float = target_height / source_height

...

transf: Transformation = ...
result = transf(pose)

offset = pose.vertices[corr_markers[foot_marker][0]]] * scale - result.vertices[corr_markers[foot_marker][1]]
result.vertices += offset

Won't fix it in code, since it depends on the case.

@Owen1234560
Copy link
Author

Ok, I try this. Thank you.

@hendrikp
Copy link

hendrikp commented Aug 2, 2021

Couldn't this be resolved by offsetting the vertices based on target's reference position of one of the markers? (That sounds like a pretty generalized solution)

I implemented such offsetting as well for a special use case in my fork, so seems a common requirement.

@SaltedSlark
Copy link

Couldn't this be resolved by offsetting the vertices based on target's reference position of one of the markers? (That sounds like a pretty generalized solution)

I implemented such offsetting as well for a special use case in my fork, so seems a common requirement.

Hello, I am trying on your fork, but it seems missing some packages.

from FaceSpeechProcessing import facialdata as fd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants