Git Product home page Git Product logo

skinning_decomposition_kavan's Introduction

This is a clean, minimal Python implementation of the paper

    Ladislav Kavan, Peter-Pike Sloan, Carol O'Sullivan.
    "Fast and Efficient Skinning of Animated Meshes."
    Computer Graphics Forum 29(2) [Proceedings of Eurographics], 2010

The code is in no way associated with any of the authors of the paper. I did the reimplementation for a state-of-the-art comparison for my paper "Sparse Localized Deformation Components" (SIGGRAPH Asia 2013). I thought I'd clean up the code an finally put it online ;-)

A motivating example

The method implemented here takes an arbitrary mesh animation such as this galloping horse from Robert Sumner's Page:

The algorithm then estimates linear blend skinning weights as well as bone transformations in order to reproduce the input mesh animation as closely as possible. The result looks like this:

In the above movie, each automatically found "body part" is colored differently (more precisely, it shows the linear blend skinning weights optimized by the method). The bone transformations are also visualized as coordinate axes.

Essentially, the code here performs a task that is commonly called "skinning decomposition" in computer graphics. Skinning decomposition can be useful for quick and memory-efficient display of a given mesh animation on GPU's or in game engines, but it may also be used for more complex tasks such as rigid stabilization, sometimes also called pose normalization. Skinning decomposition can also be seen as a form of compression: each frame of the animation can be recreated only from the 3x4 transformation matrices of the (here, 18) body parts.

To reproduce the results shown above using Anaconda, do the following on the command line:

$ git clone http://github.com/tneumann/skinning_decomposition_kavan
$ cd skinning_decomposition_kavan
$ conda env create -f environment.yml
$ source activate skinning_decomposition_kavan

Now we can download and unzip the sample data:

$ wget https://people.csail.mit.edu/sumner/research/deftransfer/data/horse-gallop.tgz
$ tar xvzf horse-gallop.tgz
$ rm horse-gallop/horse-gallop-reference.obj

And then convert the data, run the decomposition, and visualize the results using:

$ python convert_obj_sequence.py horse-gallop horse-gallop.h5 
$ python decompose_kavan.py horse-gallop.h5 horse-gallop-bones.h5 18 -f
$ python view_animation.py horse-gallop-bones.h5

Scripts

decompose_kavan.py

TODO: rename! Implements the main algorithm. There is some documentation of the command line parameters: $ python kavan.py --help

convert_sma_data.py

Can convert the data from the project page of the paper of Kavan et al. into hdf5 format to be viewed with view_animation.py. This is mostly to check if our reimplementation yields the same results as Ladislav's method. Example:

$ python convert_sma_data.py <path-to-data-from-website>/horse.skin.txt horse_sma.h5
$ python view_animation.py horse_sma.h5

view_animation.py

Can view reconstructed animations as well as their estimated bone positions.

skinning_decomposition_kavan's People

Contributors

tneumann 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.