eos  0.7.1
Public Member Functions | List of all members
eos::core::LandmarkMapper Class Reference

Represents a mapping from one kind of landmarks to a different format (e.g. model vertices). More...

#include <LandmarkMapper.hpp>

Public Member Functions

 LandmarkMapper ()=default
 Constructs a new landmark mapper that performs an identity mapping, that is, its output is the same as the input.
 
 LandmarkMapper (boost::filesystem::path filename)
 Constructs a new landmark mapper from a file containing mappings from one set of landmark identifiers to another. More...
 
boost::optional< std::string > convert (std::string landmark_name) const
 Converts the given landmark name to the mapped name. More...
 
auto size () const
 Returns the number of loaded landmark mappings. More...
 

Detailed Description

Represents a mapping from one kind of landmarks to a different format (e.g. model vertices).

When fitting the 3D model to an image, a correspondence must be known from the 2D image landmarks to 3D vertex points in the Morphable Model. The 3D model defines all its points in the form of vertex ids. These mappings are stored in a file, see the share/ folder for an example for mapping 2D ibug landmarks to 3D model vertex indices.

The LandmarkMapper thus has two main use cases:

Constructor & Destructor Documentation

eos::core::LandmarkMapper::LandmarkMapper ( boost::filesystem::path  filename)
inline

Constructs a new landmark mapper from a file containing mappings from one set of landmark identifiers to another.

In case the file contains no mappings, a landmark mapper that performs an identity mapping is constructed.

Parameters
[in]filenameA file with landmark mappings.
Exceptions
runtime_errorif there is an error loading the mappings from the file.

Member Function Documentation

boost::optional<std::string> eos::core::LandmarkMapper::convert ( std::string  landmark_name) const
inline

Converts the given landmark name to the mapped name.

Parameters
[in]landmark_nameA landmark name to convert.
Returns
The mapped landmark name if a mapping exists, an empty optional otherwise.
Exceptions
out_of_rangeexception if there is no mapping for the given landmarkName.
auto eos::core::LandmarkMapper::size ( ) const
inline

Returns the number of loaded landmark mappings.

Returns
The number of landmark mappings.

The documentation for this class was generated from the following file: