[Opencv文档] 翻译ORB(Oriented FAST and Rotated BRIEF)

ORB--Oriented FAST and Rotated BRIEF

Opencv官方文档

OpenCV-Python Tutorials>Feature Detection and Description
https://docs.opencv.org/trunk/d1/d89/tutorial_py_orb.html
在这里插入图片描述

中英翻译

Theory
理论

As an OpenCV enthusiast, the most important thing about the ORB is that it came from “OpenCV Labs”. This algorithm was brought up by Ethan Rublee, Vincent Rabaud, Kurt Konolige and Gary R. Bradski in their paper ORB: An efficient alternative to SIFT or SURF in 2011. As the title says, it is a good alternative to SIFT and SURF in computation cost, matching performance and mainly the patents. Yes, SIFT and SURF are patented and you are supposed to pay them for its use. But ORB is not !!!
作为OpenCV的狂热者,关于ORB的最重要的事情是它来自“ OpenCV Labs”。 该算法由Ethan Rublee,Vincent Rabaud,Kurt Konolige和Gary R. Bradski在他们的论文《 ORB:SIFT或SURF的有效替代方案》中提出。2011年,正如标题所述,ORB相比SIFT和SURF是一个很好的选择,因为考虑了计算成本,匹配性能以及最重要的是专利方面。 是的,SIFT和SURF已获得专利,您应该为其使用付费。 但是,ORB不是!
专利20年保护, US6711293B1。专利申请于2000年3月6日,专利权人为英属哥伦比亚大学。
到2020年3月6日, 已满20年,专利权已经到期!SIFT已经成为全人类的公共技术,任何人和组织都可以免费使用!
在这里插入图片描述

ORB is basically a fusion of FAST keypoint detector and BRIEF descriptor with many modifications to enhance the performance. First it use FAST to find keypoints, then apply Harris corner measure to find top N points among them. It also use pyramid to produce multiscale-features. But one problem is that, FAST doesn’t compute the orientation. So what about rotation invariance? Authors came up with following modification.
ORB基本上是FAST关键点检测器和Brief描述符的融合,并进行了许多修改以增强性能。 首先,它使用FAST查找关键点,然后应用Harris角点测量在其中找到前N个点。 它还使用金字塔产生多尺度特征。 但是一个问题是,FAST无法计算方向。 那么旋转不变性呢? 作者提出以下修改。

It computes the intensity weighted centroid of the patch with located corner at center. The direction of the vector from this corner point to centroid gives the orientation. To improve the rotation invariance, moments are computed with x and y which should be in a circular region of radius (r), where (r) is the size of the patch.
它计算角点位于中心的贴片的强度加权质心。从此角点到质心的矢量方向确定了方向。为了改善旋转不变性,使用x和y计算矩,它们应该在半径r的圆形区域中,其中是斑块的大小。

Now for descriptors, ORB use BRIEF descriptors. But we have already seen that BRIEF performs poorly with rotation. So what ORB does is to “steer” BRIEF according to the orientation of keypoints. For any feature set of (n) binary tests at location ((x_i, y_i)), define a (2 \times n) matrix, (S) which contains the coordinates of these pixels. Then using the orientation of patch, (\theta), its rotation matrix is found and rotates the (S) to get steered(rotated) version (S_\theta).
在这里插入图片描述

ORB discretize the angle to increments of (2 \pi /30) (12 degrees), and construct a lookup table of precomputed BRIEF patterns. As long as the keypoint orientation (\theta) is consistent across views, the correct set of points (S_\theta) will be used to compute its descriptor.
在这里插入图片描述

BRIEF has an important property that each bit feature has a large variance and a mean near 0.5. But once it is oriented along keypoint direction, it loses this property and become more distributed. High variance makes a feature more discriminative, since it responds differentially to inputs. Another desirable property is to have the tests uncorrelated, since then each test will contribute to the result. To resolve all these, ORB runs a greedy search among all possible binary tests to find the ones that have both high variance and means close to 0.5, as well as being uncorrelated. The result is called rBRIEF.
BRIEF具有一个重要的特性,即每个位特征具有较大的方差,且均值接近0.5。但是,一旦沿关键点方向定向,它就会失去此属性,变得更加分散。高方差使功能更具区分性,因为它对输入的响应不同。另一个理想的特性是使测试不相关,因为从那时起每个测试都会对结果有所贡献。为了解决所有这些问题,ORB在所有可能的二进制测试中进行贪婪搜索,以找到方差高且均值接近0.5且不相关的测试。结果称为rBRIEF

For descriptor matching, multi-probe LSH which improves on the traditional LSH, is used. The paper says ORB is much faster than SURF and SIFT and ORB descriptor works better than SURF. ORB is a good choice in low-power devices for panorama stitching etc.
对于描述符匹配,使用了对传统LSH进行改进的多探针LSH。 该论文说,ORB比SURF快得多,而SIFT和ORB描述符比SURF更好。 在全景拼接等低功耗设备中,ORB是一个不错的选择。

ORB in OpenCVAs usual, we have to create an ORB object with the function, cv.ORB() or using feature2d common interface. It has a number of optional parameters. Most useful ones are nFeatures which denotes maximum number of features to be retained (by default 500), scoreType which denotes whether Harris score or FAST score to rank the features (by default, Harris score) etc. Another parameter, WTA_K decides number of points that produce each element of the oriented BRIEF descriptor. By default it is two, ie selects two points at a time. In that case, for matching, NORM_HAMMING distance is used. If WTA_K is 3 or 4, which takes 3 or 4 points to produce BRIEF descriptor, then matching distance is defined by NORM_HAMMING2.
与往常一样,我们必须使用函数cv.ORB()或使用feature2d通用接口来创建ORB对象。 它具有许多可选参数。 最有用的是nFeatures,它表示要保留的最大特征数(默认为500),scoreType表示是对特征进行排名的Harris分数还是FAST分数(默认为Harris分数)等。另一个参数WTA_K决定点数 产生定向的BRIEF描述符的每个元素。 默认情况下为两个,即一次选择两个点。 在那种情况下,为了匹配,使用NORM_HAMMING距离。 如果WTA_K为3或4,则需要3或4个点来生成Brief描述符,则匹配距离由NORM_HAMMING2定义。

python simple

import numpy as np
import cv2 as cv
from matplotlib import pyplot as plt
img = cv.imread('simple.jpg',0)
# Initiate ORB detector
orb = cv.ORB_create()
# 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 = cv.drawKeypoints(img, kp, None, color=(0,255,0), flags=0)
# plt.imshow(img2), plt.show()

plt.imshow(img2)
plt.savefig("filename.png")
plt.show()
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章