AttributeError:模块'cv2.cv2'没有属性'SIFT'

时间:2017-10-26 13:42:40

标签: python opencv

我在Windows 10中工作并使用python 3.6并使用pip a opencv-python

进行安装

然后安装opencv_python-3.3.1 + contrib-cp36-cp36m-win_amd64.whl Opencv测试鳕鱼是:

from time import time
from numpy import uint8
from numpy.random import rand
import cv2

xy=(512,512)
Nf = 500

def fpsopencv(dat):
    tic = time()
    for i in dat:
        cv2.imshow('test',i)
        cv2.waitKey(1) #integer milliseconds, 0 makes wait forever
    cv2.destroyAllWindows()
    return Nf / (time()-tic)


imgs = (rand(Nf,xy[0],xy[1])*255).astype(uint8)
fps = fpsopencv(imgs)

print(fps,'fps')

它运作良好。

但是如果想在我的代码中使用SIFT:

sift = cv2.SIFT()

我总是收到这个错误:

AttributeError: module 'cv2.cv2' has no attribute 'SIFT'

我不知道什么是解决方案。有人可以帮帮我吗? (抱歉我的英语不好)

0 个答案:

没有答案
相关问题