Ubuntu18.04中用CMake-gui安装OpenCV3.2.0和OpenCV_contrib-3.2.0

下载和添加依赖包

1、首先更新 apt-get,在安装前最好先更新一下系统,不然有可能会安装失败。在终端输入:

    sudo apt-get update
    sudo apt-get upgrade

2、接着安装官方给的opencv依赖包,在终端输入:

    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\然后下载OpenCV3.2.0和OpenCV_contrib-3.2.0,下载需要等待一段时间

https://github.com/Itseez/opencv/archive/3.2.0.zip

https://github.com/opencv/opencv_contrib/archive/3.2.0.zip

3、接下来安装CMake-gui,在终端输入

sudo apt-get install cmake-qt-gui


三、配置OpenCV

1、将OpenCV3.2.0和OpenCV_contrib-3.2.0解压(提取),如图所示


2、双击进入解压出来的OpenCV3.2.0文件夹,右键打开终端(或者在别处打开终端,通过输入cd opencv3.2.0进入当前目录下),然后依次输入(不要忘了第三行的最后的空格和两个点):

你可能感兴趣的:(UBUNTU)