如何使用C ++,Visual Studio 2017安装/配置OpenCV3.2.0? [英] How can I install/configure OpenCV3.2.0 with C++, Visual Studio 2017?

查看:286
本文介绍了如何使用C ++,Visual Studio 2017安装/配置OpenCV3.2.0?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Visual Studio 2017中使用OpenCV来执行c ++程序.

I want to use OpenCV in Visual Studio 2017 to do c++ program.

为此,我遵循了在Visual Studio中设置OpenCV 视频.他说,应该将vc14设置为VS2015的环境变量. VS2017没有vc16.那么我该如何在VS2017中做到这一点呢?如果我要使用VS2017,还有其他视频指令需要更改吗?

To do it, I followed Setting Up OpenCV in Visual Studio video. In that, he said vc14 should be set as environmental variables for VS2015. There is no vc16 for VS2017. So how do I do it for VS2017? And are there any other video instruction changes to be made if I am to use VS2017?

推荐答案

由于OpenCV官方教程中的文档已过时,因此我建议:

Since the Doc from official OpenCV tutorial is outdated, I will suggest:

  1. 使用完整的编译器,例如:

  1. get VS-2017 with full compiler like:

获取最新的 CMake (卸载旧版本)

get the newest CMake (uninstall older versions)

从github获取sourceCode 此处

get from github the sourceCode here and here and place those in C:/openCV folder, create a BUILD folder there too

打开Cmake,选择opencv主文件夹...在构建中,将构建目录写入:

open Cmake, select the opencv master folder... in the build write the build directory like:

  1. 单击配置",选择Visual Studio 15 2017并保留选中的使用默认本机编译器",然后按完成" ...

6.1现在您应该看到cmake正在执行其工作:)

6.1 now you should see cmake doing its job :)

  1. 完成配置后,设置opencv额外模块路径,然后再次单击配置",完成后单击生成"! :)

  1. once configuration is done set the opencv extra modules path and click configure again, and when is done click generate! :)

生成完成后,单击打开项目",这将在Visual Studio中打开一个名为"opencv"的巨大项目,现在您可以关闭cmake,我们不再需要它.

when generation is done click "open project", this will open a huge project in visual studio named "opencv", now you can close cmake, we dont need that anymore.

现在,当解决方案准备就绪时,请确保您在调试" conf中,并右键单击"ALL_BUILD",然后右键单击"build"(可能要花一些时间),一旦构建成功更改为"release"配置,然后右键单击"ALL_BUILD",然后再次构建".

now, when the solution is ready, be sure you are in "debug" conf and do right click on "ALL_BUILD" and then "build" (that can take a while) once build succeed change to "release" config and do right click on "ALL_BUILD" and then "build" again.

现在,请确保您位于调试" conf中,然后右键单击安装",然后构建"(可能需要一段时间),一旦构建成功,更改为发布"配置并右键单击在安装"上,然后再次构建".

now,be sure you are in "debug" conf and do right click on "INSTALL" and then "build" (that can take a while) once build succeed change to "release" config and do right click on "INSTALL" and then "build" again.

这篇关于如何使用C ++,Visual Studio 2017安装/配置OpenCV3.2.0?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆