1.cv2.xfeatures2d不能使用,sift /surf 不能使用(专利被注册)
sift = cv2.xfeatures2d.SIFT_create()
cv2.error: OpenCV(3.4.3) /io/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,退回版本。
pip uninstall opencv_python
pip uninstall opencv-contrib-python
pip install opencv_python==3.4.2.16
pip install opencv-contrib-python==3.4.2.16