环境:
vs2015
windows 10
opencv 4.1.1
解决方案:
首先放一下测试代码:
#include <iostream>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
using namespace cv;
int main() {
// 读入一张图片(游戏原画)
Mat img = imread("E:\dog.jpg");
// 创建一个名为 "test"窗口
namedWindow("test");
// 在窗口中显示名称为test
imshow("test", img);
// 等待6000 ms后窗口自动关闭
waitKey(6000);
}
解决
我们在都去图片路径时,应该奖图片中的路径的 \ ,修改为 \\ 或者 / ,**然后我们重启vs(关键)**
此时我们在再去执行代码时,就好了


原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有