如何使用 C++、Visual Studio 2017 安装/配置 OpenCV3.2.0?

How can I install/configure OpenCV3.2.0 with C++, Visual Studio 2017?(如何使用 C++、Visual Studio 2017 安装/配置 OpenCV3.2.0?)
本文介绍了如何使用 C++、Visual Studio 2017 安装/配置 OpenCV3.2.0?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我想在 Visual Studio 2017 中使用 OpenCV 来做 C++ 程序.

为此,我遵循了

  • 获取最新的

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

    6.1 现在你应该看到 cmake 完成它的工作:)

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

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

    3. 现在,当解决方案准备好时,请确保您处于调试"配置中并右键单击ALL_BUILD"然后构建"(可能需要一段时间)一旦构建成功更改为发布" 配置并右键单击ALL_BUILD",然后再次构建".

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

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

    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?

    解决方案

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

    1. get VS-2017 with full compiler like:

    2. get the newest CMake (uninstall older versions)

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

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

    1. click configure, select visual studio 15 2017 and leave selected "use default native compilers", then press "finish"...

    6.1 now you should see cmake doing its job :)

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

    2. 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.

    3. 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.

    4. 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?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

    本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!
  • 相关文档推荐

    Bring window to front -gt; raise(),show(),activateWindow() don’t work(把窗户放在前面 -raise(),show(),activateWindow() 不起作用)
    How to get a list video capture devices NAMES (web cameras) using Qt (crossplatform)? (C++)(如何使用 Qt(跨平台)获取列表视频捕获设备名称(网络摄像机)?(C++))
    How to compile Qt as static(如何将 Qt 编译为静态)
    C++ over Qt : Controlling transparency of Labels and Buttons(C++ over Qt:控制标签和按钮的透明度)
    How to know when a new USB storage device is connected in Qt?(Qt如何知道新的USB存储设备何时连接?)
    What is an event loop in Qt?(Qt 中的事件循环是什么?)