最近也一直在研究SIFT(尺度不变特征匹配算法),先理解算法的数学原理,然后再一步步分析Rob Hess的程序代码:
/** default number of sampled intervals per octave sub-level 每个尺度空间的采样间隔数*/
//初始值为3
#define SIFT_INTVLS 3
/** default sigma for initial gaussian smoothing 高斯平滑的数目*/
//初始值是1.6
#define SIFT_SIGMA 1.6
/** default threshold on keypoint contrast |D(x)| 阈值点 取值0-1 小于这个即剔除低对比度的伪特征点*/
// 值越大,被剔除的特征点就越多
#define SIFT_CONTR_THR 0.04
//初始值是0.04
/** default threshold on keypoint ratio of principle curvatures */
//主曲率阈值r=10,大于10即去掉边缘响应点
#define SIFT_CURV_THR 10
//初始值是10
/** double image size before pyramid construction? 金字塔构造 */
//在建立尺度空间之前如果原图像放大一倍则取值为1,否则为0
#define SIFT_IMG_DBL 1
/** default width of descriptor histogram array */
//descr_width:计算特征描述符时邻域子块的宽度,
#define SIFT_DESCR_WIDTH 4
//初始值为4
/** default number of bins per histogram in descriptor array */
//计算特征描述符时将特征点邻域进行投影的方向数,默认为8,分别是0,45,90,135 180,225,270,315共8个方向。
#define SIFT_DESCR_HIST_BINS 8
/* assumed gaussian blur for input image 为了产生更多的keypointsLowe在SIFT算法的开始
通过线性插值将原始图像扩大一倍,并且进行了一个σ=0.5的高斯平滑预处理 */
#define SIFT_INIT_SIGMA 0.5
//初始值是0.5
/* width of border in which to ignore keypoints */
//忽略特征点的边界宽度
#define SIFT_IMG_BORDER 5
/* maximum steps of keypoint interpo