ubuntu16.04下安装opencv

source url:http://blog.csdn.net/zhuiqiuk/article/details/5308505811


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 下载源码
wget 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_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


CMake Error at cuda_compile_generated_matrix_operations.cu.o.cmake:206 (message):
Error generating

输入:“cmake -D CMAKE_BUILD_TYPE=bulid -D CMAKE_INSTALL_PREFIX=/usr/local -D CUDA_GENERATION=Kepler ..”,即可解决!


http://tieba.baidu.com/p/3138452773


测试
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

无觅关联推荐,快速提升流量
每日一句
    每一个你不满意的现在,都有一个你没有努力的曾经。