报错是这个:
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'
重新安装一下contrib版本吧!
可能是 opencv-python
和 opencv-contrib-python
的版本不匹配
pip install opencv-contrib-python -i https://mirror.baidu.com/pypi/simple
重启一下python就OK了