略。
从http://www.opencv.org.cn 下载OpenCV安装程序。假如要将OpenCV安装到C:/Program Files/OpenCV。(下面附图为OpenCV 1.0rc1的安装界面,OpenCV 1.0安装界面与此基本一致。)在安装时选择"将/OpenCV/bin加入系统变量"(Add/OpenCV/bin to the systerm PATH)。
检查C:/Program Files/OpenCV/bin是否已经被加入到环境变量PATH,如果没有,请加入。加入后需要注销当前Windows用户(或重启)后重新登陆才生效。
菜单Tools->Options->Directories:先设置lib路径,选择Library files,在下方填入路径:
C:/Program 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
每创建一个将要使用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
如果你不需要这么多lib,你可以只添加你需要的lib。