这是我第一次在Visual Studio中使用opencv。我曾在ubuntu工作过。我试图安装opencv。
1.我提取它。在系统属性中编辑路径变量为D:\ opencv \ build \ x64 \ vc10 \ bin
2。我将VCC ++目录设置为$(OPENCV_BUILD)\ x64 \ vc10 \ lib; $(LibraryPath)。
3.C / C ++附加目录为$(OPENCV_BUILD)\ include \ opencv; $(OPENCV_BUILD)\ include \ opencv2
4。连接体 - >输入其他依赖项opencv_core243.lib opencv_imgproc243.lib opencv_highgui243.lib opencv_ml243.lib opencv_video243.lib opencv_features2d243.lib opencv_calib3d243.lib opencv_objdetect243.lib opencv_contrib243.lib opencv_legacy243.lib opencv_flann243.lib
我正在使用以下示例代码:// OpenCVTest.cpp:定义控制台应用程序的入口点。
include "stdafx.h"
include <opencv\highgui.h>
include <opencv\cv.h>
include <opencv\cxcore.h>
int _tmain(int argc, _TCHAR* argv[]) { IplImage *img = cvLoadImage("C:\Users\firstMap"); cvNamedWindow("OpenCV",1); cvShowImage("OpenCV",img);
cvWaitKey(0);
cvDestroyWindow("OpenCV ");
cvReleaseImage(&img);
return 0;
}
我收到以下错误::致命错误C1083:无法打开包含文件:'opencv \ highgui.h':没有这样的文件或目录
答案 0 :(得分:0)
当你包括“$(OPENCV_BUILD)\ include \ opencv; $(OPENCV_BUILD)\ include \ opencv2”作为库路径使用时
include <highgui.h>
include <cv.h>
include <cxcore.h>
作为代码中的头文件。
或
您可以包含“$(OPENCV_BUILD)\ include”作为运行现有代码的库路径。