Visual Studio 安装OpenCV及问题总结 |
您所在的位置:网站首页 › opencv安装失败 › Visual Studio 安装OpenCV及问题总结 |
1、VS安装OpenCV基本步骤
1)安装Visual Studio
下载网址https://opencv.org/releases.html# 2)安装OpenCV下载网址https://www.visualstudio.com/zh-hans/,直接下载社区版免费 3)环境变量配置(配置后重启电脑) D:\OpenCV\opencv\build\x64\vc15\bin添加到环境变量中 4)创建C++空工程 5)编译环境选择X86(32位)或者X64(64位) Debug或者Release 6)添加以下文件夹到“Include Directories”中D:\OpenCV\opencv\build\include D:\OpenCV\opencv\build\include\opencv D:\OpenCV\opencv\build\include\opencv2 7)添加以下文件到“Library Directories”中D:\OpenCV\opencv\build\x64\vc15\lib 8)添加以下语句到Linker->Input->Additional Dependencies若上面选择Release,则添加"opencv_world320.lib"(注:320根据版本号修改) 若上面选择Debug,则添加“opencv_world320.lib” 9)添加程序代码运行 1 #include 2 #include 3 4 using namespace cv; 5 int main(int arg, char *argv[]) { //图片路径不要出现中文 6 Mat img = imread(argv[1], CV_LOAD_IMAGE_ANYCOLOR); 7 if (!img.data) { 8 return -1; 9 } 10 imshow("原图", img); 11 waitKey(0); 12 return 1; 13 } 2、若出现如下截屏的问题![]() IDE 编译器 VS2017 VC15 VS2015 VC14 VS2013 VC12 VS2012 VC11 VS2010 VC10 VS2008 VC9 VS2005 VC8 |
今日新闻 |
推荐新闻 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |