Represents a mapping from one kind of landmarks to a different format (e.g. model vertices).
More...
#include <LandmarkMapper.hpp>
|
| 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...
|
|
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:
- Mapping 2D landmark points to 3D vertices
- Converting one set of 2D landmarks into another set of 2D landmarks with different identifiers.
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] | filename | A file with landmark mappings. |
- Exceptions
-
runtime_error | if there is an error loading the mappings from the file. |
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_name | A landmark name to convert. |
- Returns
- The mapped landmark name if a mapping exists, an empty optional otherwise.
- Exceptions
-
out_of_range | exception 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: