opencv3.3.1中不含openc_contrib的解决方法

1,由于需要使用到SIFT,SURF算子,而在3.3.1的版本里没有此类算法的代码,因此需要把对应opencv_contrib_3.3.1的额外模块也安装在源码文件夹内。尝试了几次在原库上安装,效果不太好,碰到了各式各样的问题,强烈建议卸载原库,重新安装(原库+额外模块)。卸载的代码可以参考下例:

    make uninstall
    cd ..
    sudo rm -rf build
    sudo rm -rf /usr/local/include/opencv2 /usr/local/include/opencv /usr/include/opencv /usr/include/opencv2 /usr/local/share/opencv /usr/local/share/OpenCV /usr/share/opencv /usr/share/OpenCV /usr/local/bin/opencv* /usr/local/lib/libopencv_*

2,安装:
主要参考这位博主的文章:https://blog.csdn.net/xiangxianghehe/article/details/78780269
3,查看opencv版本:

pkg-config --modversion opencv

你可能感兴趣的:(opencv,opencv_contrib)