1.安装opencv3.2.0的依赖
$ sudo apt-get install build-essential
$ sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
$ sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev # 处理图像所需的包
$ sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev liblapacke-dev
$ sudo apt-get install libxvidcore-dev libx264-dev # 处理视频所需的包
$ sudo apt-get install libatlas-base-dev gfortran # 优化opencv功能
$ sudo apt-get install ffmpeg
2.下载opencv3.2.0的压缩包
wget -O opencv.zip https://github.com/Itseez/opencv/archive/3.2.0.zip
3.解压与安装
unzip opencv.zip
cd opencv-3.2.0
mkdir build
cmake -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=/usr/local .
make -j4
sudo make install
4.qt安装
sudo apt-get install build-essential
sudo apt-get install cmake qt5-default qtcreator
5.qt配置
打开qtcreator->tools->options->build&run
在其中的compliers点add加上gcc编译器
在compiler path里面加上gcc的路径,一般为/usr/bin/gcc
然后你可能会在kits的desktop里面看见一个叹号,这里就需要在他的compliers里面添加上一步添加好的gcc
到此qt配置完成
6.在qt的.pro文件中添加opencv的环境
至此所有配置完成
若想配置串口可以sudo apt-get install libqt5serialport5-dev libudev-dev
然后再.pro文件中添加QT += serialport 不报错就ok