http://www.china-vision.net/bbs7/2009-3/2/17062403140.html
1 下载opencv安装程序
http://downloads.sourceforge.net/opencvlibrary/OpenCV_1.1pre1a.exe?modtime=1224287695&big_mirror=1
2 安装opencv
3 在开始菜单-》程序-》opencv里打开opencv.vs2005.sln
4 编译项目:编译结束报错:
error C2039:'foreground_regions' : is not a member of 'CvFGDStatModel'
5 打开“C:\Program Files\OpenCV\cvaux\include\cvaux.h”搜索“foreground_regions”找到这两行:
CvMemStorage* storage; /*storage for 揻oreground_regions?/
CvSeq* foreground_regions /*foreground object contours*/
把注释闭合
6 编译通过
7 安装 Microsoft Platform SDK
http://www.microsoft.com/downloads/thankyou.aspx?familyId=200b2fd9-ae1a-4a14-984d-389c36f85647&displayLang=en
8 检查D:\Program Files\OpenCV\bin是否已经被加入到环境变量PATH,添加变量后重启电脑(貌似只要注销就行了)
9 设置vs全局变量:
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/*貌似新版本里没这个文件夹了,忽略不计*/
C:\Program Files\Microsoft Platform SDK\Include
10 设置项目所需要的lib
注:路径C:\Program Files\Microsoft Platform SDK\Include是Microsoft Platform SDK的include文件路径。
11 编译自己写的程序,提示找不到<ddeml.h>
12 在"C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include"里创建文件ddeml.h
把网页http://doc.ddart.net/msdn/header/include/ddeml.h.html里的内容拷贝到ddeml.h里
13 编译通过~~
参考:http://www.opencv.org.cn/index.php/VC_2005_Express%E4%B8%8B%E5%AE%89%E8%A3%85%E4%B8%8E%E9%85%8D%E7%BD%AE
http://sourceforge.net/project/showfiles.php?group_id=22870&package_id=16937