Ubuntu安装opencv3.4.5

1.去官网下载opencv3.4.5版本
opencv下载地址

确保ubuntu安装了cmake,以及安装以下

apt-get install build-essential libgtk2.0-dev libvtk5-dev libjpeg-dev libtiff4-dev libjasper-dev libopenexr-dev libtbb-dev

2.解压文件并创建编译后的安装目录

1 unzip opencv-3.4.5.zip
2 cd opencv-3.4.5/
3 mkdir build
4 mkdir /opt/opencv3.4.5
5 cd build
6 vim build.sh

将以下配置写入buile.sh中

cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/opt/opencv3.4.5 \
-D WITH_TBB=ON \
-D WITH_V4L=ON \
-D INSTALL_C_EXAMPLES=ON \
-D INSTALL_PYTHON_EXAMPLES=ON \
-D BUILD_EXAMPLES=ON \
-D WITH_QT=ON \
-D WITH_OPENGL=ON \

执行source ./build.sh
生成Makefile后

make -j8
make install

你可能感兴趣的:(音视频开发,opencv)