Ask Your Question

spyros_da's profile - activity

2017-02-04 13:41:32 -0600 asked a question sift error in python

hi i have windows 10 and i use opencv 3.2.0-vc14 and python i try to run this code from the book "OpenCV with Python By Example - Prateek Joshi"

import cv2
import numpy as np

input_image = cv2.imread('./images/input.jpg')
gray_image = cv2.cvtColor(input_image, cv2.COLOR_BGR2GRAY)

sift = cv2.SIFT()
keypoints = sift.detect(gray_image, None)
descriptors = sift.detectAndCompute(gray_image, None)
input_image = cv2.drawKeypoints(input_image, keypoints, flags=cv2.DRAW_MATCHES_FLAGS_DRAW_RICH_KEYPOINTS)

cv2.imshow('SIFT features', input_image)
cv2.waitKey()

*and i have this error :

Traceback (most recent call last):
  File "C:/Users/�����������/Desktop/9781785283932_code/Chapter 5/sift_features.py", line 7, in <module>
    shift = cv2.shift()*
AttributeError: 'module' object has no attribute 'shift'

please help i have the same problem and with surf, fast ,orb