- My code on Google Colab
import cv2 as cv
image = cv.imread("/content/drive/My Drive/Image.bmp")
gray_image = cv.cvtColor(image,cv.COLOR_BGR2GRAY)
sift = cv.xfeatures2d_SIFT.create()
keyPoints = sift.detect(image,None)
output = cv.drawKeypoints(image,keyPoints,None)
cv.imshow("FEATURES DETECTED",output)
cv.imshow("NORMAL",image)
cv.waitKey(0)
cv.destroyAllWindows()
- ERROR
*AttributeError Traceback (most recent call last) in () 4 gray_image = cv.cvtColor(image,cv.COLOR_BGR2GRAY) 5 ----> 6 sift = cv.xfeatures2d_SIFT.create() 7 keyPoints = sift.detect(image,None) 8
- AttributeError: module 'cv2.cv2' has no attribute 'xfeatures2d_SIFT'