OpenCV CV 查找单应断言错误计数器 = > 4
OpenCV CV findHomography assertion error counter = > 4
我正在使用编译和运行来自 Features2D + findHomography 的代码以查找已知对象教程,我得到此错误计数器 => 4 ;我更改了我的代码并在任何地方使用显式命名空间说明符,但问题没有解决。如果可以,请帮助我解决这个问题,或者说哪个函数与findHomography做同样的事情,并且不要使程序崩溃。 这是我的代码 #include "opencv2/opencv.hpp" 使用命名空间 CV;
int main()
{
vector<Point2f> t1;
vector<Point2f> t2;
vector<Point2f> t3;
t3.push_back(Point2f(282, 304));
t1.push_back ( Point2f(249,456));
t1.push_back ( Point2f(264, 330));
t1.push_back ( Point2f(301, 329));
t1.push_back ( Point2f(308, 327));
t1.push_back ( Point2f(293, 249));
t1.push_back ( Point2f(322, 245));
t1.push_back ( Point2f(321, 225));
t1.push_back ( Point2f(266, 228));
t2.push_back ( Point2f(0, 0));
t2.push_back ( Point2f(15, 994));
t2.push_back ( Point2f(105, 994));
t2.push_back ( Point2f(120, 1009));
t2.push_back ( Point2f(90, 2016));
t2.push_back ( Point2f(180, 2031));
t2.push_back ( Point2f(180, 2432));
t2.push_back ( Point2f(0, 2432));
//-- Get the corners from t1 t2
vector<Point2f>pt4;
if (t1.size() >=4 && t2.size()>=4 )
{
Mat h =findHomography(t1, t2, CV_RANSAC, 5);
//-- this may create a mistake;
perspectiveTransform(t3, pt4, h);
for (int m = 0; m < pt4.size(); m++)
cout << pt4[m]<<endl;
}
它可以在调试模式下成功运行,但不能在发布模式下成功运行。怎么了,谢谢。
以这种方式配置,可能会出现调试可以运行但无法在发布下运行的情况(例如没有图片加载、内存错误(,这是 OpenCV 自 2.4.1 以来的错误。如果发生这种情况,打开当前项目(注意当前项目的属性页,而不是公共属性页(,调试或发布错误的,将带有或不带 D 的相应 lib 添加到"当前"工程属性中 ->> [链接器] -> [附加依赖项]
相关文章:
- 循环在计数器中不起作用
- EASTL矢量<向量<int>>连续的
- python集合的C++等价物是什么.计数器
- Python 集合.计数器,如何避免重复查找
- 请解释字谜的代码,我看不懂计数器数组,每个值已经是0
- std::shared_ptr 自定义参考计数器
- 英特尔 TBB 程序不会终止,可能会误用参考计数器
- 不正确的比较和交换计数器输出用于快速排序功能
- OpenSSL API,使用GCM(伽罗瓦计数器模式)进行AES加密
- C++ 在循环中添加计数器变量并再次初始化其值
- 需要帮助才能在C++中创建类计数器
- 漂亮的计数器习语的错误或格式错误的静态订单惨败?
- 几乎总是自动和带计数器的循环
- 线程使用计数器C++
- 为什么使用 2 个嵌套循环 O(n^2) 复杂度来解决二和问题,当只改变循环计数器逻辑时运行得更快?
- 对于循环计数器不递增
- C++输出的就地计数器
- 在两个值之间嵌入C计数器
- 如何在C++中创建 2d 数组,其中一部分包含循环计数器,另一部分包含数字列表?
- 当输出达到某个值时,如何在 c++ 中中断计数器循环