Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
eos
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Richard Torenvliet
eos
Commits
8ac339ec
Commit
8ac339ec
authored
9 years ago
by
Patrik Huber
Browse files
Options
Downloads
Patches
Plain Diff
Made shape and blendshape coefficients accessible via out-parameters
parent
2d230b74
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
include/eos/fitting/fitting.hpp
+5
-1
5 additions, 1 deletion
include/eos/fitting/fitting.hpp
with
5 additions
and
1 deletion
include/eos/fitting/fitting.hpp
+
5
−
1
View file @
8ac339ec
...
...
@@ -48,9 +48,11 @@ namespace eos {
* @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] 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.
*/
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
;
...
...
@@ -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
);
}
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
;
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment