Ubuntu16.04的Opencv源码安装和解决无法导入cv2的问题

前端之家收集整理的这篇文章主要介绍了Ubuntu16.04的Opencv源码安装和解决无法导入cv2的问题前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
# step 1 
# 安装依赖 (太多了,自己相应替换)
sudo apt-get -y install libopencv-dev build-essential cmake git libgtk2.0-dev pkg-config python-dev python-numpy libdc1394-22 libdc1394-22-dev libjpeg-dev libpng12-dev libjasper-dev libavcodec-dev libavformat-dev libswscale-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libv4l-dev libtbb-dev libqt4-dev libfaac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev x264 v4l-utils unzip 

sudo apt-get -y install libopencv-dev build-essential cmake git libgtk2.0-dev pkg-config python-dev python-numpy libdc1394-22 libdc1394-22-dev libjpeg-dev libpng12-dev libjasper-dev libavcodec-dev libavformat-dev libswscale-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libv4l-dev libtbb-dev libqt4-dev libfaac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev x264 v4l-utils unzip --fix-missing


# step 2
# 下载解包
wget https://github.com/Itseez/opencv/archive/3.0.0-alpha.zip
unzip opencv-3.0.0-alpha.zip
# step 3
# 编译
cd opencv-3.0.0-alpha
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -D WITH_QT=ON -D WITH_OPENGL=ON ..
# step 4
#安装
make 
sudo make install

# step 5
# 安装完成,进行整理 
sudo /bin/bash -c 'echo "/usr/local/lib" > /etc/ld.so.conf.d/opencv.conf'
sudo ldconfig
sudo apt-get update
原文链接:https://www.f2er.com/ubuntu/349949.html

猜你在找的Ubuntu相关文章