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
9b17ea9b
Commit
9b17ea9b
authored
Aug 22, 2016
by
Patrik Huber
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added to_matrix() to blendshapes
parent
c2b4ba1c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
include/eos/morphablemodel/Blendshape.hpp
include/eos/morphablemodel/Blendshape.hpp
+20
-0
No files found.
include/eos/morphablemodel/Blendshape.hpp
View file @
9b17ea9b
...
...
@@ -29,6 +29,8 @@
#include "opencv2/core/core.hpp"
#include <string>
#include <vector>
#include <cassert>
#include <fstream>
namespace
eos
{
...
...
@@ -81,6 +83,24 @@ std::vector<Blendshape> load_blendshapes(std::string filename)
return
blendshapes
;
};
/**
* @brief Copies the blendshapes into a matrix, with each column being a blendshape.
*
* @param[in] blendshapes Vector of blendshapes.
* @return The resulting matrix.
*/
cv
::
Mat
to_matrix
(
const
std
::
vector
<
Blendshape
>&
blendshapes
)
{
// assert: all blendshapes have to have the same number of rows, and one col
assert
(
blendshapes
.
size
()
>
0
);
cv
::
Mat
blendshapes_as_basis
(
blendshapes
[
0
].
deformation
.
rows
,
blendshapes
.
size
(),
CV_32FC1
);
for
(
int
i
=
0
;
i
<
blendshapes
.
size
();
++
i
)
{
blendshapes
[
i
].
deformation
.
copyTo
(
blendshapes_as_basis
.
col
(
i
));
}
return
blendshapes_as_basis
;
};
}
/* namespace morphablemodel */
}
/* namespace eos */
...
...
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