win7安装OpenCV

时间:2024-03-24 19:47:08

1、下载OpenCV

https://opencv.org/releases/

win7安装OpenCV

2、解压(即安装)

双击软件后点击运行

win7安装OpenCV

3、将解压后的文件夹opencv拷贝到任意目录下,如:D:\Program Files\opencv

4、配置环境变量

win7安装OpenCVwin7安装OpenCVwin7安装OpenCV

把D:\Program Files\opencv\build\x64\vc15\bin添加到Path后面,依次点击确定后即完成此步

win7安装OpenCV

5、vs配置

5.1创建一个普通的win32控制台(勾选空项目)

5.2视图→其他窗口→属性管理器

win7安装OpenCV

5.3在属性管理器→添加新项目属性表,在添加新项框中点击添加

win7安装OpenCV

win7安装OpenCV

5.4双击刚刚新建的PropertySheet,在弹出的对话框中依次进行配置

win7安装OpenCV

5.5依次进行配置

把下面三个添加到VC++目录→包含目录中

D:\Program Files\opencv\build\include\opencv2

D:\Program Files\opencv\build\include\opencv

D:\Program Files\opencv\build\include

win7安装OpenCV

win7安装OpenCV

把下面添加到VC++目录→库目录中

D:\Program Files\opencv\build\x64\vc15\lib

win7安装OpenCV

win7安装OpenCV

把opencv_world349d.lib添加到链接器→输入→附加依赖项中

win7安装OpenCV

win7安装OpenCV

把Debug下的x86切换成x64,即可在.cpp文件中调试运行

win7安装OpenCV