ubuntu12中opencv安装,官方

操作之前请确保你的ubuntu系统的源是正确的,可以到http://wiki.ubuntu.org.cn/源列表#Precise.2812.04.29.E7.89.88.E6.9C.AC下察看对应你的版本的源,将/etc/apt/source.list替换为对应的源。执行sudo apt-get update
注意此方法适合opencv2.X
  • 1.安装build-essential:GCC 4.4.x or later. This can be installed with:

    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 Source Using CMake, Using the Command Line

    Create a temporary directory, which we denote as , where you want to put the generated Makefiles, project files as well the object files and output binaries.

    Enter the and type

    cmake [] source directory>

  • 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:

    make
    sudo make install
    
  • sudo ldconfig重新加载系统中使用的库,可以不用重启电脑就可用opencv库了
  • 参阅:http://docs.opencv.org/trunk/doc/tutorials/introduction/linux_install/linux_install.html
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值