Install OpenCV on Ubuntu or Debian

时间:2023-02-02 18:32:50

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!

Install OpenCV on Ubuntu or Debian的更多相关文章

  1. anaconda2下面安装opencv2.4.13.4完成----解决默认安装的问题----Thefunction is not implemented. Rebuild the library with Windows, GTK+ 2.x orCarbon support. If you are on Ubuntu or Debian, install libgtk2.0‑dev and pkg

    转载自:http://blog.csdn.net/qingyanyichen/article/details/73550924 本人下载编译安装了opencv2.4.9,oppencv2.4.10,o ...

  2. Install OpenCV 3.0 and Python 2.7+ on Ubuntu

    为了防止原文消失或者被墙,转载留个底,最好还是去看原贴,因为随着版本变化,原贴是有人维护升级的 http://www.pyimagesearch.com/2015/06/22/install-Open ...

  3. 【opencv】ubuntu opencv imshow()报错

    错误提示: ubuntu opencv imshow() 报错 windows.cpp报错 the function is not implemented If you are on Ubuntu o ...

  4. Install Docker on Ubuntu

    Install Docker on Ubuntu Estimated reading time: 17 minutes Docker is supported on these Ubuntu oper ...

  5. 【转载】ubuntu和debian环境下无法挂载vmware虚拟机共享目录的解决办法

    转载自:http://www.fengfly.com/plus/view-210022-1.html 第一步,安装VMware Tools 打开虚拟机ubuntu(debian原理一样)后,首先,点击 ...

  6. Opencv on Ubuntu (from Ubuntu)

     OpenCV Introduction Contents Introduction Installation Step 1 Step 2 Running OpenCV Python in C I ...

  7. Install OpenCV 3.0 and Python 2.7+ on OSX

    http://www.pyimagesearch.com/2015/06/15/install-OpenCV-3-0-and-Python-2-7-on-osx/ As I mentioned las ...

  8. [OpenCV] Install OpenCV 3.3 with DNN

    OpenCV 3.3 Aug 3, 2017 OpenCV 3.3 has been released with greatly improved Deep Learning module and l ...

  9. [OpenCV] Install OpenCV 3.4 with DNN

    目标定位 一.开始全面支持 Tensorflow OpenCV3.4 新功能 当前最新进展OpenCV 3.4 dev:https://github.com/opencv/opencv/tree/ma ...

随机推荐

  1. linuxMint下安装ftp工具--filezilla

    windows下ftp工具有好多,linux下推荐用filezilla 安装filezilla很简单,安装完后,使用方式和windows下面一样. 第一种方式: 直接去filezilla官网下载软件包 ...

  2. [LintCode] Parking Lot 停车场问题

    Design a parking lot. see CC150 OO Design for details.1) n levels, each level has m rows of spots an ...

  3. 【POJ 2484】A Funny Game

    Description Alice and Bob decide to play a funny game. At the beginning of the game they pick n(1 &l ...

  4. delphi控件安装与删除

    附带通用控件安装方法:----------基本安装1.对于单个控件,Componet-->install component..-->PAS或DCU文件-->install;2.对于 ...

  5. Redisson使用起来很方便,但是需要redis环境支持eval命令

    Redisson使用起来很方便,但是需要redis环境支持eval命令,否则一切都是悲剧,比如me.结果还是要用RedisCommands去写一套.例子就如下,获得一个RLock锁对象,然后tryLo ...

  6. 51nod 1103 N的倍数 思路:抽屉原理+前缀和

    题目: 这是一道很神奇的题目,做法非常巧妙.巧妙在题目要求n个数字,而且正好要求和为n的倍数. 思路:用sum[i]表示前i个数字的和%n.得到sum[ 1-N ]共N个数字. N个数字对N取模,每个 ...

  7. flock SUSE/RHEL

    Util-linux-2.26 Util-linux 软件包其它实用程序.包括处理文件系统.控制台.分区以及消息等工具. 大概编译时间:1.3 SBU 需要磁盘空间:137 MB 6.65.1. FH ...

  8. httpd日志格式

    日志的缺省格式有如下几种: LogFormat "%h %l %u %t "%r" %>s %b "%{Referer}i" "%{U ...

  9. freeRTOS与裸机程序相比有什么区别??

    FreeRTOS命名及变量规则 初学FreeRTOS的用户对其变量和函数的命名比较迷惑,    FreeRTOS的核心源代码遵从MISRA编码标准指南,关于MISRA编码标准,可以查看文章https: ...

  10. SpringMVC注解式开发之接收请求参数

    逐个接收(涉及注解@RequestParam) index.jsp的name必须和后端的名字一致,第一种才可以实现. 以对象形式整合接收 域属性参数的接收 数组或集合参数的接收 restfull风格传 ...