Git Product home page Git Product logo

deformation-transfer-for-triangle-meshes's Introduction

Reproduction: Deformation Transfer for Triangle Meshes

This is a Python implementation of the paper "Deformation Transfer for Triangle Meshes". I think this repo would be more in-line with the methodology which demonstrated in the paper. Since I didn't optimize the result in an iterative way, instead I use LU factorization to obtain the Moore-Penrose pseudo inverse then calculate the optimal solution of the linear optimization problem.

For Non-rigid registration part, I derive the constraint optimization problem with Lagrangian-Multiplier, then convert it to a un-constraint linear optimization, and solving the problem with LU factorization as well.

Request Packages

numpy 1.18.0
scipy 1.4.1

In this project, the sparse matrix calculation module of scipy is the key tool for solving the linear optimization problem.

Demo

Results of Non-rigid registration

non-rigid registration

Results of Deformation transfer

deformation transfer The topology of source & target mesh is different with each other.

Usage

  • You can adjust the configurations in ./config.py and see the arguments of each solver.

  • If you want to test on your own customized data, you need to first select the marker vertices on the two meshes with different topologies(it could be achieved quickly by using Maya or Blender)

  • After selecting the marker vertices, you need to do non-rigid registration for the mesh first, by running:

python non_rigid_registration.py

This part might take a pretty long time.

  • Then you need to find the correspondence of two mesh by executing:
python find_correspondence.py
  • Finally, run:
python transfer_deformation.py
Time consuming
  • non-rigid registration stage: about 20 minutes! Though it's pretty slow, we only need to calculate it for once if we have a new pair of source/target mesh.

  • correspondence finding: about 1 minute.

  • deformation transfer: few seconds.

The speed of LU factorization seems has inversely proportional relationship with the number of vertices of mesh. So, use mesh has lower vertices and triangle faces might be faster.

Things that REALLY should be NOTICED!

The obj data file released by the author Dr. R.W. Sumner has some mistakes in "face-poses". The order of vertices of reference mesh and some deformed mesh are different!!! e.g. face-01-anger.obj, face-03-fury.obj. As far as I know, only the order of face-02-cry.obj has the same order of vertices as face-reference.obj. So only transfer the deformation of face-02-cry.obj could obtain a correct result while using my code.

wrong vertices order

I think the order of triangle faces of the face-reference.obj and other deformed face-xx-xxx.obj might be the same, follow this you could still obtain correct deformation transfer results if made some modification based on my code.

In my other tests, if the vertices order of reference and deformed source mesh can be guaranteed, the results are always good!

Reference

deformation-transfer-for-triangle-meshes's People

Contributors

anyms-a avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.