Add UPNP acc_test and perf_test

pull/3308/head
edgarriba 11 years ago
parent a5b3a205d9
commit 7429454171
  1. 4
      modules/calib3d/perf/perf_pnp.cpp
  2. 8
      modules/calib3d/test/test_solvepnp_ransac.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_P3P, SOLVEPNP_DLS)
CV_ENUM(pnpAlgo, SOLVEPNP_ITERATIVE, SOLVEPNP_EPNP, SOLVEPNP_P3P, SOLVEPNP_DLS, SOLVEPNP_UPNP)
typedef std::tr1::tuple<int, pnpAlgo> PointsNum_Algo_t;
typedef perf::TestBaseWithParam<PointsNum_Algo_t> PointsNum_Algo;
@ -20,7 +20,7 @@ typedef perf::TestBaseWithParam<int> 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)
testing::Values((int)SOLVEPNP_ITERATIVE, (int)SOLVEPNP_EPNP, (int)SOLVEPNP_UPNP)
)
)
{

@ -58,6 +58,7 @@ public:
eps[SOLVEPNP_EPNP] = 1.0e-2;
eps[SOLVEPNP_P3P] = 1.0e-2;
eps[SOLVEPNP_DLS] = 1.0e-2;
eps[SOLVEPNP_UPNP] = 1.0e-2;
totalTestsCount = 10;
}
~CV_solvePnPRansac_Test() {}
@ -118,6 +119,7 @@ protected:
Mat trueRvec, trueTvec;
Mat intrinsics, distCoeffs;
generateCameraMatrix(intrinsics, rng);
if (method == 4) intrinsics.at<double>(1,1) = intrinsics.at<double>(0,0);
if (mode == 0)
distCoeffs = Mat::zeros(4, 1, CV_64FC1);
else
@ -159,7 +161,7 @@ protected:
points.resize(pointsCount);
generate3DPointCloud(points);
const int methodsCount = 4;
const int methodsCount = 5;
RNG rng = ts->get_rng();
@ -184,7 +186,7 @@ protected:
}
}
}
double eps[4];
double eps[5];
int totalTestsCount;
};
@ -197,6 +199,7 @@ public:
eps[SOLVEPNP_EPNP] = 1.0e-6;
eps[SOLVEPNP_P3P] = 1.0e-4;
eps[SOLVEPNP_DLS] = 1.0e-4;
eps[SOLVEPNP_UPNP] = 1.0e-4;
totalTestsCount = 1000;
}
@ -208,6 +211,7 @@ protected:
Mat trueRvec, trueTvec;
Mat intrinsics, distCoeffs;
generateCameraMatrix(intrinsics, rng);
if (method == 4) intrinsics.at<double>(1,1) = intrinsics.at<double>(0,0);
if (mode == 0)
distCoeffs = Mat::zeros(4, 1, CV_64FC1);
else

Loading…
Cancel
Save