[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()
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章