ubuntu10.4上安装OpenCV

1.下载

到http://opencv.org/下载最近的linux源码包OpenCV-2.4.3.tar.bz2

2.解压源码包

tar -xzf OpenCV-2.4.3.tar.bz2

3.安装依赖的包


sudo apt-get install build-essential




sudo apt-get install cmake

sudo apt-get install libgtk2.0-dev

sudo apt-get install pkgconfig

sudo apt-get install python-dev python-numpy

sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev

4.开始编译源码

在解压源码的同级目录建立文件夹OpenCV-build:mkdir OpenCV-build

进入文件夹:cd OpenCV-build

cmake 生成make文件:cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ../OpenCV-2.4.3

5.编译安装

make 

sudo make install

完成

如有问题:参考 http://docs.opencv.org/trunk/doc/tutorials/introduction/linux_install/linux_install.html

编译完成后使用opencv 例子在:http://docs.opencv.org/trunk/doc/tutorials/introduction/linux_gcc_cmake/linux_gcc_cmake.html

猜你喜欢

转载自ouyangfeng521.iteye.com/blog/1771548