本文介绍了使用ORB类的计算方法生成的描述符数组代表什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Python中使用OpenCV制作给定图像的特征描述符.为此,我正在使用 ORB 类.我不理解的是在使用 orb.detect orb.compute 之后描述符数组包含的内容.方法.

I am using OpenCV in Python to make a feature descriptor of a give image. For that I am using ORB class.What I don't understand is what the descriptor array contains after using orb.detect and orb.compute methods.

下面是我的代码.

import cv2
from matplotlib import pyplot as plt
from sklearn.cluster import KMeans

img = cv2.imread('penguins.jpg',0)

# Initiate STAR detector
orb = cv2.ORB_create(nfeatures=1000)

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

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

# draw only keypoints location,not size and orientation
img2 = cv2.drawKeypoints(img,kp,des, color=(0,255,0), flags=0, )
plt.imshow(img2),plt.show()

print len(kp),len(des),len(des[1]), des[0]

最后一行的输出如下:

1000 1000 32 [221  65  79 237   6   2 111 112 116 194 243  70  83  99 177 113 118 228
  62 238 233 181  37  76 244 171 230 128  45 178  96  49]

为什么 des 的每个元素的长度都是32?它代表什么?我知道它应该是与每个关键点相对应的描述符数组,但是这些数字究竟代表什么?

Why is the length of each element of des is 32? What does it represent? I know that it is supposed to be a descriptor array corresponding to each keypoint, but what exactly do those numbers represent?

我已经从链接.

推荐答案

每个ORB描述符的默认长度为32个字节.每个字节包含8个像素强度比较,如官方论文中所述: https://www.willowgarage.com/sites/default/files/orb_final.pdf

The default lenght of each ORB descriptor is 32 bytes. Each byte contains 8 pixel intensity comparisons as explained in the official paper: https://www.willowgarage.com/sites/default/files/orb_final.pdf

还要检查:OpenCV ORB描述符-如何精确地存储在一组字节中?

这篇关于使用ORB类的计算方法生成的描述符数组代表什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-14 00:36