【发布时间】:2020-07-24 20:24:11
【问题描述】:
我尝试将 2 张黑白图像与 opencv 提供的函数 (compare()) 进行比较。起初我声明了一些变量,然后我只是尝试比较黑白图像,就像在 opencv 的文档中一样。最后我只计算置信百分比。但是每次我运行 m 程序时都会出现这个错误:
OpenCV: terminate handler is called! The last OpenCV error is:
OpenCV(4.3.0) Error: Sizes of input arguments do not match (The operation is neither 'array op array' (where arrays have
the same size and the same type), nor 'array op scalar', nor 'scalar op array') in compare, file C:\OpenCV\opencv\sourc
es\modules\core\src\arithm.cpp, line 1228
这是我的代码:
Mat img2 = cv::imread("...");
Mat result;
Capture >>img1;
cv::compare(img1, img2, result, cv::CMP_EQ);
enter code here
【问题讨论】:
标签: c++ opencv computer-vision opencv3.1