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.

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

相关文章推荐

ubuntu 14.04 下利用apt-get方式安装opencv

1.前言相比于源代码方式安装opencv,通过apt方式安装过程步骤简单些,消耗的时间也少一些。通过apt方式安装没有自动生成opencv.pc文件,所以在编写makefile文件时不能直接使用pkg...
  • tina_ttl
  • tina_ttl
  • 2016年10月06日 22:17
  • 18011

debian下OpenCV安装 + 简单测试实例

更新下载更新软件包列表信息 sudo apt-get update 查询OpenCV相关软件 wangye@debian:~/Opencv_study$ apt-cache search ...

Ubuntu 安装OpenCV3.0.0

Ubuntu  安装OpenCV3.0.0为了看看opencv3.0的HDR效果,尝试安装opencv3.0到ubuntu12.04上面,安装了好几次终于成功了。参考博客:http://www.sam...
  • adong76
  • adong76
  • 2014年10月12日 15:26
  • 16137

在Ubuntu中安装并测试OpenCV

参照www.Micro_Studios.com的视频,在Ubuntu中成功安装了opencv,并且测试成功。现把具体的安装及测试过程整理出来,适合刚刚在Linux中使用opencv的同学参考参考。...

异或详解

异或门符号'^',在编程中的使用,有的时候能够让你的程序更加精炼简捷, 尤其在C++的acm程序应用中,可以避免许多麻烦!!!它的几个简单作用 讲解如下: 它的简单规则是相同为0,不同为1,例如...

如何解决ubuntu中使用SDL_OpenAudio失败返回错误信息no such audio device

If you built your own SDL, you probably didn't have development headers  for PulseAudio (or ALSA), ...

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...

Installing wxWidgets and wxPython On Ubuntu Or Debian

Installing wxWidgets and wxPython On Ubuntu Or Debian There are wxWidgets and wxPython packages i...

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

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
  • 603
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:Install OpenCV on Ubuntu or Debian
举报原因:
原因补充:

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