diff --git a/samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/CMakeLists.txt b/samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/CMakeLists.txt index 0e6dd14fc..dc5d24323 100644 --- a/samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/CMakeLists.txt +++ b/samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/CMakeLists.txt @@ -7,9 +7,7 @@ include_directories( ${OpenCV_INCLUDE_DIRS} ) -add_executable( -pnp_registration - src/main_registration.cpp +add_library(pnp_lib src/CsvReader.cpp src/CsvWriter.cpp src/ModelRegistration.cpp @@ -17,41 +15,14 @@ pnp_registration src/Model.cpp src/PnPProblem.cpp src/Utils.cpp - src/RobustMatcher.cpp -) + src/RobustMatcher.cpp) -add_executable( -pnp_verification - src/main_verification.cpp - src/CsvReader.cpp - src/CsvWriter.cpp - src/ModelRegistration.cpp - src/Mesh.cpp - src/Model.cpp - src/PnPProblem.cpp - src/Utils.cpp - src/RobustMatcher.cpp -) +add_executable( pnp_registration src/main_registration.cpp ) +add_executable( pnp_verification src/main_verification.cpp ) +add_executable( pnp_detection src/main_detection.cpp ) +add_executable( pnp_test src/test_pnp.cpp ) -add_executable( -pnp_detection - src/main_detection.cpp - src/CsvReader.cpp - src/CsvWriter.cpp - src/ModelRegistration.cpp - src/Mesh.cpp - src/Model.cpp - src/PnPProblem.cpp - src/Utils.cpp - src/RobustMatcher.cpp -) - -add_executable( -pnp_test - src/test_pnp.cpp -) - -target_link_libraries( pnp_registration ${OpenCV_LIBS} ) -target_link_libraries( pnp_verification ${OpenCV_LIBS} ) -target_link_libraries( pnp_detection ${OpenCV_LIBS} ) -target_link_libraries( pnp_test ${OpenCV_LIBS} ) +target_link_libraries( pnp_registration pnp_lib ${OpenCV_LIBS} ) +target_link_libraries( pnp_verification pnp_lib ${OpenCV_LIBS} ) +target_link_libraries( pnp_detection pnp_lib ${OpenCV_LIBS} ) +target_link_libraries( pnp_test pnp_lib ${OpenCV_LIBS} ) diff --git a/samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/src/main_verification.cpp b/samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/src/main_verification.cpp index 1b948be4d..17bc96dfa 100644 --- a/samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/src/main_verification.cpp +++ b/samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/src/main_verification.cpp @@ -256,7 +256,7 @@ int main(int, char**) pnp_verification_epnp.estimatePose( list_points3d_model_match, list_points2d_scene_match, cv::EPNP); pnp_verification_iter.estimatePose( list_points3d_model_match, list_points2d_scene_match, cv::ITERATIVE); //pnp_verification_p3p.estimatePose( list_points3d_model_match, list_points2d_scene_match, cv::P3P); - pnp_verification_dls.estimatePose( list_points3d_model_match, list_points2d_scene_match, cv::DLS); + //pnp_verification_dls.estimatePose( list_points3d_model_match, list_points2d_scene_match, cv::DLS); // Draw mesh drawObjectMesh(img_vis, &mesh, &pnp_verification_dls, green);