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
9be82386
Commit
9be82386
authored
Nov 07, 2016
by
Patrik Huber
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed fit-model compilation, used new linear ortho estimation as default
parent
03151c96
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
examples/fit-model.cpp
examples/fit-model.cpp
+7
-5
No files found.
examples/fit-model.cpp
View file @
9be82386
...
@@ -19,7 +19,8 @@
...
@@ -19,7 +19,8 @@
*/
*/
#include "eos/core/Landmark.hpp"
#include "eos/core/Landmark.hpp"
#include "eos/core/LandmarkMapper.hpp"
#include "eos/core/LandmarkMapper.hpp"
#include "eos/fitting/nonlinear_camera_estimation.hpp"
#include "eos/fitting/orthographic_camera_estimation_linear.hpp"
#include "eos/fitting/RenderingParameters.hpp"
#include "eos/fitting/linear_shape_fitting.hpp"
#include "eos/fitting/linear_shape_fitting.hpp"
#include "eos/render/utils.hpp"
#include "eos/render/utils.hpp"
#include "eos/render/texture_extraction.hpp"
#include "eos/render/texture_extraction.hpp"
...
@@ -187,14 +188,15 @@ int main(int argc, char *argv[])
...
@@ -187,14 +188,15 @@ int main(int argc, char *argv[])
}
}
// Estimate the camera (pose) from the 2D - 3D point correspondences
// Estimate the camera (pose) from the 2D - 3D point correspondences
fitting
::
RenderingParameters
rendering_params
=
fitting
::
estimate_orthographic_camera
(
image_points
,
model_points
,
image
.
cols
,
image
.
rows
);
fitting
::
ScaledOrthoProjectionParameters
pose
=
fitting
::
estimate_orthographic_projection_linear
(
image_points
,
model_points
,
true
,
image
.
rows
);
Mat
affine_from_ortho
=
get_3x4_affine_camera_matrix
(
rendering_params
,
image
.
cols
,
image
.
rows
);
fitting
::
RenderingParameters
rendering_params
(
pose
,
image
.
cols
,
image
.
rows
);
// The 3D head pose can be recovered as follows:
// The 3D head pose can be recovered as follows:
float
yaw_angle
=
glm
::
degrees
(
rendering_params
.
r_y
);
float
yaw_angle
=
glm
::
degrees
(
glm
::
yaw
(
rendering_params
.
get_rotation
())
);
// and similarly for pitch
(r_x) and roll (r_z)
.
// and similarly for pitch
and roll
.
// Estimate the shape coefficients by fitting the shape to the landmarks:
// Estimate the shape coefficients by fitting the shape to the landmarks:
Mat
affine_from_ortho
=
fitting
::
get_3x4_affine_camera_matrix
(
rendering_params
,
image
.
cols
,
image
.
rows
);
vector
<
float
>
fitted_coeffs
=
fitting
::
fit_shape_to_landmarks_linear
(
morphable_model
,
affine_from_ortho
,
image_points
,
vertex_indices
);
vector
<
float
>
fitted_coeffs
=
fitting
::
fit_shape_to_landmarks_linear
(
morphable_model
,
affine_from_ortho
,
image_points
,
vertex_indices
);
// Obtain the full mesh with the estimated coefficients:
// Obtain the full mesh with the estimated coefficients:
...
...
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