Commit e944533f authored by Vadim Pisarevsky's avatar Vadim Pisarevsky

fixed compile warnings; reenabled solvePnPRansac.concurrency test

parent 85149f86
...@@ -669,7 +669,7 @@ TEST(Calib3d_Homography, fromImages) ...@@ -669,7 +669,7 @@ TEST(Calib3d_Homography, fromImages)
//-- Localize the model //-- Localize the model
std::vector<Point2f> pointframe1; std::vector<Point2f> pointframe1;
std::vector<Point2f> pointframe2; std::vector<Point2f> 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 //-- Get the keypoints from the good matches
pointframe1.push_back( keypoints_1[ good_matches[i].queryIdx ].pt ); pointframe1.push_back( keypoints_1[ good_matches[i].queryIdx ].pt );
......
...@@ -138,7 +138,7 @@ protected: ...@@ -138,7 +138,7 @@ protected:
} }
solvePnPRansac(points, projectedPoints, intrinsics, distCoeffs, rvec, tvec, 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; bool isTestSuccess = inliers.size() >= points.size()*0.95;
...@@ -254,10 +254,7 @@ protected: ...@@ -254,10 +254,7 @@ protected:
TEST(Calib3d_SolvePnPRansac, accuracy) { CV_solvePnPRansac_Test test; test.safe_run(); } TEST(Calib3d_SolvePnPRansac, accuracy) { CV_solvePnPRansac_Test test; test.safe_run(); }
TEST(Calib3d_SolvePnP, accuracy) { CV_solvePnP_Test test; test.safe_run(); } TEST(Calib3d_SolvePnP, accuracy) { CV_solvePnP_Test test; test.safe_run(); }
TEST(Calib3d_SolvePnPRansac, concurrency)
#ifdef HAVE_TBB
TEST(DISABLED_Calib3d_SolvePnPRansac, concurrency)
{ {
int count = 7*13; int count = 7*13;
...@@ -287,12 +284,11 @@ TEST(DISABLED_Calib3d_SolvePnPRansac, concurrency) ...@@ -287,12 +284,11 @@ TEST(DISABLED_Calib3d_SolvePnPRansac, concurrency)
{ {
// limit concurrency to get deterministic result // limit concurrency to get deterministic result
cv::theRNG().state = 20121010; theRNG().state = 20121010;
tbb::task_scheduler_init one_thread(1); setNumThreads(1);
solvePnPRansac(object, image, camera_mat, dist_coef, rvec1, tvec1); solvePnPRansac(object, image, camera_mat, dist_coef, rvec1, tvec1);
} }
if(1)
{ {
Mat rvec; Mat rvec;
Mat tvec; Mat tvec;
...@@ -306,8 +302,8 @@ TEST(DISABLED_Calib3d_SolvePnPRansac, concurrency) ...@@ -306,8 +302,8 @@ TEST(DISABLED_Calib3d_SolvePnPRansac, concurrency)
{ {
// single thread again // single thread again
cv::theRNG().state = 20121010; theRNG().state = 20121010;
tbb::task_scheduler_init one_thread(1); setNumThreads(1);
solvePnPRansac(object, image, camera_mat, dist_coef, rvec2, tvec2); solvePnPRansac(object, image, camera_mat, dist_coef, rvec2, tvec2);
} }
...@@ -316,9 +312,7 @@ TEST(DISABLED_Calib3d_SolvePnPRansac, concurrency) ...@@ -316,9 +312,7 @@ TEST(DISABLED_Calib3d_SolvePnPRansac, concurrency)
EXPECT_LT(rnorm, 1e-6); EXPECT_LT(rnorm, 1e-6);
EXPECT_LT(tnorm, 1e-6); EXPECT_LT(tnorm, 1e-6);
} }
#endif
TEST(Calib3d_SolvePnP, double_support) TEST(Calib3d_SolvePnP, double_support)
{ {
...@@ -338,8 +332,8 @@ TEST(Calib3d_SolvePnP, double_support) ...@@ -338,8 +332,8 @@ TEST(Calib3d_SolvePnP, double_support)
Mat R,t, RF, tF; Mat R,t, RF, tF;
vector<int> inliers; vector<int> inliers;
solvePnPRansac(points3dF, points2dF, intrinsics, cv::Mat(), RF, tF, 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, 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_<double>(RF), NORM_INF), 1e-3); ASSERT_LE(norm(R, Mat_<double>(RF), NORM_INF), 1e-3);
ASSERT_LE(norm(t, Mat_<double>(tF), NORM_INF), 1e-3); ASSERT_LE(norm(t, Mat_<double>(tF), NORM_INF), 1e-3);
......
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