我正在从一本书中学习,并复制了以下代码(基本上是“hello world”的openCV等价物):
//helloCV.cpp
#include <opencv2/opencv.hpp>
int main(int argc, char** argv){
cv::Mat img = cv::imread(argv[1], -1);
if (img.empty()) return -1;
cv::namedWindow("Example1", cv::WINDOW_AUTOSIZE);
cv::imshow("Example1", img);
cv::waitKey(0);
cv::destroyWindow("Example1");
return 0;
}//main
不幸的是,当我运行此代码时,我得到一个窗口,其中没有标题:
我怀疑我在安装OpenCV时弄乱了环境或其他类似的东西,但是cmake没有抛出任何错误,代码按预期运行,在击键时正确退出,所有这一切,除了缺少显示的照片之外。在
有什么提示吗?在
谢谢!在
感谢@DanMašek为这篇文章提供线索,并感谢本页上的所有人:http://answers.opencv.org/question/160201/video-window-not-loading-frame/
重复他们说的话,对我有用的是:
^{pr2}$希望这能帮助其他人解决这个问题!在
相关问题 更多 >
编程相关推荐