opencv-contrib, sift/surf 特征提取失败,This algorithm is patented and is excluded in this configuration

       最近做视频稳像需要用到surf提取特征,就需要用到opencv-contrib-python包中的cv2.xfeatures2d接口,不论安装opencv-python。还是opencv-contrib-python,都报如下错误:

cv2.error: OpenCV(4.1.0) /io/opencv_contrib/modules/xfeatures2d/src/surf.cpp:1029: 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-contrib-python 3.4以上的版本都不支持此接口了,折腾半天后,解决方案如下:

1. 卸载已有安装opencv-python:

      pip uninstall opencv-python

2. 安装opencv-contrib-python  3.2版本以下:

      pip install opencv-contrib-python==3.4.2

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值