-
获取源码
-
官网下载(http://opencv.org/)
-
gitclone git@github.com:Itseez/opencv.git(前提是你安装了git)
-
解压opencv;tarzxvf ××××.tar.gz 或者 unzip×××.zip
-
-
安装相关依赖库
-
sudoapt-get -y install libopencv-dev build-essential cmake gitlibgtk2.0-dev pkg-config python-dev python-numpy libdc1394-22libdc1394-22-dev libjpeg-dev libpng12-dev libtiff4-devlibjasper-dev libavcodec-dev libavformat-dev libswscale-devlibxine-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-devlibv4l-dev libtbb-dev libqt4-dev libfaac-dev libmp3lame-devlibopencore-amrnb-dev libopencore-amrwb-dev libtheora-devlibvorbis-dev libxvidcore-dev x264 v4l-utils unzip
-
安装依赖库的时候我遇到的问题是有库不能正常安装报错如下:
libcogl15: Depends: libegl1-mesa-drivers
-
解决办法是采用命令:
sudoapt-get install -f
libegl1-mesa-drivers
-
我个人的理解是这个依赖性酷不能正常安装应该都可以采用这种方式尝试
-
-
必须保证所有的依赖库正常安装才能进行下一步的安装过程
-
-
编译opencv
-
cdopencv-3.0.0-beta
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -DWITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -DWITH_QT=ON -D WITH_OPENGL=ON ..
make -j $(nproc)
sudo makeinstall
-
-
收尾
-
sudo/bin/bash -c 'echo "/usr/local/lib" >/etc/ld.so.conf.d/opencv.conf'
sudo ldconfig
-
-
测试
-
编译opencv自带历程
-
cdopencv/opencv-3.0.0-alpha/samples/
sudo cmake .
sudo make -j$(nproc) -
cdcpp/
./cpp-example-facedetect../data/lena.jpg
./cpp-example-houghlines ../data/pic1.jpg -
注意选择响应文件夹下的图片路径
-
-
reference:
http://askubuntu.com/questions/575548/system-settings-stopped-showing-up
http://rodrigoberriel.com/2014/10/installing-opencv-3-0-0-on-ubuntu-14-04/