使用opencv进行图片特征提取和描述的过程中需要使用:
cv2.xfeatures2d_SIFT.create()
来提取图片的特征点,但是显示:module 'cv2.cv2' has no attribute 'xfeatures2d'
首先卸载opencv-python包
然后安装:opencv-contrib-python
sudo pip install opencv-contrib-python == 3.4.2.16
另外如果不卸载opencv-python将会出现:
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’
已入坑请避雷走。