visual studio的opencv安装与配置

安装配置环境:Windows xp\7 + VS2010 + opencv2.4.8(extract到自己指定的目录,目录最好不要包含中文名,否则编译的时候会有问题)

工具:cmake

1. 编译opencv得到库文件,opencv2.4.8只提供基本的库,如果需要用额外的就只能自己编译了,这里就需要用到cmake了,opencv extract后的包中已经包含了编译需要的makelist文件,运行cmake


目标库路径自己指定,这里我已经cmake过了,就不贴图出来了,只要configure和generate后都成功了(Configuring done和Generating done),就ok了

这时目标库路径下会生成一个vs工程OpenCV.sln如下图,用vs2010打开,然后在debug和release模式下都运行一次,bin目录下是opencv_*d.dll(for debug)和opencv_*.dll(for release),lib目录下是opencv_*d.lib(for debug)和opencv_*.lib(for release),要将这两个目录copy到opencv目录下。*.h文件都在include文件夹下。

 

2. 配置环境变量,这里都是设置系统环境变量

OPENCV=D:\opencv2.4.8\opencv\build

Path=D:\opencv2.4.8\opencv\bin\Debug;D:\opencv2.4.8\opencv\bin\Release

3. 配置VS2010

visual studio的opencv安装与配置_第1张图片

包含目录:

库目录


附加依赖项:

debug:

opencv_calib3d248d.lib
opencv_contrib248d.lib
opencv_core248d.lib
opencv_features2d248d.lib
opencv_flann248d.lib
opencv_gpu248d.lib
opencv_haartraining_engined.lib
opencv_highgui248d.lib
opencv_imgproc248d.lib
opencv_legacy248d.lib
opencv_ml248d.lib
opencv_nonfree248d.lib
opencv_objdetect248d.lib
opencv_ocl248d.lib
opencv_photo248d.lib
opencv_stitching248d.lib
opencv_superres248d.lib
opencv_ts248d.lib
opencv_video248d.lib
opencv_videostab248d.lib


release:

opencv_calib3d248.lib
opencv_contrib248.lib
opencv_core248.lib
opencv_features2d248.lib
opencv_flann248.lib
opencv_gpu248.lib
opencv_haartraining_engine.lib
opencv_highgui248.lib
opencv_imgproc248.lib
opencv_legacy248.lib
opencv_ml248.lib
opencv_nonfree248.lib
opencv_objdetect248.lib
opencv_ocl248.lib
opencv_photo248.lib
opencv_stitching248.lib
opencv_superres248.lib
opencv_ts248.lib
opencv_video248.lib
opencv_videostab248.lib

你可能感兴趣的:(windows,XP,opencv,Studio,Visual)