附录2:CentOS7配置OpenCV3.0.0 for Linux 64Bit
1、说明:
1、系统:CentOS 7
2、软件:opencv-3.0.0.zip
3、下载地址:codeload.github/opencv/opencv/zip/3.0.0
4、本次安装,系统采用root登录,若使用普通用户登录,请务必在进行所有终端操作之前,切换到root权限状态,但是不保证不会出错;即,每打开一次终端,先输入su root,回车后输入root密码再按回车,然后进行终端操作
5、本方法仅供参考
2、安装依赖包(重要)
终端输入:yum install cmake gcc gcc-c++ gtk+-devel gimp-devel gimp-devel-tools gimp-hel
p-browser zlib-devel libtiff-devel libjpeg-devel libpng-devel gstreamer-devel libavc1394-devel libraw1394-devel libdc1394-devel jasper-devel jasper-utils swig python libtool nasm
按回车,期间会有提示是否继续,需要确认继续
注:如果不安装上述依赖包,到最后调用opencv时会出错,如下:
OpenCV Error: Unspecified error (The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script) in cvNamedWindow,...................
此时只能将编译好的opencv删除再重新编译,即将/usr/local/lib和/usr/local/include/中的有关的删除
mv /usr/local/lib/libopencv*
mv -fr /usr/local/include/opencv
mv -fr /usr/local/include/opencv2
然后再重新编译opencv.
然后再重新编译opencv.
3、安装/更新CMake
下载最新版本的cmake-3.6.文件进行编译
下载地址:/cmake/resources/software.html
将其复制到/usr/local目录下面,并在该目录中右键打开终端
终端输入:tar -zxvf cmake-3.6.按回车
rm -rf cmake-3.6.
cd cmake-3.6.0
./configure
make
make installnullsbrawl15赛季
mv cmake-3.6.0 cmake
if then的用法输入:vi /etc/profile
在尾部添加
PATH=/usr/local/cmake/bin:$PATH
export PATH
注意:不要将冒号写成分号,要不然各种命令行都不能用
输入:source /etc/profile按回车使修改生效
输入:echo $PATH按回车查看PATH值有没有添加刚刚的路径
输入:cmake -version按回车查看cmake版本
注意:cmake安装成功之后再安装opencv
socket什么意思中文翻译成4、安装OpenCV
下载opencv-3.0.0.zip,放于/usr/local/目录下,在该目录中右键打开终端
输入:unzip opencv-3.0.0.zip
cd opencv-3.0.0
isnumberfind函数的使用方法
注:此过程中可能出现错误,参考下方错误处理
make
make install
5、添加路径
打开终端,输入find / -name "opencv.pc" -type f按回车centos和ubuntu,出现如下内容
/usr/local/lib/pkgconfig/opencv.pc
/usr/local/opencv-3.0.0/unix-install/opencv.pc
继续输入:cp usr/local/opencv-3.0.0/unix-install/opencv.pc /usr/lib64/pkgconfig/按回车
6、错误处理:
placeholder onlyCmake过程中可能出现如下错误:
“CMake Warning at 3rdparty/ake:54 (message):
ICV: Local copy of ICV package has invalid MD5 hash:
0103b909e19ca9c6497a7ae696c16480 (expected:
8b449a536a2157bcad08a2b9f266828b)
Call Stack (most recent call first):
3rdparty/ake:108 (_icv_downloader)
ake:235 (include)
ake:12 (include)
:526 (include)
-- ICV: Downloading ippicv_
CMake Error at 3rdparty/ake:71 (file):
file DOWNLOAD HASH mismatch
for file: [/home/jason/program/opencv-3.0.0/3rdparty/ippicv/downloads/linux-8b449a536a2157bcad08a2b9f266828b/ippicv_]
expected hash: [8b449a536a2157bcad08a2b9f266828b]
actual hash: [0103b909e19ca9c6497a7ae696c16480]
Call Stack (most recent call first):
3rdparty/ake:108 (_icv_downloader)
ake:235 (include)
ake:12 (include)
:526 (include)”
处理方法:
下载文件
sourceforge/projects/opencvlibrary/files/3rdparty/ippicv/ippicv_/download
覆盖掉
/usr/local/opencv-3.0.0-beta/3rdparty/ippicv/downloads/linux-8b449a536a2157bcad08a2b9f266828b/目录下的文件即可
7、OpenCV安装到此结束
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论