Skip to content

Commit b9a582c

Browse files
committed
Changed pose estimation to the new linear orthographic projection algorithm
1 parent 629f8bb commit b9a582c

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

apps/4dface.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@
2222
#include "eos/core/Landmark.hpp"
2323
#include "eos/core/LandmarkMapper.hpp"
2424
#include "eos/fitting/fitting.hpp"
25-
#include "eos/fitting/nonlinear_camera_estimation.hpp"
25+
#include "eos/fitting/orthographic_camera_estimation_linear.hpp"
2626
#include "eos/fitting/contour_correspondence.hpp"
27+
#include "eos/fitting/RenderingParameters.hpp"
2728
#include "eos/render/utils.hpp"
2829
#include "eos/render/render.hpp"
2930
#include "eos/render/texture_extraction.hpp"
@@ -200,7 +201,8 @@ int main(int argc, char *argv[])
200201
vector<Vec4f> model_points; // the corresponding points in the 3D shape model
201202
vector<int> vertex_indices; // their vertex indices
202203
std::tie(image_points, model_points, vertex_indices) = get_corresponding_pointset(current_landmarks, landmark_mapper, morphable_model);
203-
auto rendering_params = fitting::estimate_orthographic_camera(image_points, model_points, frame.cols, frame.rows);
204+
auto scaled_ortho_projection = fitting::estimate_orthographic_projection_linear(image_points, model_points, true, frame.rows);
205+
auto rendering_params = fitting::RenderingParameters(scaled_ortho_projection, frame.cols, frame.rows);
204206

205207
// Given the estimated pose, find 2D-3D contour correspondences:
206208
// These are the additional contour correspondences we're going to find and then use:
@@ -215,7 +217,8 @@ int main(int argc, char *argv[])
215217
image_points = concat(image_points, image_points_contour);
216218

217219
// Re-estimate the pose with all landmarks, including the contour landmarks:
218-
rendering_params = fitting::estimate_orthographic_camera(image_points, model_points, frame.cols, frame.rows);
220+
scaled_ortho_projection = fitting::estimate_orthographic_projection_linear(image_points, model_points, true, frame.rows);
221+
rendering_params = fitting::RenderingParameters(scaled_ortho_projection, frame.cols, frame.rows);
219222
Mat affine_cam = fitting::get_3x4_affine_camera_matrix(rendering_params, frame.cols, frame.rows);
220223

221224
// Fit the PCA shape model and expression blendshapes:

0 commit comments

Comments
 (0)