1.下载然后解压安装压缩包
unzip opencv-2.4.13.zip
2. 进入刚解压的文件夹,建立release文件夹
cd opencv-2.4.13 mkdir release
3. 安装一下必须的依赖库
sudo apt-get install build-essential cmake libgtk2.0-dev pkg-config python-dev python-numpy libavcodec-dev libavformat-dev libswscale-dev
sudo apt-get install -x264 v4l-utils ffmpeg
4. 进入release文件夹,用cmake编译OpenCV的源码,把lib安装到/usr/local目录下
cd release
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ..5. 安装
sudo make install