patrikhuber / eos

A lightweight 3D Morphable Face Model library in modern C++
Apache License 2.0
1.89k stars 596 forks source link

How to generate a custom Landmark Mapper #300

Closed MatthewCaruana closed 4 years ago

MatthewCaruana commented 4 years ago

I have a custom set of landmarks that I want to be mapped and applied to the Morphable Model. Obviously, I would need to have a custom Landmark Mapper that links the Landmarks to the reference model's vertices. Is there anyway to acquire these mappings automatically through scripts or already existing functions? If not, do I have to do it manually?

patrikhuber commented 4 years ago

Hi Matthew,

You just need to create your own mappings file, following the example in https://github.com/patrikhuber/eos/blob/master/share/ibug_to_sfm.txt. If your landmarks are similar to the ibug scheme (https://ibug.doc.ic.ac.uk/resources/facial-point-annotations/), perhaps you can automate the conversion and pick the same vertex as for the corresponding ibug landmark? Otherwise I would recommend any tool like e.g. MeshLab where you can zoom in on a 3D mesh, click a vertex and obtain its index. For a few dozen landmarks this should be fairly quick. If you've got hundreds, you might want to think about a different method.

MatthewCaruana commented 4 years ago

I tried to make use of the same mappings, however, due to the difference in configuration of the landmarks (while also having 74 landmarks rather than the 68 that ibug has), I would think that it would be better to manually select the points while maybe also taking a few from the ibug mappings.

Thanks for your hasty reply and for this wonderful repo.

patrikhuber commented 4 years ago

You're welcome. Just make sure your mappings text file is correct - you can probably copy most from ibug_to_sfm.txt. And make sure your identifiers match the ones that you put into the mappings file. If in doubt then just debug through your executable to check what's going on.

I'm closing this, feel free to reply if there's any issues.