官方文档:https://docs.opencv.org/4.10.0/d1/d89/tutorial_py_orb.html
SIFT/SURF/ORB对比
https://www.bilibili.com/video/BV1Yw411S7hH?spm_id_from=333.788.player.switch&vd_source=26bb43d70f463acac2b0cce092be2eaa&p=80
ORB代码
import numpy as np
import cv2 as cv
from matplotlib import pyplot as pltgray = cv.imread('12.png', cv.IMREAD_GRAYSCALE)
# https://docs.opencv.org/4.10.0/d1/d89/tutorial_py_orb.html
# Initiate ORB detector
orb = cv.ORB.create()# find the keypoints with ORB
kp = orb.detect(gray, None)# compute the descriptors with ORB
kp, des = orb.compute(gray, kp)
print(type(kp))
print(des.shape)
print(len(kp))
print(len(des))
print(des[0])
# draw only keypoints location,not size and orientation
img2 = cv.drawKeypoints(gray, kp, None, flags=cv.DRAW_MATCHES_FLAGS_NOT_DRAW_SINGLE_POINTS)
cv.imshow('orb', img2)
cv.waitKey(0)
cv.destroyAllWindows()
<class 'tuple'>
(79, 32)
79
79
[ 96 32 25 96 4 77 65 0 104 32 32 8 151 19 0 16 128 14872 8 8 96 208 0 193 136 1 48 64 0 71 34]