pip uninstall opencv-python
Successfully uninstalled opencv-python-3.4.0.12
下载3.4.2版本
pip install opencv-python==3.4.2.16 -i "https://pypi.doubanio.com/simple/"
pip install opencv-contrib-python==3.4.2.16 -i "https://pypi.doubanio.com/simple/"
这样在Pycharm里面运行测试程序
import cv2
import numpy as np
img = cv2.imread('1.jpg')
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
sift = cv2.xfeatures2d.SIFT_create()
kp = sift.detect(gray, None) # 找到关键点
img = cv2.drawKeypoints(gray, kp, img) # 绘制关键点
cv2.imshow('1', img)
cv2.waitKey(0)
测试可用
参考文献
https://blog.csdn.net/linghugoolge/article/details/85229411
https://www.jb51.net/article/135366.htm