首页 > 代码库 > Install opencv on Centos
Install opencv on Centos
研究centos 有很长一段时间了,一直没有写过这方面的感觉,今天在看到网友的一篇文章时,结合亲身体会就下面安装opencv的一些步骤与大家共享。
CentOS OpenCV已被广泛应用但是也在不断的更新,这里介绍CentOS OpenCV安装设置使用,帮助大家安装更新CentOS OpenCV系统。如何在Linux下編
譯CentOS OpenCV? (OS) (Linux) (CentOS) (Image Processing) (C/C++)
Abstract
CentOS OpenCV是一個C/C++開源的Computer Vision(計算機視覺)函式庫,在Windows上只要直接安裝即可,但在Linux需手動編譯,本文為我在
CentOS 5.1的編譯心得。
Introduction
Step 1:
至SourceForge.net : Open Computer Vision Library下載Linux版的opencv-1.0.0.tar.gz。
Step 2:
將opencv-1.0.0.tar.gz解壓縮
[root@localhost ~]# tar -zxvf opencv-1.0.0.tar.gz
Step 3:
進入opencv目錄
[root@localhost ~]# cd opencv-1.0.0
Step 4:
偵測作業環境,設定OpenCV安裝在/usr/local/opencv目錄下
[root@localhost opencv-1.0.0]# ./configure --prefix=/usr/local/opencv
Step 5:
編譯CentOS OpenCV
[root@localhost opencv-1.0.0]# make
Step 6:
安裝CentOS OpenCV
[root@localhost opencv-1.0.0]# make install
Step 7:
更新動態連結庫
[root@localhost opencv-1.0.0]# vi /etc/ld.so.conf
加入
include ld.so.conf.d/*.conf
/usr/local/opencv/lib
存檔後執行
[root@localhost opencv-1.0.0]# ldconfig
Step 8:
測試CentOS OpenCV是否安裝成功
[root@localhost opencv-1.0.0]# cd samples/c
[root@localhost c]# gcc -I/usr/local/opencv/include/opencv -L/usr/local/opencv/lib -lhighgui -lstdc++ drawing.c -o drawing
[root@localhost c]# ./drawing
Install opencv on Centos