发布网友 发布时间:2022-04-12 12:33
共2个回答
懂视网 时间:2022-04-12 16:54
PC:win7(X64) Qt:qt-opensource-windows-x86-msvc2013_64-5.4.0 opencv:opencv-2.4.10 1、将qt正确安装到D盘,将opencv解压到D盘; 2、配置opencv环境变量 选择“我的电脑”,右键选择“属性”, 在弹出的对话框中选择“高级系统设置”, 然后在弹出的对话框
PC:win7(X64)
Qt:qt-opensource-windows-x86-msvc2013_64-5.4.0
opencv:opencv-2.4.10
1、将qt正确安装到D盘,将opencv解压到D盘;
2、配置opencv环境变量
选择“我的电脑”,右键选择“属性”,
在弹出的对话框中选择“高级系统设置”,
然后在弹出的对话框中选择“高级”->环境变量
在变量值中添加opencv的路径
1)D:opencvuildinclude
2)D:opencvuildincludeopencv
3)D:opencvuildincludeopencv2
每个路径之间用分号隔开;
3、新建一个Qt项目,例opencvTest
在opencvTest.pro里面添加包含路径和库
INCLUDEPATH+=D:opencvuildinclude
D:opencvuildincludeopencv
D:opencvuildincludeopencv2
LIBS+=D:opencvuildx64vc12libopencv_ml2410d.lib
LIBS+=D:opencvuildx64vc12libopencv_calib3d2410d.lib
LIBS+=D:opencvuildx64vc12libopencv_contrib2410d.lib
LIBS+=D:opencvuildx64vc12libopencv_core2410d.lib
LIBS+=D:opencvuildx64vc12libopencv_features2d2410d.lib
LIBS+=D:opencvuildx64vc12libopencv_flann2410d.lib
LIBS+=D:opencvuildx64vc12libopencv_gpu2410d.lib
LIBS+=D:opencvuildx64vc12libopencv_highgui2410d.lib
LIBS+=D:opencvuildx64vc12libopencv_imgproc2410d.lib
LIBS+=D:opencvuildx64vc12libopencv_legacy2410d.lib
LIBS+=D:opencvuildx64vc12libopencv_objdetect2410d.lib
LIBS+=D:opencvuildx64vc12libopencv_ts2410d.lib
LIBS+=D:opencvuildx64vc12libopencv_video2410d.lib
LIBS+=D:opencvuildx64vc12libopencv_nonfree2410d.lib
LIBS+=D:opencvuildx64vc12libopencv_ocl2410d.lib
LIBS+=D:opencvuildx64vc12libopencv_photo2410d.lib
LIBS+=D:opencvuildx64vc12libopencv_stitching2410d.lib
LIBS+=D:opencvuildx64vc12libopencv_superres2410d.lib
LIBS+=D:opencvuildx64vc12libopencv_videostab2410d.lib
添加之后,选中新建项目opencvTest右键,选中“执行qmake”;
然后在main.cpp里面输入测试代码
#include
#include
#include
#include
usingnamespacestd;
usingnamespacecv;
intmain(intargc,char*argv[])
{
//QCoreApplicationa(argc,argv);
//returna.exec();
cout<<"opencv"<
Matsrc=imread("C:/Users/user/Desktop/tt.jpg");//绝对路径
imshow("test",src);
waitKey(0);
return0;
}可以正常显示图片。
配置成功!
热心网友 时间:2022-04-12 14:02
1.生成Makefiles