参考来自:http://blog.csdn.net/zhuiqiuk/article/details/53085058
根据自己14.04总结的:
1.1 依赖包
sudo apt-get install build-essential libgtk2.0-dev libjpeg-dev libtiff4-dev libjasper-dev libopenexr-dev cmake python-dev python-numpy python-tk libtbb-dev libeigen2-dev yasm libfaac-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev libx264-dev libqt4-dev libqt4-opengl-dev sphinx-common texlive-latex-extra libv4l-dev libdc1394-22-dev libavcodec-dev libavformat-dev libswscale-dev
2 下载源码
https://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.4.9/opencv-2.4.9.zip
3 在解压目录下创建子目录release
mkdir release;cd release
4 编译安装
4.1 cmake生成make文件
cmake -D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON-D WITH_FFMPEG=OFF-D WITH_V4L=ON -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D WITH_QT=ON -D WITH_OPENGL=ON ..
4.2 make
4.3 make install
测试
cd ~/OpenCV-2.4.9/samples/c
chmod +x build_all.sh
./build_all.sh
./facedetect --cascade="/usr/local/share/OpenCV/haarcascades/haarcascade_frontalface_alt.xml" --scale=1.5 lena.jpg
ffmpeg安装
源码下载 : svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
文件配置 : ./configure --enable-shared --prefix=/usr
安装 : make && make install
三:配置Library
打开/etc/ld.so.conf.d/opencv.conf,在末尾加入/usr/local/lib ;
编辑添加目录:
编辑/etc/bash.bashrc,加入