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
8ac339ec
Commit
8ac339ec
authored
Dec 31, 2015
by
Patrik Huber
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made shape and blendshape coefficients accessible via out-parameters
parent
2d230b74
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
include/eos/fitting/fitting.hpp
include/eos/fitting/fitting.hpp
+5
-1
No files found.
include/eos/fitting/fitting.hpp
View file @
8ac339ec
...
@@ -48,9 +48,11 @@ namespace eos {
...
@@ -48,9 +48,11 @@ namespace eos {
* @param[in] image_points 2D landmarks from an image to fit the model to.
* @param[in] image_points 2D landmarks from an image to fit the model to.
* @param[in] vertex_indices The vertex indices in the model that correspond to the 2D points.
* @param[in] vertex_indices The vertex indices in the model that correspond to the 2D points.
* @param[in] lambda Regularisation parameter of the PCA shape fitting.
* @param[in] lambda Regularisation parameter of the PCA shape fitting.
* @param[out] pca_shape_coefficients Optional parameter that, if given, will contain the resulting pca shape coefficients.
* @param[out] blendshape_coefficients Optional parameter that, if given, will contain the resulting blendshape coefficients.
* @return The fitted model shape instance.
* @return The fitted model shape instance.
*/
*/
cv
::
Mat
fit_shape_model
(
cv
::
Mat
affine_camera_matrix
,
eos
::
morphablemodel
::
MorphableModel
morphable_model
,
std
::
vector
<
eos
::
morphablemodel
::
Blendshape
>
blendshapes
,
std
::
vector
<
cv
::
Vec2f
>
image_points
,
std
::
vector
<
int
>
vertex_indices
,
float
lambda
=
3.0
f
)
cv
::
Mat
fit_shape_model
(
cv
::
Mat
affine_camera_matrix
,
eos
::
morphablemodel
::
MorphableModel
morphable_model
,
std
::
vector
<
eos
::
morphablemodel
::
Blendshape
>
blendshapes
,
std
::
vector
<
cv
::
Vec2f
>
image_points
,
std
::
vector
<
int
>
vertex_indices
,
float
lambda
=
3.0
f
,
std
::
vector
<
float
>&
pca_shape_coefficients
=
std
::
vector
<
float
>
(),
std
::
vector
<
float
>&
blendshape_coefficients
=
std
::
vector
<
float
>
()
)
{
{
using
cv
::
Mat
;
using
cv
::
Mat
;
...
@@ -81,6 +83,8 @@ cv::Mat fit_shape_model(cv::Mat affine_camera_matrix, eos::morphablemodel::Morph
...
@@ -81,6 +83,8 @@ cv::Mat fit_shape_model(cv::Mat affine_camera_matrix, eos::morphablemodel::Morph
combined_shape
=
pca_model_shape
+
blendshapes_as_basis
*
Mat
(
current_blendshape_coeffs
);
combined_shape
=
pca_model_shape
+
blendshapes_as_basis
*
Mat
(
current_blendshape_coeffs
);
}
while
(
std
::
abs
(
cv
::
norm
(
current_pca_coeffs
)
-
cv
::
norm
(
last_pca_coeffs
))
>=
0.01
||
std
::
abs
(
cv
::
norm
(
current_blendshape_coeffs
)
-
cv
::
norm
(
last_blendshape_coeffs
))
>=
0.01
);
}
while
(
std
::
abs
(
cv
::
norm
(
current_pca_coeffs
)
-
cv
::
norm
(
last_pca_coeffs
))
>=
0.01
||
std
::
abs
(
cv
::
norm
(
current_blendshape_coeffs
)
-
cv
::
norm
(
last_blendshape_coeffs
))
>=
0.01
);
pca_shape_coefficients
=
current_pca_coeffs
;
blendshape_coefficients
=
current_blendshape_coeffs
;
return
combined_shape
;
return
combined_shape
;
};
};
...
...
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