ubuntu16.04 opencv环境搭建

发布于:2021-09-23 05:09:09

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

相关推荐

最新更新

猜你喜欢