文档章节

Install Opencv in CentOS

Mark93
 Mark93
发布于 2017/02/15 14:41
字数 344
阅读 20
收藏 0

Install opencv in CentOS
Opencv can be install in CentOS in two ways:

1) Install from available yum repository.
But till the time of writing this post opencv-2.0.0 repository are available. If you need latest version of opencv then go for 2. option.
2) Opencv installation from source.

1) Install opencv from yum repo
Before installation of opencv-python from yum repository we have to install require library numpy.

$ sudo yum install python-devel python-nose python-setuptools gcc gcc-gfortran gcc-c++ blas-devel lapack-devel atlas-devel
$ sudo easy_install pip
$ sudo pip install numpy==1.6.1

If you haven’t installed opencv rpm then you can download from here and install it first . After installation of rpm now opencv will be available for installation.

$ yum install opencv

2) Installing Opencv from Source:
To install opencv from we need to install require and optional dependencies.

  • CMake : For configure the opencv installation.
  • Python-devel and Numpy : For Creating python extension.
  • GCC: For compilation.
$ yum install cmake
$ yum install python-devel numpy
$ yum install gcc gcc-c++

Install GTK To support GUI features, Camera support (libdc1394, libv4l), Media Support (ffmpeg, gstreamer) etc.

$ yum install gtk2-devel
$ yum install libdc1394-devel
$ yum install libv4l-devel
$ yum install ffmpeg-devel
$ yum install gstreamer-plugins-base-devel

Optional Dependencies:
Install below pakcages if you need latest libraries of PNG, JPEG, JPEG2000, TIFF, WebP.

$ yum install libpng-devel libjpeg-turbo-devel jasper-devel openexr-devel libtiff-devel libwebp-devel

Now we have finish the first step of opencv installation. In next step download the opencv source from git repository.

$ yum install git
$ mkdir opencv-build
$ cd opencv-build
$ git clone https://github.com/Itseez/opencv.git
$ cd opencv
$ git checkout tags/2.4.8.2

Create a new directory build to compile opencv from source.

$ mkdir build
$ cd build
$ cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ..
$ make
$ sudo make install

Above installation will install package in /usr/local/lib . To use this we need to copy site-packages from /usr/local/lib to /usr/lib.
Move opencv module from in defult python path:

$ cp /usr/local/lib/python2.7/site-packages/cv2.so /usr/lib/python2.7/site-packages

Verify Installation:

$ python
>>> import cv2
>>> print cv2.__version__

That’s it.

本文转载自:http://techieroop.com/install-opencv-in-centos/

共有 人打赏支持
Mark93
粉丝 6
博文 140
码字总数 35695
作品 0
朝阳
Linux 中使用 OpenCV

修订记录 2012.11.20修订OpenCV 2.4+在CentOS安装方法。 2012.11.21添加OpenCV 2的打开图片的写法。 预备 GCC CMake OpenCV 这些都可以在CentOS 6.0的“添加/删除软件”里面找到并安装。其他...

j_m
2012/11/26
0
0
在iPhone上使用 OpenCV

2012-08-02 01:08   原文:http://niw.at/articles/2009/03/14/using-opencv-on-iphone/en   Posted by Yoshimasa Niwaon 03/14, 2009   图片   OpenCV是intel开发的计算机视觉库,例......

abcMx
2013/09/05
0
0
OpenCV配置,从来没有这么简单!

用CMAKE配置自己的OpenCV程序 ---配置OpenCV从来没有这么简单! 本文需要一定的CMAKE知识,推荐阅读中文的 CMake Practice.pdf ,至于Cmake是什么,我只能说他是跨平台的项目管理工具,具体请各位...

LMcallme
2015/04/26
0
6
OpenCV安装(Linux)相关问题及解决

一、OpenCV的安装: 选择Ubuntu14.04LFS + opencv2.4.11 ,具体参考官方提供的安装教程 1.先安装个叫cmake 的工具,使用 sudo apt-get install cmake ,安装的应该是最新版;另外可以安装cma...

Comma_H
05/14
0
0
记 Mac 上安装 openCv 的经历(巨坑)

最近需要使用 python 调用 openCv 来玩一些东西,结果安装 openCv 的过程充满血泪 环境和安装过程 mac 环境,自带 python 2.7 首先安装了 homebrew /usr/bin/ruby -e "$(curl -fsSL https://...

小虫巨蟹
05/04
0
0

没有更多内容

加载失败,请刷新页面

加载更多

Delphi 常用API 函数(好多都没见过)

AdjustWindowRect 给定一种窗口样式,计算获得目标客户区矩形所需的窗口大小 AnyPopup 判断屏幕上是否存在任何弹出式窗口 ArrangeIconicWindows 排列一个父窗口的最小化子窗口 AttachThread...

dillonxiao
16分钟前
1
0
阿里云ubuntu配置Android开发环境编译Apk

1.命令行下载Android SDK $ wget https://dl.google.com/android/android-sdk_r24.4.1-linux.tgz $ tar zxvf android-sdk_r24.4.1-linux.tgz 2.列出可以现在的SDK ./android list sdk  -a 3......

SuShine
17分钟前
1
0
maven导出项目依赖的jar包

一、导出到默认目录 targed/dependency 从Maven项目中导出项目依赖的jar包:进入工程pom.xml 所在的目录下,执行如下命令: mvn dependency:copy-dependencies 二、导出到自定义目录中 在mav...

来来来来来
17分钟前
1
0
Win10下React Native环境安装教程及错误处理办法(实测)

https://blog.csdn.net/zhangatle/article/details/53289471 准备工作 注意:小米手机MIUI有坑,文末有解决方法 1 首先,你需要先安装Node.js并进行环境变量的配置,具体可以参考我的另一篇文...

james_laughing
17分钟前
0
0
IDEA2018 Mybatis plugin破解

IDEA2018 Mybatis plugin破解 Mybatis Plugin 一、Mybatis Plugin插件是什么 提供Mapper接口与配置文件中对应SQL的导航 编辑XML文件时自动补全 根据Mapper接口, 使用快捷键生成xml文件及SQL...

DemonsI
18分钟前
0
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部