最近需要用Qt写一个界面,然后就需要配置Qt和OpenCV。我的电脑现状是之前有安装过OpenCV,所以只需要安装Qt和配置OpenCV环境;linux系统,Ubuntu 4.4.0-21,37 x86-64.
1.安装Qt,首先下载Qt,我的安装版本在这里:(软件太大了,上传不了。若要用,官网无法下载可以给我留言),直接在终端运行,在安装的过程中需要注册Qt账号,这个可以通过网页去注册;
2.新建一个工程,在“.pro”文件中配置OpenCV的库文件,配置清单如下:
INCLUDEPATH += /usr/local/include\ /usr/local/include/opencv\ /usr/local/include/opencv2 LIBS += /usr/local/lib/libopencv_calib3d.so\ /usr/local/lib/libopencv_core.so\ /usr/local/lib/libopencv_features2d.so\ /usr/local/lib/libopencv_flann.so\ /usr/local/lib/libopencv_highgui.so\ /usr/local/lib/libopencv_imgcodecs.so\ /usr/local/lib/libopencv_imgproc.so\ /usr/local/lib/libopencv_ml.so\ /usr/local/lib/libopencv_objdetect.so\ /usr/local/lib/libopencv_photo.so\ /usr/local/lib/libopencv_shape.so\ /usr/local/lib/libopencv_stitching.so\ /usr/local/lib/libopencv_superres.so\ /usr/local/lib/libopencv_videoio.so\ /usr/local/lib/libopencv_video.so\ /usr/local/lib/libopencv_videostab.so3.通过简单的读取图片和显示图片可以对配置的环境进行检测; 原文链接:https://www.f2er.com/ubuntu/351986.html