小编Rah*_*hul的帖子

如何在 C++ 中使用向量<Point2f>

我想使用此代码(源代码)在opencv中查找基本矩阵。

\n\n
int point_count = 100;\n    vector<Point2f> points1(point_count);\n    vector<Point2f> points2(point_count);\n\n    // initialize the points here ... */\n    for( int i = 0; i < point_count; i++ )\n    {\n        points1[i] = ...;\n        points2[i] = ...;\n    }\n\n    Mat fundamental_matrix =\n     findFundamentalMat(points1, points2, FM_RANSAC, 3, 0.99);\n
Run Code Online (Sandbox Code Playgroud)\n\n

但我不知道如何在for循环中初始化points1、point2。\n我尝试过使用:

\n\n
points1[i] = 10.0;\npoints1[i] = (10.0, 20.0);\npoints1[i] = {10.0, 20.0};\n
Run Code Online (Sandbox Code Playgroud)\n\n

但出现这样的错误

\n\n
no match for \xe2\x80\x98operator=\xe2\x80\x99 (operand types are \xe2\x80\x98cv::Point_<float>\xe2\x80\x99 and \xe2\x80\x98double\xe2\x80\x99)\n
Run Code Online (Sandbox Code Playgroud)\n\n

在所有这些中。

\n

c++ opencv

1
推荐指数
1
解决办法
1万
查看次数

标签 统计

c++ ×1

opencv ×1