Commit 37c6f436 authored by Patrik Huber's avatar Patrik Huber

Added new fit-model app that fits using the new iterative fitting

It uses pose, shape, blendshapes and contour fitting.
parent cee22f28
...@@ -33,10 +33,14 @@ if(MSVC) ...@@ -33,10 +33,14 @@ if(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj")
endif() endif()
# Model fitting (affine cam & shape to landmarks) example: # Simple model fitting (orthographic camera & shape to landmarks) example:
add_executable(fit-model-simple fit-model-simple.cpp) add_executable(fit-model-simple fit-model-simple.cpp)
target_link_libraries(fit-model-simple ${OpenCV_LIBS} ${Boost_LIBRARIES}) target_link_libraries(fit-model-simple ${OpenCV_LIBS} ${Boost_LIBRARIES})
# Model fitting example that fits orthographic camera, shape, blendshapes, and contours:
add_executable(fit-model fit-model.cpp)
target_link_libraries(fit-model ${OpenCV_LIBS} ${Boost_LIBRARIES})
if(BUILD_CERES_EXAMPLE) if(BUILD_CERES_EXAMPLE)
# Find Ceres, for the fit-model-ceres app: # Find Ceres, for the fit-model-ceres app:
find_package(Ceres REQUIRED) find_package(Ceres REQUIRED)
...@@ -56,5 +60,6 @@ target_link_libraries(generate-obj ${OpenCV_LIBS} ${Boost_LIBRARIES}) ...@@ -56,5 +60,6 @@ target_link_libraries(generate-obj ${OpenCV_LIBS} ${Boost_LIBRARIES})
# install target: # install target:
install(TARGETS fit-model-simple DESTINATION bin) install(TARGETS fit-model-simple DESTINATION bin)
install(TARGETS fit-model DESTINATION bin)
install(TARGETS generate-obj DESTINATION bin) install(TARGETS generate-obj DESTINATION bin)
install(DIRECTORY ${CMAKE_SOURCE_DIR}/examples/data DESTINATION bin) install(DIRECTORY ${CMAKE_SOURCE_DIR}/examples/data DESTINATION bin)
...@@ -105,7 +105,7 @@ LandmarkCollection<cv::Vec2f> read_pts_landmarks(std::string filename) ...@@ -105,7 +105,7 @@ LandmarkCollection<cv::Vec2f> read_pts_landmarks(std::string filename)
* model of a 3D Morphable Model from an ibug LFPW image with its landmarks. * model of a 3D Morphable Model from an ibug LFPW image with its landmarks.
* *
* First, the 68 ibug landmarks are loaded from the .pts file and converted * First, the 68 ibug landmarks are loaded from the .pts file and converted
* to vertex indices using the LandmarkMapper. Then, an affine camera matrix * to vertex indices using the LandmarkMapper. Then, an orthographic camera
* is estimated, and then, using this camera matrix, the shape is fitted * is estimated, and then, using this camera matrix, the shape is fitted
* to the landmarks. * to the landmarks.
*/ */
...@@ -131,7 +131,7 @@ int main(int argc, char *argv[]) ...@@ -131,7 +131,7 @@ int main(int argc, char *argv[])
po::variables_map vm; po::variables_map vm;
po::store(po::command_line_parser(argc, argv).options(desc).run(), vm); po::store(po::command_line_parser(argc, argv).options(desc).run(), vm);
if (vm.count("help")) { if (vm.count("help")) {
cout << "Usage: fit-model [options]" << endl; cout << "Usage: fit-model-simple [options]" << endl;
cout << desc; cout << desc;
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment