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代码

python 复制代码
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()
python 复制代码
<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]
相关推荐
敏编程13 分钟前
一天一个Python库:pyarrow - 大规模数据处理的利器
python
Flittly2 小时前
【从零手写 ClaudeCode:learn-claude-code 项目实战笔记】(4)Subagents (子智能体)
python·agent
明月_清风9 小时前
Python 装饰器前传:如果不懂“闭包”,你只是在复刻代码
后端·python
明月_清风9 小时前
打破“死亡环联”:深挖 Python 分代回收与垃圾回收(GC)机制
后端·python
ZhengEnCi1 天前
08c. 检索算法与策略-混合检索
后端·python·算法
明月_清风1 天前
Python 内存手术刀:sys.getrefcount 与引用计数的生死时速
后端·python
明月_清风1 天前
Python 消失的内存:为什么 list=[] 是新手最容易踩的“毒苹果”?
后端·python
Flittly2 天前
【从零手写 ClaudeCode:learn-claude-code 项目实战笔记】(3)TodoWrite (待办写入)
python·agent
千寻girling2 天前
一份不可多得的 《 Django 》 零基础入门教程
后端·python·面试
databook2 天前
探索视觉的边界:用 Manim 重现有趣的知觉错觉
python·动效