本文主要是介绍ubuntu16.04 opencv环境搭建,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
1.下载opencv源码:
http://opencv.org/releases.html
2.解压源码压缩包:
unzip opencv-3.4.0.zip
or
tar xvf opencv-3.4.0.tar.gz
3.安装相关依赖:
sudo apt-get install cmake
sudo apt-get install build-essential libgtk2.0-dev libavcodec-dev libavformat-dev libjpeg.dev libtiff4.dev libswscale-dev libjasper-dev
4.编译opencv
$cd opencv-3.4.0
$mkdir build
$cd build
$cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local ..
$make
$sudo make install
5.连接库
$sudo vim /etc/ld.so.conf.d/opencv.conf
添加
/usr/local/lib$sudo ldconfig
6.例
cd opencv-3.4.0/samples/cpp/example_cmake
$cmake .
$make
$./opencv_example
这篇关于ubuntu16.04 opencv环境搭建的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!