Commit 213241c0 authored by edgarriba's avatar edgarriba

DLS test update

parent 2d26f601
...@@ -161,7 +161,7 @@ public: ...@@ -161,7 +161,7 @@ public:
float* err = _err.getMat().ptr<float>(); float* err = _err.getMat().ptr<float>();
for ( i = 0; i < count; ++i) 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] );
} }
......
...@@ -136,7 +136,7 @@ protected: ...@@ -136,7 +136,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.5, 0.9, inliers, method);
bool isTestSuccess = inliers.size() >= points.size()*0.95; bool isTestSuccess = inliers.size() >= points.size()*0.95;
...@@ -155,11 +155,9 @@ protected: ...@@ -155,11 +155,9 @@ protected:
ts->set_failed_test_info(cvtest::TS::OK); ts->set_failed_test_info(cvtest::TS::OK);
vector<Point3f> points, points_dls; vector<Point3f> points, points_dls;
const int pointsCount = 500, pointsCount2 = 100; const int pointsCount = 500;
points.resize(pointsCount); points.resize(pointsCount);
points_dls.resize(pointsCount2);
generate3DPointCloud(points); generate3DPointCloud(points);
generate3DPointCloud(points_dls);
const int methodsCount = 4; const int methodsCount = 4;
RNG rng = ts->get_rng(); RNG rng = ts->get_rng();
...@@ -173,8 +171,7 @@ protected: ...@@ -173,8 +171,7 @@ protected:
int successfulTestsCount = 0; int successfulTestsCount = 0;
for (int testIndex = 0; testIndex < totalTestsCount; testIndex++) 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++; successfulTestsCount++;
} }
//cout << maxError << " " << successfulTestsCount << endl; //cout << maxError << " " << successfulTestsCount << endl;
...@@ -222,6 +219,10 @@ protected: ...@@ -222,6 +219,10 @@ protected:
{ {
opoints = std::vector<Point3f>(points.begin(), points.begin()+4); opoints = std::vector<Point3f>(points.begin(), points.begin()+4);
} }
else if(method == 3)
{
opoints = std::vector<Point3f>(points.begin(), points.begin()+20);
}
else else
opoints = points; opoints = points;
......
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