加载图片代码为:#includeiostream#include opencv2/core/core.hpp#include opencv2/highgui/highgui.hppusing namespace cv;int main(){Mat img = imread(pic.jpg);namedWindow(游戏原画);imshow(游戏原...

加载图片代码为:
#include<iostream> #include <opencv2/core/core.hpp> #include <opencv2/highgui/highgui.hpp> using namespace cv; int main() { Mat img = imread("pic.jpg"); namedWindow("游戏原画"); imshow("游戏原画", img); waitKey(6000); return 0; }
本人项目目录如下:
问题:
运行时出现
解决方案:
1.将项目中图片取出,放于D盘根目录
2.将代码
Mat img = imread("pic.jpg");
改为
Mat img = imread("D:\\pic.jpg");
再次运行,则显示图片成功!
织梦狗教程
本文标题为:OpenCV使用:加载图片时报错 0x00007FFC1084A839 处(位于 test1.exe 中)有未经处理的异常: Microsoft C++ 异常: cv::Exception,位于内存位


基础教程推荐
猜你喜欢
- [c语言-函数]不定量参数 2023-09-08
- C++实现ETW进行进程变动监控详解 2023-05-15
- 带你深度走入C语言取整以及4种函数 2022-09-17
- C语言编程C++旋转字符操作串示例详解 2022-11-20
- centos 7 vscode cmake 编译c++工程 2023-09-17
- C++实战之二进制数据处理与封装 2023-05-29
- 全面了解C语言 static 关键字 2023-03-26
- [C语言]二叉搜索树 2023-09-07
- C语言实现宾馆管理系统课程设计 2023-03-13
- C语言 详解字符串基础 2023-03-27