欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

opencv python ORB特征提取

程序员文章站 2024-03-25 20:08:34
...

简单的摘抄,不做翻译了。

Theory:
As an OpenCV enthusiast, the most important thing about the ORB is that it came from “OpenCV Labs”. This algorithm was brought up by Ethan Rublee, Vincent Rabaud, Kurt Konolige and Gary R. Bradski in their paper ORB: An efficient alternative to SIFT or SURF in 2011. As the title says, it is a good alternative to SIFT and SURF in computation cost, matching performance and mainly the patents. Yes, SIFT and SURF are patented and you are supposed to pay them for its use. But ORB is not !!!

code:

import numpy as np
import cv2
from matplotlib import pyplot as plt

img = cv2.imread('1.png', 0)
# print('img')

# Initiate STAR detector
orb = cv2.ORB_create()
print('orb')

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

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

# draw only keypoints location,not size and orientation
img2 = cv2.drawKeypoints(img, kp, None, color=(0, 255, 0), flags=0)
print('img2')

plt.imshow(img2)
plt.show()

参考

OpenCV ORB (Oriented FAST and Rotated BRIEF)

上一篇: if语句

下一篇: if语句