win10下 VS2013配置DirectShow+Opencv

1.OPENCV 配置

首先下载opencv2.4.9和配置opencv2.4.9。

   (1) 安装opencv2.4.9,解压即可

   (2)配置环境变量

       1)系统变量 Path:添加D:\Program Files\opencv\build\x86\vc12\bin

       2)用户变量:添加opencv变量,值D:\Program Files\opencv\build,添加PATH变量(有就不需要添加,但是值需要添加)值D:\Program Files\opencv\build\x86\vc12\bin

说明:不管系统是32位还是64位,路径目录均选择X86,因为编译都是使用32位编译;如果选用X64,则程序运行时候会出错。


 (3) 新建 visual C++项目,找到属性管理器。双击Debug|Win32

    1) 包含目录:(VC++目录)

        D:\Program Files\opencv\build\include

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

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

    2) 库目录:(VC++目录)D:\Program Files\opencv\build\x86\vc12\lib

    3) 连接器->输入->附加依赖项:

      opencv_ml249d.lib

      opencv_calib3d249d.lib

      opencv_contrib249d.lib

      opencv_core249d.lib

      opencv_features2d249d.lib

opencv_flann249d.lib

opencv_gpu249d.lib

opencv_highgui249d.lib

opencv_imgproc249d.lib

opencv_legacy249d.lib

opencv_objdetect249d.lib

opencv_ts249d.lib

opencv_video249d.lib

opencv_nonfree249d.lib

opencv_ocl249d.lib

opencv_photo249d.lib

opencv_stitching249d.lib

opencv_superres249d.lib

opencv_videostab249d.lib

其实以上都是D:\Program Files\opencv\build\x86\vc12\lib下所有的lib文件,你会发现,有的后面带上d,有的没有d,这是因为Debug的就有d,Release则没有d


(4) 工程目录的配置(Release)

  1. 其他与Debug一样,只是连接器->输入->附加依赖项不一样,设置如下:

    opencv_objdetect249.lib

    opencv_ts249.lib

    opencv_video249.lib

    opencv_nonfree249.lib

    opencv_ocl249.lib

    opencv_photo249.lib

    opencv_stitching249.lib

    opencv_superres249.lib

    opencv_videostab249.lib

    opencv_calib3d249.lib

    opencv_contrib249.lib

    opencv_core249.lib

    opencv_features2d249.lib

    opencv_flann249.lib

    opencv_gpu249.lib

    opencv_highgui249.lib

    opencv_imgproc249.lib

    opencv_legacy249.lib       opencv_ml249.lib


2 配置DirectShow

(1)下载DirectShow,下载后解压。比如解压路径为:D:\DirectShow;

(2) 配置VS2012项目的属性:

             A.在"VC++目录"的"可执行文件目录"中添加D:\DirectShow\bin

             B.在"VC++目录"的"包含目录"中添加D:\DirectShow\include

             C.在"VC++目录"的"库目录"中添加D:\DirectShow\lib

             D.把D:\DirectShow\include中的"CameraDS.h"、"CameraDS.cpp"复制到项目当前目录下,并加载到项目的"头文件"、"源文件"中,如下图:

win10下 VS2013配置DirectShow+Opencv_第1张图片

(3) .修改winNT.h

       以管理员身份(开始->所有程序->附件->命令提示符(右键,以管理员身份打开,然后打开目标文档))打开C:\Program Files\Microsoft SDKs\Windows\v7.0A\Include目录

       在winNT.h文件第290行左右的如下两行

       typedef void *PVOID;

       typedef void *POINTER_64 PVOID64;

      之前添加:

      #define POINTER_64 __ptr64



你可能感兴趣的:(DirectX11,DirectxShow,OpenCV)