From 82edd0f3491067c12170a4f60cd5a0a430599aa9 Mon Sep 17 00:00:00 2001 From: Patrik Huber Date: Fri, 2 Dec 2016 19:13:23 +0000 Subject: [PATCH] Moved stuff around a bit --- apps/4dface.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/4dface.cpp b/apps/4dface.cpp index 9bae0cd..e3b2442 100644 --- a/apps/4dface.cpp +++ b/apps/4dface.cpp @@ -209,12 +209,15 @@ int main(int argc, char *argv[]) vector image_points; render::Mesh mesh; std::tie(mesh, rendering_params) = fitting::fit_shape_and_pose(morphable_model, blendshapes, rcr_to_eos_landmark_collection(current_landmarks), landmark_mapper, unmodified_frame.cols, unmodified_frame.rows, edge_topology, ibug_contour, model_contour, 3, 5, 15.0f, boost::none, shape_coefficients, blendshape_coefficients, image_points); - Mat affine_cam = fitting::get_3x4_affine_camera_matrix(rendering_params, frame.cols, frame.rows); // Draw the 3D pose of the face: draw_axes_topright(glm::eulerAngles(rendering_params.get_rotation())[0], glm::eulerAngles(rendering_params.get_rotation())[1], glm::eulerAngles(rendering_params.get_rotation())[2], frame); + + // Wireframe rendering of mesh of this frame (non-averaged): + draw_wireframe(frame, mesh, rendering_params.get_modelview(), rendering_params.get_projection(), fitting::get_opencv_viewport(frame.cols, frame.rows)); - // Get the fitted mesh, extract the texture: + // Extract the texture using the fitted mesh from this frame: + Mat affine_cam = fitting::get_3x4_affine_camera_matrix(rendering_params, frame.cols, frame.rows); Mat isomap = render::extract_texture(mesh, affine_cam, unmodified_frame, true, render::TextureInterpolation::NearestNeighbour, 512); // Merge the isomaps - add the current one to the already merged ones: @@ -224,9 +227,6 @@ int main(int argc, char *argv[]) auto merged_shape = morphable_model.get_shape_model().draw_sample(shape_coefficients) + morphablemodel::to_matrix(blendshapes) * Mat(blendshape_coefficients); render::Mesh merged_mesh = morphablemodel::sample_to_mesh(merged_shape, morphable_model.get_color_model().get_mean(), morphable_model.get_shape_model().get_triangle_list(), morphable_model.get_color_model().get_triangle_list(), morphable_model.get_texture_coordinates()); - // Wireframe rendering of mesh of this frame (non-averaged): - draw_wireframe(frame, mesh, rendering_params.get_modelview(), rendering_params.get_projection(), fitting::get_opencv_viewport(frame.cols, frame.rows)); - // Render the model in a separate window using the estimated pose, shape and merged texture: Mat rendering; auto modelview_no_translation = rendering_params.get_modelview();