一,OpenCV在VS2005下的安装与配置
1.下载OpenCV安装程序
假如要将OpenCV安装到C:/Program Files/OpenCV。(下面附图为OpenCV 1.0rc1的安装界面,OpenCV 1.0安装界面与此基本一致。)在安装时选择"将/OpenCV/bin加入系统变量"(Add/OpenCV/bin to the systerm PATH)
注意:虽然此处已经将/OpenCV/bin加入系统变量"(Add/OpenCV/bin to the systerm PATH),但是大多数情况下当OpenCV安装完成后,这一步并没有完成。所以还必须检查C:/Program Files/OpenCV/bin是否已经被加入到环境变量PATH,如果没有,请加入。加入后可能需要注销当前Windows用户(或重启)后重新登陆才生效。
2.配置VS2005
菜单Tools->Options->Directories:先设置lib路径,选择Library files,在下方填入路径:
/OpenCV/lib
然后选择include files,在下方填入路径:
C:/Program Files/OpenCV/cxcore/include
C:/Program Files/OpenCV/cv/include
C:/Program Files/OpenCV/cvaux/include
C:/Program Files/OpenCV/ml/include
C:/Program Files/OpenCV/otherlibs/highgui
C:/Program Files/OpenCV/otherlibs/cvcam/include
3.项目设置
每创建一个将要使用OpenCV的VC Project,都需要给它指定需要的lib。菜单:Project->Settings,然后将Setting for选为All Configurations,然后选择右边的link标签,在Object/library modules附加上
cxcore.lib cv.lib ml.lib cvaux.lib highgui.lib cvcam.lib