Ce Liu, Jenny Yuen, Antonio Torralba,JosefSivic, andWilliam T. Freeman 版权所有。
修改的部分函数与变量的名字,使其好懂了一些。不过这个算法由于没有salient keypoint detection和rotation normalization,所以对尺度以及旋转这些affine transform没有移不变的性质。
function [ SIFTFeatureVector, locationX, locationY ] = DenseSIFT( image, nPatchSize, nGridSpacing )image = double( image );
image = mean( image, 3 );
image = image / max( image( : ) );% parameters
nAngleNums = 8;
nBinNums = 4;
nSampleNums = nBinNums * nBinNums;
alpha = 9; %% parameter for attenuation of angles (must be odd)if nargin < 5sigmaGuassian = 1;
endangleStep = 2 * pi / nAngleNums;
angles = 0 : angleStep : 2 * pi;
angles( nAngleNums + 1 ) = [ ]; % bin centers[ nRow nCol ] = size( image );[ gau