eos 1.4.0
|
Essential functions and classes to work with 3D face models, meshes and landmarks. More...
Classes | |
class | Image |
Class to represent images. More... | |
struct | Landmark |
Representation of a landmark, consisting of a landmark name and coordinates of the given type. Usually, the type would be Eigen::Vector2f . More... | |
class | LandmarkMapper |
Represents a mapping from one kind of landmarks to a different format (e.g. model vertices). More... | |
struct | Mesh |
This class represents a 3D mesh consisting of vertices, vertex colour information and texture coordinates. More... | |
class | Pixel |
Represents a pixel with given type and number of channels. More... | |
struct | PixelTraits |
Todo. More... | |
struct | PixelTraits< Pixel< ElementType, NumChannels > > |
Todo. More... | |
struct | Rect |
A simple type representing a rectangle. More... | |
Typedefs | |
using | Image1u = Image< std::uint8_t > |
using | Image3u = Image< Pixel< std::uint8_t, 3 > > |
using | Image4u = Image< Pixel< std::uint8_t, 4 > > |
using | Image1f = Image< float > |
using | Image3f = Image< Pixel< float, 3 > > |
using | Image1d = Image< double > |
template<class LandmarkType > | |
using | LandmarkCollection = std::vector< Landmark< LandmarkType > > |
A trivial collection of landmarks that belong together. | |
Functions | |
cv::Mat | to_mat (const Image4u &image) |
cv::Mat | to_mat (const Image1d &image) |
Image3u | from_mat (const cv::Mat &image) |
Image4u | from_mat_with_alpha (const cv::Mat &image) |
template<typename ElementType , int NumChannels> | |
constexpr bool | operator== (const Pixel< ElementType, NumChannels > &lhs, const Pixel< ElementType, NumChannels > &rhs) noexcept |
template<class T > | |
LandmarkCollection< T > | filter (const LandmarkCollection< T > &landmarks, const std::vector< std::string > &filter) |
Shorthand for a 2D floating point landmark type. | |
template<typename T > | |
T | radians (T degrees) |
Convert given degrees to radians. | |
template<typename T > | |
T | degrees (T radians) |
Convert given radians to degree. | |
template<typename T > | |
std::enable_if< std::is_unsigned< T >::value, int >::type constexpr | sign (T const x) |
Returns the sign of the given number (-1, 0 or +1). | |
template<typename T > | |
std::enable_if< std::is_signed< T >::value, int >::type constexpr | sign (T const x) |
Returns the sign of the given number (-1, 0 or +1). | |
Mesh | read_obj (std::string filename) |
Reads the given Wavefront .obj file into a Mesh . | |
LandmarkCollection< Eigen::Vector2f > | read_pts_landmarks (std::string filename) |
void | write_obj (const Mesh &mesh, std::string filename) |
Writes the given Mesh to an obj file that for example can be read by MeshLab. | |
void | write_textured_obj (const Mesh &mesh, std::string filename) |
Writes an obj file of the given Mesh, including texture coordinates, and an mtl file containing a reference to the texture map. | |
Variables | |
template<class T > | |
constexpr T | pi = T(3.1415926535897932385L) |
Compile-time constant for pi (19 digits). | |
Essential functions and classes to work with 3D face models, meshes and landmarks.
LandmarkCollection< T > eos::core::filter | ( | const LandmarkCollection< T > & | landmarks, |
const std::vector< std::string > & | filter | ||
) |
Shorthand for a 2D floating point landmark type.
Alias for the 2D landmark point type.
Filters the given LandmarkCollection and returns a new LandmarkCollection containing all landmarks whose name matches the one given by filter
.
[in] | landmarks | The input LandmarkCollection to be filtered. |
[in] | filter | A list of landmark names (identifiers) by which the given LandmarkCollection is filtered. |
|
inline |
Returns an Image3u from a given cv::Mat with type CV_8UC3. The channel order is not changed, i.e. if the cv::Mat is BGR, the output Image3u will have BGR channel ordering too.
|
inline |
Supports both CV_8UC3 and CV_8UC4 cv::Mat as input images. If a CV_8UC3 images is given, then all pixels of the alpha channel of the returned image are set to 255.
|
inline |
Reads the given Wavefront .obj file into a Mesh
.
https://en.wikipedia.org/wiki/Wavefront_.obj_file as of 22 August 2017.
[in] | filename | Input filename (ending in ".obj"). |
|
inline |
Reads an ibug .pts landmark file and returns an ordered vector with the 68 2D landmark coordinates.
[in] | filename | Path to a .pts file. |
|
inlineconstexpr |
Returns the sign of the given number (-1, 0 or +1).
According to StackOverflow, the < 0 part of the check triggers GCC's -Wtype-limits warning when instantiated for an unsigned type. Thus we use two overloads, for signed and unsigned types.
|
inlineconstexpr |
Returns the sign of the given number (-1, 0 or +1).
According to StackOverflow, the < 0 part of the check triggers GCC's -Wtype-limits warning when instantiated for an unsigned type. Thus we use two overloads, for signed and unsigned types.
|
inline |
Writes the given Mesh to an obj file that for example can be read by MeshLab.
If the mesh contains vertex colour information, it will be written to the obj as well.
[in] | mesh | The mesh to save as obj. |
[in] | filename | Output filename (including ".obj"). |
|
inline |
Writes an obj file of the given Mesh, including texture coordinates, and an mtl file containing a reference to the texture map.
The obj will contain texture coordinates for the mesh, and the mtl file will link to a file named <filename>.texture.png. Note that the texture (i.e. the <filename>.texture.png file) has to be saved separately.
[in] | mesh | The mesh to save as obj. |
[in] | filename | Output filename, including .obj. |