OpenCv 安装问题

来源:百度知道 编辑:UC知道 时间:2024/05/14 12:52:51
在Visual studio 2008下安装Opencv 1.0,看到有文章说要启动opencv.dsw工程,batchbulild.点击后一点反应都没有,没有任何提示。然后启动“opencv_directshow.dsw” ,使其编译通过;这次编译时出现了一堆错误提示:第一个便是 ”fatal error C1083: Cannot open include file: 'streams.h': No such file or directory”。请各位高手指点。

1、默认安装,
如果是Win2000或者是WinXp,请在用户path中添加C:Program FilesOpenCVbin;
2(可选)、如果需要修改原代码可以将OpenCV中相应的工程添加到项目工作区中,如Project ->Insert Project into Workspace...,选择C:Program Filesopencvcvmakecv.dsp,加入工程。选择菜单Project ->Insert Project into Workspace...,选择C:Program Filesopencvotherlibshighguihighgui.dsp等

3、选择菜单Project -> Setting -> C++,在下拉列表中选择Preprocessor,在Additional included directories框中加入:
C:Program Filesopencvcvinclude,C:Program Filesopencvotherlibshighgui,C:Program Filesopencvcxcoreinclude
4.选择菜单Project -> Setting -> Link,在下拉列表中选择Input,在Additional library path框中加入:
C:Program Filesopencvlib
5.选择菜单Project -> Setting -> Link,在下拉列表中选择General,加入三个库文件:cxcored.lib cvd.lib highguid.lib

6、然后可以编程了:
#include "cv.h" /*OpenCV的基本函数头文件*/
#include "highgui.h" /* OpenCV的图像显示函数头文件*/
void COpenCVTestDlg::OnButton1()
{
CFileDialog dlg(TRUE,NULL,NULL,0,"所有文件 (*.*)|*.*||",this);//