我的系统是Ubuntu 18.04.2,通过手动编译安装opencv3.4.2。
1.首先安装OpenCV的依赖文件,在终端运行下面命令:
[compiler] sudo apt-get install build-essential
[required] sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
[optional] sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev
2.下载opencv3:
下载安装包,opencv-3.4.2.zip
解压,unzip opencv-3.4.2.zip
3.进入解压目录:
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local …
4.编译
sudo make后报错:
$:sudo make
[sudo] password for :
[ 0%] Built target gen-pkgconfig
[ 3%] Built target libjpeg-turbo
[ 6%] Built target libtiff
[ 14%] Built target libwebp
[ 17%] Built target libjasper
[ 22%] Built target IlmImf
[ 24%] Built target ip