From e944533f01a10626d7a0b9f8dab300cbb5232922 Mon Sep 17 00:00:00 2001 From: Vadim Pisarevsky Date: Tue, 26 May 2015 00:19:58 +0300 Subject: [PATCH] fixed compile warnings; reenabled solvePnPRansac.concurrency test --- modules/calib3d/test/test_homography.cpp | 2 +- modules/calib3d/test/test_solvepnp_ransac.cpp | 22 +++++++------------ 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/modules/calib3d/test/test_homography.cpp b/modules/calib3d/test/test_homography.cpp index fe03707388..38aa83605b 100644 --- a/modules/calib3d/test/test_homography.cpp +++ b/modules/calib3d/test/test_homography.cpp @@ -669,7 +669,7 @@ TEST(Calib3d_Homography, fromImages) //-- Localize the model std::vector pointframe1; std::vector pointframe2; - for( int i = 0; i < good_matches.size(); i++ ) + for( int i = 0; i < (int)good_matches.size(); i++ ) { //-- Get the keypoints from the good matches pointframe1.push_back( keypoints_1[ good_matches[i].queryIdx ].pt ); diff --git a/modules/calib3d/test/test_solvepnp_ransac.cpp b/modules/calib3d/test/test_solvepnp_ransac.cpp index a3dbd16775..835c3b4bb7 100644 --- a/modules/calib3d/test/test_solvepnp_ransac.cpp +++ b/modules/calib3d/test/test_solvepnp_ransac.cpp @@ -138,7 +138,7 @@ protected: } solvePnPRansac(points, projectedPoints, intrinsics, distCoeffs, rvec, tvec, - false, 500, 0.5, 0.99, inliers, method); + false, 500, 0.5f, 0.99, inliers, method); bool isTestSuccess = inliers.size() >= points.size()*0.95; @@ -254,10 +254,7 @@ protected: TEST(Calib3d_SolvePnPRansac, accuracy) { CV_solvePnPRansac_Test test; test.safe_run(); } TEST(Calib3d_SolvePnP, accuracy) { CV_solvePnP_Test test; test.safe_run(); } - -#ifdef HAVE_TBB - -TEST(DISABLED_Calib3d_SolvePnPRansac, concurrency) +TEST(Calib3d_SolvePnPRansac, concurrency) { int count = 7*13; @@ -287,12 +284,11 @@ TEST(DISABLED_Calib3d_SolvePnPRansac, concurrency) { // limit concurrency to get deterministic result - cv::theRNG().state = 20121010; - tbb::task_scheduler_init one_thread(1); + theRNG().state = 20121010; + setNumThreads(1); solvePnPRansac(object, image, camera_mat, dist_coef, rvec1, tvec1); } - if(1) { Mat rvec; Mat tvec; @@ -306,8 +302,8 @@ TEST(DISABLED_Calib3d_SolvePnPRansac, concurrency) { // single thread again - cv::theRNG().state = 20121010; - tbb::task_scheduler_init one_thread(1); + theRNG().state = 20121010; + setNumThreads(1); solvePnPRansac(object, image, camera_mat, dist_coef, rvec2, tvec2); } @@ -316,9 +312,7 @@ TEST(DISABLED_Calib3d_SolvePnPRansac, concurrency) EXPECT_LT(rnorm, 1e-6); EXPECT_LT(tnorm, 1e-6); - } -#endif TEST(Calib3d_SolvePnP, double_support) { @@ -338,8 +332,8 @@ TEST(Calib3d_SolvePnP, double_support) Mat R,t, RF, tF; vector inliers; - solvePnPRansac(points3dF, points2dF, intrinsics, cv::Mat(), RF, tF, true, 100, 8, 0.999, inliers, cv::SOLVEPNP_P3P); - solvePnPRansac(points3d, points2d, intrinsics, cv::Mat(), R, t, true, 100, 8, 0.999, inliers, cv::SOLVEPNP_P3P); + solvePnPRansac(points3dF, points2dF, intrinsics, cv::Mat(), RF, tF, true, 100, 8.f, 0.999, inliers, cv::SOLVEPNP_P3P); + solvePnPRansac(points3d, points2d, intrinsics, cv::Mat(), R, t, true, 100, 8.f, 0.999, inliers, cv::SOLVEPNP_P3P); ASSERT_LE(norm(R, Mat_(RF), NORM_INF), 1e-3); ASSERT_LE(norm(t, Mat_(tF), NORM_INF), 1e-3);