|
|
|
@ -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; |
|
|
|
|
|
|
|
|
|