* @return An mesh instance of the mean of the Morphable Model.
* @return An mesh instance of the mean of the Morphable Model.
*/
*/
render::Meshget_mean()const
core::Meshget_mean()const
{
{
assert(shape_model.get_data_dimension()==color_model.get_data_dimension()||!has_color_model());// The number of vertices (= model.getDataDimension() / 3) has to be equal for both models, or, alternatively, it has to be a shape-only model.
assert(shape_model.get_data_dimension()==color_model.get_data_dimension()||!has_color_model());// The number of vertices (= model.getDataDimension() / 3) has to be equal for both models, or, alternatively, it has to be a shape-only model.
assert(shape_model.get_data_dimension()==color_model.get_data_dimension());// The number of vertices (= model.getDataDimension() / 3) has to be equal for both models.
assert(shape_model.get_data_dimension()==color_model.get_data_dimension());// The number of vertices (= model.getDataDimension() / 3) has to be equal for both models.
assert(shape_model.get_data_dimension()==color_model.get_data_dimension()||!has_color_model());// The number of vertices (= model.getDataDimension() / 3) has to be equal for both models, or, alternatively, it has to be a shape-only model.
assert(shape_model.get_data_dimension()==color_model.get_data_dimension()||!has_color_model());// The number of vertices (= model.getDataDimension() / 3) has to be equal for both models, or, alternatively, it has to be a shape-only model.
assert(shape_instance.rows==color_instance.rows||color_instance.empty());// The number of vertices (= model.getDataDimension() / 3) has to be equal for both models, or, alternatively, it has to be a shape-only model.
assert(shape_instance.rows==color_instance.rows||color_instance.empty());// The number of vertices (= model.getDataDimension() / 3) has to be equal for both models, or, alternatively, it has to be a shape-only model.
assert(mesh.vertices.size()==mesh.colors.size()||mesh.colors.empty());// The number of vertices has to be equal for both shape and colour, or, alternatively, it has to be a shape-only model.
assert(mesh.vertices.size()==mesh.colors.size()||mesh.colors.empty());// The number of vertices has to be equal for both shape and colour, or, alternatively, it has to be a shape-only model.
//assert(mesh.vertices.size() == mesh.texcoords.size() || mesh.texcoords.empty()); // same for the texcoords
//assert(mesh.vertices.size() == mesh.texcoords.size() || mesh.texcoords.empty()); // same for the texcoords
py::modulecore_module=eos_module.def_submodule("core","Essential functions and classes to work with 3D face models and landmarks.");
py::modulecore_module=eos_module.def_submodule("core","Essential functions and classes to work with 3D face models and landmarks.");
py::class_<core::LandmarkMapper>(core_module,"LandmarkMapper","Represents a mapping from one kind of landmarks to a different format(e.g.model vertices).")
py::class_<core::LandmarkMapper>(core_module,"LandmarkMapper","Represents a mapping from one kind of landmarks to a different format(e.g.model vertices).")
...
@@ -65,20 +66,12 @@ PYBIND11_PLUGIN(eos) {
...
@@ -65,20 +66,12 @@ PYBIND11_PLUGIN(eos) {
// We can't expose the convert member function yet - need std::optional (or some trick with self/this and a lambda)
// We can't expose the convert member function yet - need std::optional (or some trick with self/this and a lambda)
;
;
/**
py::class_<core::Mesh>(core_module,"Mesh","This class represents a 3D mesh consisting of vertices, vertex colour information and texture coordinates.")
py::modulerender_module=eos_module.def_submodule("render","3D mesh and texture extraction functionality.");
py::class_<render::Mesh>(render_module,"Mesh","This class represents a 3D mesh consisting of vertices, vertex colour information and texture coordinates.")
},"Extracts the texture of the face from the given image and stores it as isomap (a rectangular texture map).",py::arg("mesh"),py::arg("rendering_params"),py::arg("image"),py::arg("compute_view_angle")=false,py::arg("isomap_resolution")=512);
},"Extracts the texture of the face from the given image and stores it as isomap (a rectangular texture map).",py::arg("mesh"),py::arg("rendering_params"),py::arg("image"),py::arg("compute_view_angle")=false,py::arg("isomap_resolution")=512);