This line:
sift = cv2.xfeatures2d.SIFT_create()
return error:
Traceback (most recent call last):
File \"C:/Python27/openC
This error may also occur in OpenCV 3+ as it is caused by mismatched versions of OpenCV and OpenCV-Contrib package.
I had OpenCV version 3.4.1 and OpenCV-Contrib version 3.4.0. I tried the following with OpenCV-Contrib:
Uninstall OpenCV-Contrib package:
$ pip uninstall opencv-contrib-python
Then install the same again:
$ pip install opencv-contrib-python
The pip automatically fetches and installs the latest compatible version.