这篇文章主要介绍了VS2019+Opencv4.0+Win10配置详解,文中通过示例代码介绍的非常详细,对大家的学习
来源gao!%daima.com搞$代*!码网
或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
一.下载OpenCV4.0的安装文件:
OpenCV官网
然后安装到你想要的地方
二.添加到Path里面:
并且把文件opencv_world400.dll和opencv_world400d.dll文件复制到
C:\Windows\SysWOW64这个文件夹;
三.配置Vs2019环境(OpenCV4.0只能用x64配置)
1.在把opencv的include添加到Include Directories和vc15\lib添加到Library Directories
2.在把opencv_world400d.lib添加到Additional Dependencies
运行代码
#include #include #include #include using namespace cv; using namespace std; int main() { Mat image; image = imread("C:/Users/Kiripeng/Desktop/out-2950.jpg-600"); //记得改成自己的路径 if (image.empty()) { cout << "Could not open or find the image" << std::endl; return -1; } namedWindow("Display window", WINDOW_AUTOSIZE); imshow("Display window", image); waitKey(0); std::cout << "Hello World!\n"; }
以上就是VS2019+Opencv4.0+Win10配置详解的详细内容,更多请关注gaodaima搞代码网其它相关文章!