0
点赞
收藏
分享

微信扫一扫

深度学习笔记(5)——目标检测和图像分割

花海书香 2024-12-29 阅读 2

官方文档: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]
举报

相关推荐

0 条评论