opencv2.4.13怎么配置环境变量

 我来答
电商运营的机会
2017-06-08 · 知道合伙人互联网行家
电商运营的机会
知道合伙人互联网行家
采纳数:436 获赞数:998
潭州教育网络科技有限公司最佳电商运营总监。

向TA提问 私信TA
展开全部

step1:安装,选择你所想安装到的位置

step2:配置环境变量

1、给系统变量配置path:添加:D:\opencv2_4_13\opencv\build\x86\vc12\bin

2、给用户变量添加opencv变量,值D:\opencv2_4_13\opencv\build

添加PATH变量(有就不需要添加,但是值需要添加)值D:\opencv2_4_13\opencv\build\x86\vc12\bin

说明:不管你系统是32位还是64位,路径目录均选择X86,因为编译都是使用32位编译;如果选用X64,则程序运行时候会出错。

属性管理器:

注意:debug和release都要配置

1、debug:

1)VC++目录->包含目录

添加

D:\opencv2_4_13\opencv\build\include

D:\opencv2_4_13\opencv\build\include\opencv

D:\opencv2_4_13\opencv\build\include\opencv2


2)VC++目录->库目录

添加:

D:\opencv2_4_13\opencv\build\x86\vc12\lib


3)链接器->输入->附加依赖项

添加:

opencv_ml2413d.lib
opencv_calib3d2413d.lib
opencv_contrib2413d.lib

opencv_core2413d.lib
opencv_features2d2413d.lib
opencv_flann2413d.lib
opencv_gpu2413d.lib
opencv_highgui2413d.lib
opencv_imgproc2413d.lib
opencv_legacy2413d.lib
opencv_objdetect2413d.lib
opencv_ts2413d.lib
opencv_video2413d.lib
opencv_nonfree2413d.lib
opencv_ocl2413d.lib
opencv_photo2413d.lib
opencv_stitching2413d.lib
opencv_superres2413d.lib
opencv_videostab2413d.lib



2、Release

1)、2)与debug版本一样

3)添加:

opencv_objdetect2413.lib
opencv_ts2413.lib
opencv_video2413.lib
opencv_nonfree2413.lib
opencv_ocl2413.lib
opencv_photo2413.lib
opencv_stitching2413.lib
opencv_superres2413.lib
opencv_videostab2413.lib
opencv_calib3d2413.lib
opencv_contrib2413.lib
opencv_core2413.lib
opencv_features2d2413.lib
opencv_flann2413.lib
opencv_gpu2413.lib
opencv_highgui2413.lib
opencv_imgproc2413.lib
opencv_legacy2413.lib
opencv_ml2413.lib

测试

添加新建项test.cpp

输入代码:

#include <cv.h>
#include <highgui.h>
using namespace std;
int main()
{
IplImage * test;
test = cvLoadImage("D:\\Sample_8.bmp");//图片路径
cvNamedWindow("test_demo", 1);
cvShowImage("test_demo", test);
cvWaitKey(0);
cvDestroyWindow("test_demo");
cvReleaseImage(&test);
return 0;
}

推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式