首页天道酬勤ubuntu查看opencv,Ubuntu18安装opencv

ubuntu查看opencv,Ubuntu18安装opencv

张世龙 05-04 04:17 127次浏览

下载gitee官方镜像更新https://gitee.com/mirrors/opencv CD/home/git clone 3359 gitee.com/mirrors/下载opencv.gitCDopencvgitclone3339的opencv_contrib.git, 依赖于sudo apt-getupdatesudoapt-getupgradesudoapt-getinstallbuild-essentialsudoapt-getinstallcmake的安装evsudoapt-getinstallpython-dev python-numpylibtbb2lib TB B- dev libjpeg-dev jsper-devli BDC 1394-22-devsudoapt-getinins le-dev lib v4l-devliblapacke-devliblapacke-22e-devli bx 264-devsudoapt-getinstalllibatlas-base-devgfortransudoapapapt 进入$ cd opencv #解压缩后的opencv文件夹,将其放在home目录下,或自己选择$ mkdir build $ CD build $ cmake-DC make _ build _ type=release \ - DC make _ install _ prefix=/usr/losr/Lome可定义可修改-dinstall_python_examples=on\ - d opencv _ extra _ modules _ path=./opencv_contrib/modules _ /自己为opencv _ contrib的modules路径- d python _ ex corib

配置完整

generating done

构建文件has been written to…

cmake …说明成功

环境配置在sudo vim/etc/LD.so.conf.d/opencv.conf #文件末尾添加和启用/usr/local/lib配置$sudoldconfig$sudogedit/etc/在bash.bash末尾添加pkg _ config _ path=$ pkg _ config _ path :/usr/local/lib/pkgconfigexportpkg _ config _ path $ opencv_example说明cmake选项说明CMAKE_INSTALL_PREFIX=默认安装路径,可修改:

python _ ex cutable=指定python模块的安装路径,并使用安装的python目录的which python命令显示:

opencv _ extra _ modules _ path=opencv _ contrib模块modules路径。 如果opencv_contrib目录位于opencv下,则无需更改。

error 删除build文件

如果cmake发生错误,请在重新尝试cmake时清除,或手动删除build中的文件,然后再试一次。

ippicv_linux_20151201.tgz 包下载失败

手动下载。 这里提供百度云下载链接:https://pan.Baidu.com/s/1 cqwvh4gpbdikd0fvrtnhna提取代码: xahp,opencv/3rd party/IPP icv/downlone

protobuf-cpp-.tar.gz 包下载失败的情况

手动下载,3358 distfiles.macports.org/proto buf3- CPP/proto buf-CPP-3.0.0.tar.gz以及proto buf-CPP-3.1

找不到cuda.hpp

opencv2/xfeatures 2d/cuda.HPP : nosuchfileordirectory系统问题的解决方案。 修复报告错误的文件的include,将其更改为绝对cuda.hpp的路径。

# include '/home/XXX/opencv/opencv _ contrib/modules/xfeatures 2d/include/opencv2/xfeatures 2d.HPP ' /示例

对于boostdesc_bgm.i的问题

直接下载boostdesc_bgm.i等9个文件并将其复制到opencv _ contrib/modules/xfeatures 2d/src /。 您可以下载https://download.csdn.net/download/QQ _ 36559293/12978990

ubuntu编译c++程序,ubuntu离线安装opencv