感谢支持
我们一直在努力

Windows环境下编译OpenCV3.0和OpenCV_contrib

一、下载安装

  • OpenCV3.0下载地址:http://sourceforge.net/projects/opencvlibrary/files/opencv-win/3.0.0/

  • OpenCVcontrib下载地址:https://github.com/Itseez/opencv contrib

  • cmake-gui下载地址:http://www.cmake.org/cmake/resources/software.html

下载以上内容并安装opencv和cmake-gui,我的OpenCV安装路径为D:\opencv3

二、使用cmake生成OpenCV.sln

  1. 打开cmake-gui

  2. 在where is the source code选择opencv的安装目录,我的是D:\opencv3\opencv\sources

  3. 在where to build the binaries里面选择要将opencv编译到的目录下面,我的是:D:\opencv3\opencv\mybuild

  4. 点击configure,在弹出的对话框内选择 Visual Studio 2013和default参数,点击finish。

  5. 这个时候cmake会开始编译不知道什么东西,然后会在屏幕中间出现一堆参数包括Name和Value,在其中找到Name为OPENCVEXTRAMODULESPATH的参数,然后把它的Value设置为opencvcontrib的路径,我的是D:/Files/Codes/Tracking/Exp/opencvcontrib-master/opencvcontrib-master/modules

  6. 然后点击Generate,等待。中间报了两次错,我去掉了BUILDopencvadas和WITH_CUDA等一系列看起来没用的东西,然后就完成了。

三、用VS编译生成debug和release库

  1. 打开D:\opencv3\opencv\mybuild目录下的OpenCV.sln

  2. 编译debug版本库:在“解决方案’OpenCV’(141个项目)”上面点击右键–>重新生成解决方案。

  3. 找到CMakeTargets中的INSTALL,然后右键选择“仅限于项目”–>“仅生成INSTALL”,然后就在D:\opencv3\opencv\mybuild\install中发现了许多东东。

四、重新配置自己的项目

  1. VC++目录–>包含目录,添加:
    D:\opencv3\opencv\mybuild\install\include

  2. VC++目录–>库目录,添加:
    D:\opencv3\opencv\mybuild\install\x86\vc12\lib
    D:\opencv3\opencv\mybuild\install\x86\vc12\staticlib

  3. 链接器–>输入–>附加依赖项,添加:

opencv_bgsegm300d.lib
opencv_bioinspired300d.lib
opencv_calib3d300d.lib
opencv_ccalib300d.lib
opencv_core300d.lib
opencv_datasets300d.lib
opencv_face300d.lib
opencv_features2d300d.lib
opencv_flann300d.lib
opencv_hal300d.lib
opencv_highgui300d.lib
opencv_imgcodecs300d.lib
opencv_imgproc300d.lib
opencv_latentsvm300d.lib
opencvlinedescriptor300d.lib
opencv_ml300d.lib
opencv_objdetect300d.lib
opencv_optflow300d.lib
opencv_photo300d.lib
opencv_reg300d.lib
opencv_rgbd300d.lib
opencv_saliency300d.lib
opencv_shape300d.lib
opencv_stereo300d.lib
opencv_stitching300d.lib
opencv_superres300d.lib
opencvsurfacematching300d.lib
opencv_text300d.lib
opencv_tracking300d.lib
opencv_ts300d.lib
opencv_video300d.lib
opencv_videoio300d.lib
opencv_videostab300d.lib
opencv_xfeatures2d300d.lib
opencv_ximgproc300d.lib
opencv_xobjdetect300d.lib
opencv_xphoto300d.lib
ippicvmt.lib

OpenCV官方教程中文版(For Python) PDF  http://www.linuxidc.com/Linux/2015-08/121400.htm

Ubuntu Linux下安装OpenCV2.4.1所需包 http://www.linuxidc.com/Linux/2012-08/68184.htm

Ubuntu 12.04 安装 OpenCV2.4.2 http://www.linuxidc.com/Linux/2012-09/70158.htm

CentOS下OpenCV无法读取视频文件 http://www.linuxidc.com/Linux/2011-07/39295.htm

Ubuntu 12.04下安装OpenCV 2.4.5总结 http://www.linuxidc.com/Linux/2013-06/86704.htm

Ubuntu 10.04中安装OpenCv2.1九步曲 http://www.linuxidc.com/Linux/2010-09/28678.htm

基于QT和OpenCV的人脸识别系统 http://www.linuxidc.com/Linux/2011-11/47806.htm

[翻译]Ubuntu 14.04, 13.10 下安装 OpenCV 2.4.9  http://www.linuxidc.com/Linux/2014-12/110045.htm

OpenCV的详细介绍:请点这里
OpenCV的下载地址:请点这里

本文永久更新链接地址:http://www.linuxidc.com/Linux/2016-09/135033.htm

赞(0) 打赏
转载请注明出处:服务器评测 » Windows环境下编译OpenCV3.0和OpenCV_contrib
分享到: 更多 (0)

听说打赏我的人,都进福布斯排行榜啦!

支付宝扫一扫打赏

微信扫一扫打赏