83.Ubuntu14.04安装OpenCV2.9
Posted A风筝
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了83.Ubuntu14.04安装OpenCV2.9相关的知识,希望对你有一定的参考价值。
安装工具
sudo apt-get install git
sudo apt-get install g++
sudo apt-get install vim
下载Opencv
解压
mkdir tmp
mv opencv-2.4.9.zip tmp
cd tmp
unzip opencv-2.4.9.zip
cd opencv-2.4.9
mkdir release
安装依赖库
sudo apt-get install build-essential cmake libgtk2.0-dev pkg-config python-dev python-numpy libavcodec-dev libavformat-dev libswscale-dev
在opencv的官方文档也有说明:
- GCC 4.4.x or later. This can be installed with:
sudo apt-get install build-essential
- CMake 2.6 or higher;
- Git;
- GTK+2.x or higher, including headers (libgtk2.0-dev);
- pkg-config;
- Python 2.6 or later and Numpy 1.5 or later with developer packages (python-dev, python-numpy);
- ffmpeg or libav development packages: libavcodec-dev, libavformat-dev, libswscale-dev;
- [optional] libdc1394 2.x;
- [optional] libjpeg-dev, libpng-dev, libtiff-dev, libjasper-dev.
ff-dev, libjasper-dev.
进入目录生成MakeFile文件
cd releaase
安装所有的lib文件都会被安装到/usr/local目录下
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ..
构建和安装
make
make install
加载动态连接库
sudo sh -c ‘echo "/usr/local/lib" > /etc/ld.so.conf.d/opencv.conf‘
sudo ldconfig
以上是关于83.Ubuntu14.04安装OpenCV2.9的主要内容,如果未能解决你的问题,请参考以下文章
Ubuntu14.04麒麟版lamp安装+phpmyadmin