TimoBolkart / TemplateFitting

Template fitting for non-rigid mesh registration of a 3D face scan
37 stars 9 forks source link
3d-face-reconstruction 3d-reconstruction computer-graphics computer-vision mesh-processing registration

Template fitting for non-rigid mesh registration

The provided program fits a template mesh to a scan using a non-rigid iterative closet point (ICP) otimization. This template fitting had been used to register the training data of the statistical models described in the scientific publication.

Figure: Given an input scan (and optionally 3D landmarks), the provided program minimizes the distance between a template mesh and the scan surface, returning a registered mesh.

Setup

The provided code has dependencies on the following libraries:

To setup the provided code, use CMake and specify the required ITK, Clapack and ANN paths. Successfully compiling the project outputs a MM Restricted.exe. The provided code has been developed and tested under Windows 7.

Basic usage

To run the program, the TemplateFitting.exe must be called with the following 5 parameters, separated by a blank.

Landmarks

If the TemplateFitting.exe is called without specified landmarks (i.e. without templateLmks.txt and targetLmks.txt), the absolute position and orientation in Euclidean vertex space is used as alignment of the template mesh and the target mesh. The landmark files contain the concatenated (x y z)-coordinates of corresponding salient point sets on the template mesh and the target mesh, whereas all coordinates are separated by a line break. At least four non-coplanar landmarks are required to define a valid rigid alignment.

File formats

While the program provides basic support for WRL-file format and OBJ-file format as input, we recommend using OFF-file format. Only triangle meshes are supported.

Configurations

The header Definitions.h provides parameters to influence the template fitting energy. See the provided comments at the header file for more details. Example: The example TemplateFittingTest.cmd fits the template mesh Template.off to the target mesh Target.off. The template mesh and the target mesh are aligned using the landmarks TemplateLmks.txt for the template, and landmarks TargetLmks.txt for the target mesh. To run the example, the path for the ANN library must be adjusted within the TemplateFittingTest.cmd. By exchanging the parameters, this can be used to fit any other template to any other target mesh.

License

The source is provided for NON-COMMERCIAL RESEARCH PURPOSES only, and is provided as is WITHOUT ANY WARRANTY; without even the implied warranty of fitness for a particular purpose. The redistribution of the code is not permitted.

Citing

When using this code in a scientific publication, please cite

@article{Brunton:CVIU:2014:Review,
  title = {Review of statistical shape spaces for {3D} data with comparative analysis for human faces},
  author = {Brunton, Alan and Salazar, Augusto and Bolkart, Timo and Wuhrer, Stefanie},
  journal={Computer Vision and Image Understanding},
  volume={128},
  pages={1--17},
  year={2014}
}

Acknowledgement

This work has been partially funded by the Saarland University, Cluster of Excellence MMCI