ubuntu18.04安装opencv4.1.2+opencv_contrib4.1.2

下载源文件:

1.opencv4.1.2下载链接:https://github.com/opencv/opencv
2.opencv_contrib4.1.2下载链接:https://github.com/opencv/opencv_contrib

编译

将解压后的opencv_contrib4.1.2放在opencv4.1.2文件夹下,
新建build文件夹:

mkdir build

进入build文件夹:

cd build

编译:

 cmake -D CMAKE_BUILD_TYPE=RELEASE \
       -D CMAKE_INSTALL_PREFIX=/usr/local \
       -D OPENCV_EXTRA_MODULES_PATH=~/Downloads/opencv-4.1.2/opencv_contrib/modules/ \
       -D OPENCV_ENABLE_NONFREE=ON ../
make

安装:

sudo make install

中间遇到的坑

1.opencv下载过程中,如果一直卡在下载ippicv_2019_xxxx处,参考如下博客:
https://blog.csdn.net/heroybc/article/details/101097166
2.make过程中出现fatal error: boostdesc_bgm.i: No such file or directory,为文件缺失导致,参考博客:
https://blog.csdn.net/ninwji/article/details/100798014
3.make过程中出现fatal error: features2d/test/test_detectors_regression.impl.hpp: No such fil,头文件问题,对策详见博客:
https://blog.csdn.net/ninwji/article/details/100798014
4.make过程中出现error: ‘ppf_match_3d’ was not declared in this scope template,查遍了github上的issue,结论是,在build下面执行:
make clean
之后再make,就OK了
5.使用SIFT过程中出现:opencv-4.1.2/opencv_contrib/modules/xfeatures2d/src/sift.cpp:1207: error: (-213:The function/feature is not implemented) This algorithm is patented and is excluded in this configuration; Set OPENCV_ENABLE_NONFREE CMake option and rebuild the library in function ‘create’
哈哈~
是因为安装opencv时候,cmake时候没有设置OPENCV_ENABLE_NONFREE=ON,重新cmake,make,install去吧

  • 6
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值