码迷,mamicode.com
首页 > 其他好文 > 详细

安装OpenCV3.1 与VS2015配置主要步骤

时间:2017-09-27 13:25:50      阅读:335      评论:0      收藏:0      [点我收藏+]

标签:log   visual   alt   tle   eps   style   bsp   erro   paste   

Main Steps to set up OpenCV in Visual Studio 2015 (OS: Windows 10, X64)

Ref: https://www.youtube.com/watch?v=l4372qtZ4dc

(1) Install Visual Studio 2015

(2) Install OpenCV 3.1

(3) Set the environment variable of OpenCV

技术分享技术分享
技术分享
Click Edit, then copy the path of OpenCV bin: for example

E:\OpenCV\opencv\build\x64\vc14\bin

Click "New", and paste the path. Click and finish.
技术分享

技术分享技术分享

Build a new Win32 console application, add a new source file (.cpp). Copy the content in a existed sample cpp in the opencv folder into the .cpp. For example, find a file in ‘E:\OpenCV\opencv\sources\samples\cpp\tutorial_code\ImgProc‘.
Since the libraries have not been included in the project yet, there are errors when using "including" the opencv related files.
技术分享

Go to project properties, paste the ‘include‘ path of OpenCV into "Addiditional Include Directories" in ‘C/C++‘ property. Apply it.
Then we need to link the libraries.
技术分享

Copy the library path of OpenCV into "Addidional Library Directories" in Linker property. Apply it.
技术分享

Then add the specific library (.lib) into "Additional Dependencies" in the ‘Input‘ of Linker property, by clicking downward arrow and edit. This .lib file can be found in the above directory.

  • ‘opencv_world310d.lib‘ is for debug mode;
  • ‘opencv_world310.lib‘ is for release mode.

Here we use debug mode, so write opencv_world310d.lib into "Additional Dependencies".

技术分享

Finished!


<wiz_tmp_tag id="wiz-table-range-border" contenteditable="false" style="display: none;">





安装OpenCV3.1 与VS2015配置主要步骤

标签:log   visual   alt   tle   eps   style   bsp   erro   paste   

原文地址:http://www.cnblogs.com/goodknight/p/7600995.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!