久闻OpenCV之名,之前也尝试过几次。
如今又一次开始了OpenCV开发之路。
系统环境:Ubuntu16.04
OpenCV版本:3.4.1
1、安装依赖
# Build tools:
sudo apt-get install -y build-essential cmake
# GUI (if you want to use GTK instead of Qt, replace 'qt5-default' with 'libgtkglext1-dev' and remove '-DWITH_QT=ON' option in CMake):
sudo apt-get install -y qt5-default libvtk6-dev
# Media I/O:
sudo apt-get install -y zlib1g-dev libjpeg-dev libwebp-dev libpng-dev libtiff5-dev libjasper-dev libopenexr-dev libgdal-dev
# Video I/O:
sudo apt-get install -y libdc1394-22-dev libavcodec-dev libavformat-dev libswscale-dev libtheora-dev libvorbis-dev libxvidcore-dev libx264-dev yasm libopencore-amrnb-dev libopencore-amrwb-dev libv4l-dev libxine2-dev
# Parallelism and linear algebra libraries:
sudo apt-get install -y libtbb-dev libeigen3-dev
# Python:
sudo apt-get install -y python-dev python-tk python-numpy python3-dev python3-tk python3-numpy
2、下载源码并编译安装
cd ~
cd opencv3.4.0
mkdir build
cd build
cmake ../
make
sudo make install
注:opencv似乎与ROS会发生冲突,测试时,在Python3下,无法正确导入cv2。仍未找到解决方案。
参考自Gpwner的博客