DLS test update

This commit is contained in:
edgarriba 2014-08-11 09:44:24 +02:00
parent 2d26f60192
commit 213241c06a
2 changed files with 8 additions and 7 deletions

View File

@ -161,7 +161,7 @@ public:
float* err = _err.getMat().ptr<float>();
for ( i = 0; i < count; ++i)
err[i] = cv::norm( ipoints_ptr[i] - projpoints_ptr[i] );
err[i] = (float)cv::norm( ipoints_ptr[i] - projpoints_ptr[i] );
}

View File

@ -136,7 +136,7 @@ protected:
}
solvePnPRansac(points, projectedPoints, intrinsics, distCoeffs, rvec, tvec,
false, 500, 0.5, 0.99, inliers, method);
false, 500, 0.5, 0.9, inliers, method);
bool isTestSuccess = inliers.size() >= points.size()*0.95;
@ -155,11 +155,9 @@ protected:
ts->set_failed_test_info(cvtest::TS::OK);
vector<Point3f> points, points_dls;
const int pointsCount = 500, pointsCount2 = 100;
const int pointsCount = 500;
points.resize(pointsCount);
points_dls.resize(pointsCount2);
generate3DPointCloud(points);
generate3DPointCloud(points_dls);
const int methodsCount = 4;
RNG rng = ts->get_rng();
@ -173,8 +171,7 @@ protected:
int successfulTestsCount = 0;
for (int testIndex = 0; testIndex < totalTestsCount; testIndex++)
{
vector<Point3f> points_ = method != 3 ? points : points_dls;
if (runTest(rng, mode, method, points_, eps, maxError))
if (runTest(rng, mode, method, points, eps, maxError))
successfulTestsCount++;
}
//cout << maxError << " " << successfulTestsCount << endl;
@ -222,6 +219,10 @@ protected:
{
opoints = std::vector<Point3f>(points.begin(), points.begin()+4);
}
else if(method == 3)
{
opoints = std::vector<Point3f>(points.begin(), points.begin()+20);
}
else
opoints = points;