2014-10-02 3 views
1

저는 Python (2.7)을 배우기 시작했고 컴퓨터 비전 (모듈 openCv "cv2")을 사용하여 작업하려고합니다. 나는 OpenCV version2.4를 사용한다.python을위한 openCV의 ORB에서 속성 계산이 작동하지 않습니다.

현재 비디오에서 객체를 추적하는 데 도움이되는 ORB (orb 지향적 인 빠른 회전 및 간단한 회전)에있는 this tutorial에서 예제를 실행하려고합니다.

import cv2 
from matplotlib import pyplot as plt 

#create image 
img = np.zeros((512,512,3), np.uint8) 
cv2.line(img,(0,0),(511,511),(255,0,0),5) 

# Initiate STAR detector 
orb = cv2.ORB() 

# find the keypoints with ORB 
kp = orb.detect(img,None) 

# compute the descriptors with ORB 
kp, des = orb.compute(img, kp) 

# draw only keypoints location,not size and orientation 
img2 = cv2.drawKeypoints(img,kp,color=(0,255,0), flags=0) 
plt.imshow(img2),plt.show() 

난 후 다음과 같은 메시지가 오류가 있습니다 :

문제는 내가 예를 실행할 때 (난 그냥이 예 재현을하기 위해 이미지 로딩을 변경) 오류를 가지고 있다는 것입니다

--------------------------------------------------------------------------- 
AttributeError       Traceback (most recent call last) 
<ipython-input-2-f294d6a53bcc> in <module>() 
    12 print(kp) 
    13 # compute the descriptors with ORB 
---> 14 kp, des = orb.compute(img, kp) 
    15 
    16 # draw only keypoints location,not size and orientation 

AttributeError: 'cv2.ORB' object has no attribute 'compute' 

이 개체에이 특성이없는 이유를 알 수 없습니다. 내 스크립트가 그것을 억제합니까?

도움을 주셔서 감사합니다.

고마워요. Edwin

답변

0

저는 또한 OpenCV를 배우기 시작했는데, 제 경우에는 파이썬도 배우기 시작했습니다. 내 버전은 Win7 64 비트, Python 2.7.8, OpenCV 2.4.10입니다.

오류 메시지였다 AttributeError :

http://www.lfd.uci.edu/~gohlke/pythonlibs/#opencv

: '모듈'개체가

내 솔루션 여기에서 비공식 바이너리를 설치하는 것이 었습니다 어떤 속성 'ORB를'이 없다