python opencv的orb特征检测(Oriented FAST and Rotated BRIEF)

官方文档: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 plt

gray = 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 148
  72   8   8  96 208   0 193 136   1  48  64   0  71  34]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值