SIFT: This algorithm is patented and is excluded in this configuration的解决办法
出现问题:
cv2.error: OpenCV(4.1.0) C:\projects\opencv-python\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 ‘cv::xfeatures2d::SIFT::create’
解决办法:
卸载已有安装opencv-python和opencv-contrib-python
终端输入:
pip uninstall opencv-python
pip uninstall opencv-contrib-python
安装opencv-contrib-python 3.2版本以下:
终端输入:
pip install opencv-python==3.4.2.16
pip install opencv-contrib-python==3.4.2.16