Install OpenCV on Ubuntu or Debian

原创 2016年08月30日 11:12:33

http://milq.github.io/install-opencv-ubuntu-debian/
转注:就用第一个方法吧,第二个方法的那个sh文件执行失败,因为我价格kurento.org的源,在安装第一个时,用到了这个源几个包。

Install OpenCV on Ubuntu or Debian is a bit long but very easy. You can install OpenCV from the Ubuntu or Debian repository or from the official site.

OPTION 1: INSTALL OPENCV FROM THE UBUNTU OR DEBIAN REPOSITORY

You can install OpenCV from the Ubuntu or Debian repository:

sudo apt-get install libopencv-dev python-opencv

However, you will probably not have installed the latest version of OpenCV and you may miss some features (for example: Python 3 bindings do not exist in the repository).

OPTION 2: INSTALL OPENCV FROM THE OFFICIAL SITE

To install the latest version of OpenCV be sure that you have removed the library from the repository with sudo apt-get autoremove libopencv-dev python-opencvand follow the steps below.

2.1. RUN AN INSTALLATION SCRIPT

The most simple and elegant way to install a library is running an installation script.

Download the installation script install-opencv.sh, open your terminal and execute:

bash install-opencv.sh

Type your sudo password and you will have installed OpenCV. This operation may take a long time due to the packages to be installed and the compilation process.

This script has been tested on Ubuntu 14.04 LTS, Ubuntu 16.04 LTS and Debian 8.0 "Jessie", with OpenCV 3.0.0 and OpenCV 3.1.0. You can freely change this script as you like or adapt it to other OS or OpenCV version.

2.2. EXECUTE SOME OPENCV EXAMPLES

Go to your OpenCV directory and execute a C++ example:

cd build/bin
./cpp-example-edge ../../samples/data/fruits.jpg

Now, go to your OpenCV directory and execute a Python example:

cd samples/python
python3 video.py

Finally, go to your OpenCV directory and execute a Java example:

cd samples/java/ant
ant -DocvJarDir=../../../build/bin -DocvLibDir=../../../build/lib

2.3. COMPILE A DEMONSTRATION

Download the files demo.cpp and CMakeLists.txt and put them into a folder. Now, open your terminal, go to the folder and execute:

mkdir build && cd build && cmake .. && make

Finally, run the demo: ./demo.

And that's it! You have installed OpenCV, run some examples, and compiled OpenCV code!

Do you like this article? Share it with this link. Thanks for reading!

All content created by Manuel Ignacio López Quintero under this license.

版权声明:本文为博主原创文章,未经博主允许不得转载。

opencv ubunutu16.04 安装笔记

opecv 安装常遇问题
  • yzf0011
  • yzf0011
  • 2017年08月06日 10:45
  • 461

opencv-3.0.0在Ubuntu14.04下的配置与安装

original url: http://blog.csdn.net/surgewong/article/details/39078251   每次学习新东西或者换新的电脑,最...
  • junmuzi
  • junmuzi
  • 2015年11月17日 15:28
  • 27852

ubuntu 下编译安装cmake、OpenCV

Cmake的安装 OpenCV 2.2以后版本需要使用Cmake生成makefile文件,因此需要先安装cmake。 ubuntu下安装cmake比较简单, apt-get ...
  • lien0906
  • lien0906
  • 2015年03月31日 09:58
  • 4034

debian系统下快速搭建proxmox VE

首先我的系统是:debian7.6  内核是3.2 debian系统安装完成前,你需要做下面的事: 1.设置虚拟机CPU       在虚拟化Inter VT........前面打勾       内存...
  • u012922284
  • u012922284
  • 2015年01月20日 14:19
  • 1738

Ubuntu下安装RabbitMQ(主要记录出错的地方)

其实很容易百度到步骤,不过以为我的出来问题了,所以
  • heybob
  • heybob
  • 2014年04月28日 13:53
  • 3717

Install Ruby 1.9.2 (from source) and Rails 3.0.1 on Ubuntu 10.10 & Debian6

原文:http://www.giantflyingsaucer.com/blog/?p=1883 本人在Debian6上实验安装成功 Install Ruby 1.9.2 (fro...
  • clskkk2222
  • clskkk2222
  • 2011年09月18日 21:06
  • 533

Installing Git on a server (Ubuntu or Debian)

Installing Git on a server (Ubuntu or Debian) From: http://www.hackido.com/2010/01/installing-git...
  • flex4
  • flex4
  • 2012年08月20日 22:33
  • 511

Re-install Flyme or Native Google Android on Meizu MX4 Ubuntu (by quqi99)

作者:张华 发表于:2017-06-23版权声明:可以任意转载,转载时请务必以超链接形式标明文章原始出处和作者信息及本版权声明 ( http://blog.csdn.net/quqi99 ) ##...
  • quqi99
  • quqi99
  • 2017年06月23日 09:04
  • 717

Installing wxWidgets and wxPython On Ubuntu Or Debian

Installing wxWidgets and wxPython On Ubuntu Or Debian There are wxWidgets and wxPython packages i...
  • xin_yu_xin
  • xin_yu_xin
  • 2012年07月29日 01:54
  • 1005

How to Install OpenCV 3.0 and Python 3.4+ on Ubuntu

http://www.pyimagesearch.com/2015/07/20/install-opencv-3-0-and-python-3-4-on-ubuntu/ ...
  • yulinxx
  • yulinxx
  • 2015年10月31日 01:37
  • 1785
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:Install OpenCV on Ubuntu or Debian
举报原因:
原因补充:

(最多只允许输入30个字)