Sim*_*ang 5 python opencv image orb
在我之前的问题中,我了解到必须安装opencv-contrib以便将OpenCV Python与外部模块(如SIFT)一起使用.但是,在我的项目中,我想使用ORB或类似的东西.cv2.ORB()不起作用,也不起作用cv2.xfeatures2d.ORB_create()或任何其他命令的凝集.
据了解,OpenCV的Python API文档相当差.
如何使用ORB匹配OpenCV Python中的功能?
MWE:
#!/usr/bin/python2.7
import numpy as np
import cv2
from matplotlib import pyplot as plt
img = cv2.imread('smallburger.jpg',0)
# 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()
Run Code Online (Sandbox Code Playgroud)
CLI输出:
Traceback (most recent call last):
File "./mwe.py", line 9, in <module>
orb = cv2.ORB()
AttributeError: 'module' object has no attribute 'ORB'
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4256 次 |
| 最近记录: |