【发布时间】:2017-10-02 01:37:08
【问题描述】:
我已经下载了三个不同的 HoG 代码。 使用 64x128 的图像
1)使用matlab函数:extractHOGFeatures,
[hog, vis] = extractHOGFeatures(img,'CellSize',[8 8]);
hog的大小是3780。
如何计算:
HOG 特征长度 N 取决于图像大小和函数参数值。
N = prod([BlocksPerImage, BlockSize, NumBins])
BlocksPerImage = floor((size(I)./CellSize – BlockSize)./(BlockSize – BlockOverlap) + 1)
2) 第二个 HOG 函数是从here 下载的。 使用相同的图像
H = hog( double(rgb2gray(img)), 8, 9 );
% I - [mxn] color or grayscale input image (must have type double)
% sBin - [8] spatial bin size
% oBin - [9] number of orientation bins
H的大小是3024
如何计算:
H - [m/sBin-2 n/sBin-2 oBin*4] computed hog features
3) 来自 vl_feat 的 HoG 代码。
cellSize = 8;
hog = vl_hog(im2single(rgb2gray(img)), cellSize, 'verbose','variant', 'dalaltriggs') ;
vl_hog: image: [64 x 128 x 1]
vl_hog: descriptor: [8 x 16 x 36]
vl_hog: number of orientations: 9
vl_hog: bilinear orientation assignments: no
vl_hog: variant: DalalTriggs
vl_hog: input type: Image
输出为 4608。
哪个是正确的?
【问题讨论】:
标签: matlab computer-vision feature-extraction