ubuntu18.04源码安装opencv3.4

1:下载源码opencv3.4,解压源码后,在解压后的目录中创建build文件夹,cd build
2:安装依赖包

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

如果出现E: 无法定位软件包 libjasper-dev

添加

sudo add-apt-repository "deb http://security.ubuntu.com/ubuntu xenial-security main"

再次运行命令:

sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev

3:编译安装

cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local ..
sudo make
sudo make install

4:环境配置与测试
参考这个博客环境配置与测试

你可能感兴趣的:(计算机视觉)