Skip to content

Commit

Permalink
Moved stuff around a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
patrikhuber committed Dec 2, 2016
1 parent 1faf7fd commit 82edd0f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions apps/4dface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,12 +209,15 @@ int main(int argc, char *argv[])
vector<Vec2f> 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:
Expand All @@ -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();
Expand Down

0 comments on commit 82edd0f

Please sign in to comment.