From a37640cdd048e284d969126f572e33cecc40a0b3 Mon Sep 17 00:00:00 2001 From: Alexander Shishkov Date: Mon, 18 Aug 2014 18:34:01 +0400 Subject: [PATCH] Update perf_pnp.cpp --- modules/calib3d/perf/perf_pnp.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/modules/calib3d/perf/perf_pnp.cpp b/modules/calib3d/perf/perf_pnp.cpp index c9579321d2..9b76bad2b9 100644 --- a/modules/calib3d/perf/perf_pnp.cpp +++ b/modules/calib3d/perf/perf_pnp.cpp @@ -10,7 +10,7 @@ using namespace perf; using std::tr1::make_tuple; using std::tr1::get; -CV_ENUM(pnpAlgo, SOLVEPNP_ITERATIVE, SOLVEPNP_EPNP, SOLVEPNP_DLS /*, P3P*/) +CV_ENUM(pnpAlgo, SOLVEPNP_ITERATIVE, SOLVEPNP_EPNP, SOLVEPNP_P3P, SOLVEPNP_DLS) typedef std::tr1::tuple PointsNum_Algo_t; typedef perf::TestBaseWithParam PointsNum_Algo; @@ -20,7 +20,7 @@ typedef perf::TestBaseWithParam PointsNum; PERF_TEST_P(PointsNum_Algo, solvePnP, testing::Combine( testing::Values(4, 3*9, 7*13), //TODO: find why results on 4 points are too unstable - testing::Values((int)SOLVEPNP_ITERATIVE, (int)SOLVEPNP_EPNP, (int)SOLVEPNP_DLS) + testing::Values((int)SOLVEPNP_ITERATIVE, (int)SOLVEPNP_EPNP) ) ) { @@ -62,9 +62,15 @@ PERF_TEST_P(PointsNum_Algo, solvePnP, SANITY_CHECK(tvec, 1e-6); } -PERF_TEST(PointsNum_Algo, solveP3P) +PERF_TEST_P(PointsNum_Algo, solvePnPSmallPoints, + testing::Combine( + testing::Values(4), //TODO: find why results on 4 points are too unstable + testing::Values((int)SOLVEPNP_P3P, (int)SOLVEPNP_DLS) + ) + ) { - int pointsNum = 4; + int pointsNum = get<0>(GetParam()); + pnpAlgo algo = get<1>(GetParam()); vector points2d(pointsNum); vector points3d(pointsNum); @@ -94,7 +100,7 @@ PERF_TEST(PointsNum_Algo, solveP3P) TEST_CYCLE_N(1000) { - solvePnP(points3d, points2d, intrinsics, distortion, rvec, tvec, false, SOLVEPNP_P3P); + solvePnP(points3d, points2d, intrinsics, distortion, rvec, tvec, false, algo); } SANITY_CHECK(rvec, 1e-6);