Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
eos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Richard Torenvliet
eos
Commits
38d49f1b
Commit
38d49f1b
authored
Aug 02, 2015
by
Patrik Huber
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fit-model now stores a textured obj and no landmark image anymore.
Also updated the documentation of Mesh.
parent
1647daf1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
7 deletions
+17
-7
examples/fit-model.cpp
examples/fit-model.cpp
+4
-2
include/eos/render/Mesh.hpp
include/eos/render/Mesh.hpp
+13
-5
No files found.
examples/fit-model.cpp
View file @
38d49f1b
...
@@ -206,7 +206,7 @@ int main(int argc, char *argv[])
...
@@ -206,7 +206,7 @@ int main(int argc, char *argv[])
// Obtain the full mesh and draw it using the estimated camera:
// Obtain the full mesh and draw it using the estimated camera:
render
::
Mesh
mesh
=
morphable_model
.
draw_sample
(
fitted_coeffs
,
vector
<
float
>
());
render
::
Mesh
mesh
=
morphable_model
.
draw_sample
(
fitted_coeffs
,
vector
<
float
>
());
outputfile
+=
fs
::
path
(
".obj"
);
outputfile
+=
fs
::
path
(
".obj"
);
render
::
write_obj
(
mesh
,
outputfile
.
string
());
// save the mesh as obj
render
::
write_
textured_
obj
(
mesh
,
outputfile
.
string
());
// save the mesh as obj
// Draw the projected points again, this time using the fitted model shape:
// Draw the projected points again, this time using the fitted model shape:
for
(
auto
&&
idx
:
vertex_indices
)
{
for
(
auto
&&
idx
:
vertex_indices
)
{
...
@@ -215,7 +215,9 @@ int main(int argc, char *argv[])
...
@@ -215,7 +215,9 @@ int main(int argc, char *argv[])
cv
::
circle
(
outimg
,
cv
::
Point2f
(
screen_point
),
3
,
{
0.0
f
,
0.0
f
,
255.0
f
});
cv
::
circle
(
outimg
,
cv
::
Point2f
(
screen_point
),
3
,
{
0.0
f
,
0.0
f
,
255.0
f
});
}
}
// Save the output image:
// Save an output image with the landmarks from the different stages:
//outputfile.replace_extension(".png");
//cv::imwrite(outputfile.string(), outimg);
outputfile
.
replace_extension
(
".png"
);
outputfile
.
replace_extension
(
".png"
);
cv
::
imwrite
(
outputfile
.
string
(),
outimg
);
cv
::
imwrite
(
outputfile
.
string
(),
outimg
);
...
...
include/eos/render/Mesh.hpp
View file @
38d49f1b
...
@@ -40,8 +40,10 @@ namespace eos {
...
@@ -40,8 +40,10 @@ namespace eos {
namespace
render
{
namespace
render
{
/**
/**
* This class represents a 3D mesh consisting of vertices and vertex color
* @brief This class represents a 3D mesh consisting of vertices, vertex colour
* information. Additionally it stores the indices that specify which vertices
* information and texture coordinates.
*
* Additionally it stores the indices that specify which vertices
* to use to generate the triangle mesh out of the vertices.
* to use to generate the triangle mesh out of the vertices.
*/
*/
struct
Mesh
struct
Mesh
...
@@ -55,7 +57,9 @@ struct Mesh
...
@@ -55,7 +57,9 @@ struct Mesh
};
};
/**
/**
* Writes an obj file of the given Mesh that can be read by e.g. Meshlab.
* @brief 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.
*
*
* @param[in] mesh The mesh to save as obj.
* @param[in] mesh The mesh to save as obj.
* @param[in] filename Output filename.
* @param[in] filename Output filename.
...
@@ -86,8 +90,12 @@ inline void write_obj(Mesh mesh, std::string filename)
...
@@ -86,8 +90,12 @@ inline void write_obj(Mesh mesh, std::string filename)
}
}
/**
/**
* Writes an obj file of the given Mesh that can be read by e.g. Meshlab.
* @brief Writes an obj file of the given Mesh, including texture coordinates,
* Saves texture coordinates and texture information as well.
* and an mtl file containing a reference to the isomap.
*
* The obj will contain texture coordinates for the mesh, and the
* mtl file will link to a file named <filename>.isomap.png.
* Note that the texture (isomap) has to be stored separately.
*
*
* @param[in] mesh The mesh to save as obj.
* @param[in] mesh The mesh to save as obj.
* @param[in] filename Output filename.
* @param[in] filename Output filename.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment