提交 db451f20 编写于 作者: A Alexander Alekhin

test: don't use points on single line for solvePnP

上级 7a9ed396
......@@ -322,10 +322,12 @@ TEST(Calib3d_SolvePnPRansac, input_type)
std::vector<cv::Point3f> points3d;
std::vector<cv::Point2f> points2d;
for (int i = 0; i < numPoints; i++)
for (int i = 0; i < numPoints; i+=2)
{
points3d.push_back(cv::Point3i(i, 0, 0));
points2d.push_back(cv::Point2i(i, 0));
points3d.push_back(cv::Point3i(5+i, 3, 2));
points3d.push_back(cv::Point3i(5+i, 3+i, 2+i));
points2d.push_back(cv::Point2i(0, i));
points2d.push_back(cv::Point2i(-i, i));
}
Mat R1, t1, R2, t2, R3, t3, R4, t4;
......@@ -359,12 +361,16 @@ TEST(Calib3d_SolvePnP, double_support)
std::vector<cv::Point2d> points2d;
std::vector<cv::Point3f> points3dF;
std::vector<cv::Point2f> points2dF;
for (int i = 0; i < 10 ; i++)
for (int i = 0; i < 10 ; i+=2)
{
points3d.push_back(cv::Point3d(i,0,0));
points3dF.push_back(cv::Point3d(i,0,0));
points2d.push_back(cv::Point2d(i,0));
points2dF.push_back(cv::Point2d(i,0));
points3d.push_back(cv::Point3d(5+i, 3, 2));
points3dF.push_back(cv::Point3d(5+i, 3, 2));
points3d.push_back(cv::Point3d(5+i, 3+i, 2+i));
points3dF.push_back(cv::Point3d(5+i, 3+i, 2+i));
points2d.push_back(cv::Point2d(0, i));
points2dF.push_back(cv::Point2d(0, i));
points2d.push_back(cv::Point2d(-i, i));
points2dF.push_back(cv::Point2d(-i, i));
}
Mat R,t, RF, tF;
vector<int> inliers;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册