ORB - (Oriented Fast and Rotated BRIEF) 算法是基于 FAST 特征检测与 BRIEF 特征描述子匹配实现,相比 BRIEF 算法中依靠随机方式获取而值点对,ORB 通过 FAST 方法,FAST 方式寻找候选特征点方式是假设灰度图像像素点 A 周围的像素存在连续大于或者小于 A 的灰度值,选择任意一个像素点 P,假设半径为 3,周围 16 个像素表示如下
static Ptr<ORB> cv::ORB::create (
int nfeatures = 500,
float scaleFactor = 1.2f,
int nlevels = 8,
int edgeThreshold = 31,
int firstLevel = 0,
int WTA_K = 2,
int scoreType = ORB::HARRIS_SCORE,
int patchSize = 31,
int fastThreshold = 20
)
参数
含义
nfeatures
The maximum number of features to retain. 最终输出最大特征点数目
scaleFactor
Pyramid decimation ratio, greater than 1. scaleFactor2 means the classical pyramid, where each next level has 4x less pixels than the previous, but such a big scale factor will degrade feature matching scores dramatically. On the other hand, too close to 1 scale factor will mean that to cover certain scale range you will need more pyramid levels and so the speed will suffer. 金字塔上采样比率,大于 1。scale factor2 表示经典的金字塔,其中每个下一级的像素比上一级少 4 倍,但如此大的比例因子将显著降低特征匹配分数。另一方面,太接近 1 个比例因子将意味着要覆盖一定的比例范围,你将需要更多的金字塔层次,因此速度将受到影响。
nlevels
The number of pyramid levels. The smallest level will have linear size equal to input_image_linear_size/pow (scaleFactor, nlevels). 金字塔的层数。最小级别的线性大小将等于输入图像的线性大小 /pow(缩放因子,nlevels)。
edgeThreshold
This is size of the border where the features are not detected. It should roughly match the patchSize parameter. 未检测到特征的边缘阈值。它应该与 patchSize 参数大致匹配。
firstLevel
It should be 0 in the current implementation. 当前实现中应为 0。
WTA_K
跟 BRIEF 描述子有关。详情看链接。
scoreType
The default HARRIS_SCORE means that Harris algorithm is used to rank features (the score is written to KeyPoint::score and is used to retain best nfeatures features); FAST_SCORE is alternative value of the parameter that produces slightly less stable keypoints, but it is a little faster to compute. 对所有的特征点进行排名用的方法。默认的 HARRIS_SCORE 表示 HARRIS 算法用于对特征进行排序(该分数写入 KeyPoint::SCORE 并用于保留最佳 nfeatures 特征);FAST_SCORE 是产生稍微不稳定的 keypoints 的参数的可选值,但计算速度稍快。
patchSize
size of the patch used by the oriented BRIEF descriptor. Of course, on smaller pyramid layers the perceived image area covered by a feature will be larger. 定向简短描述符使用的修补程序的大小。当然,在较小的金字塔层上,特征覆盖的感知图像区域将更大。