我一直在使用 OpenCV 3.0 进行图像拼接项目。我像这样使用 findHomography 函数:
findHomography(imageOnePoints, imageTwoPoints, CV_RANSAC);
但是当我尝试编译我的代码时,我收到以下错误消息:
stitch.cpp:111:75: error: ‘CV_RANSAC’ was not declared in this scope
Mat homographyMatrix = findHomography(imageOnePoints, imageTwoPoints, CV_RANSAC);
stitch.cpp:111:84: error: ‘findHomography’ was not declared in this scope
Mat homographyMatrix = findHomography(imageOnePoints, imageTwoPoints, CV_RANSAC);
我已经声明我正在使用“命名空间 cv”,所以我不需要前面的“cv::”。我不确定是什么问题。对这些错误的任何建议将不胜感激。谢谢!
最佳答案
结果是 findHomography
的头文件丢失了:
#include "opencv2/calib3d/calib3d.hpp"
关于c++ - findHomography 在 OpenCV 3.0 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31929009/