ubuntu12中opencv安装,官方

来源:互联网 发布:vue v bind 数组 编辑:程序博客网 时间:2024/04/30 12:23
操作之前请确保你的ubuntu系统的源是正确的,可以到http://wiki.ubuntu.org.cn/源列表#Precise.2812.04.29.E7.89.88.E6.9C.AC下察看对应你的版本的源,将/etc/apt/source.list替换为对应的源。执行sudoapt-get update
注意此方法适合opencv2.X
  • 1.安装build-essential:GCC 4.4.x or later. This can be installedwith:

    sudo apt-get install build-essential 
  • 安装CMake 
    sudo apt-get install cmake
  • 安装一些列的库与组件:      方便操作,命令合并如下
  • sudo apt-get install libgtk2.0-dev pkg-config python-dev  python-numpy libavcodec-dev libavformat-dev libswscale-dev libdc1394-22  libjpeg-dev libpng-dev libtiff-dev libjasper-dev(最后面的四个包是可选的)
  • 获得OPENCV源码包

  • Building OpenCV from SourceUsing CMake, Using the Command Line

    Create atemporary directory, which we denote as , where you want to put thegenerated Makefiles, project files as well the object files andoutput binaries.

    Enterthe and type

    cmake [] sourcedirectory>

  • For example

    cd ~/opencv 
    mkdir release 
    cd release 
    cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ..
  • Enter the created temporary directory () and proceed with:

    makesudo make install
  • sudoldconfig重新加载系统中使用的库,可以不用重启电脑就可用opencv库了
  • 参阅:http://docs.opencv.org/trunk/doc/tutorials/introduction/linux_install/linux_install.html
0 0
原创粉丝点击