码迷,mamicode.com
首页 > 系统相关 > 详细

83.Ubuntu14.04安装OpenCV2.9

时间:2016-06-19 18:29:08      阅读:168      评论:0      收藏:0      [点我收藏+]

标签:

安装工具

sudo apt-get install git
sudo apt-get install g++
sudo apt-get install vim

下载Opencv

opencv2.9

解压

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的官方文档也有说明:

  1. GCC 4.4.x or later. This can be installed with:sudo apt-get install build-essential 
  2. CMake 2.6 or higher;
  3. Git;
  4. GTK+2.x or higher, including headers (libgtk2.0-dev);
  5. pkg-config;
  6. Python 2.6 or later and Numpy 1.5 or later with developer packages (python-dev, python-numpy);
  7. ffmpeg or libav development packages: libavcodec-dev, libavformat-dev, libswscale-dev;
  8. [optional] libdc1394 2.x;
  9. [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

标签:

原文地址:http://www.cnblogs.com/geekite/p/5598360.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!