如何可视化 fhog(不是 HOG)
How to visualize fhog (not HOG)
我的 MATLAB 代码使用 fhog
(而不是 Hog)来提取特征。但是,我想可视化图像块上使用的 HOG 特征。如果我们使用 MATLAB 中可用的 HOG
,我知道会使用 extractHOGFeatures
或 VLFeat。但是我如何可视化 fhog
?
由于 Piotr 的图像和视频工具箱(其中有 fhog
)现在在 MATLAB 中被广泛使用,我经常需要它,如果有人能告诉我如何可视化 fhog
提取的内容,那就太好了功能。
fhog 的代码可以在 here:
找到
代码片段如下:
if features.hog,
%HOG features, from Piotr's Toolbox
x = double(fhog(single(im) / 255, cell_size, features.hog_orientations));
x(:,:,end) = []; %remove all-zeros channel ("truncation feature")
end
if features.gray,
%gray-level (scalar feature)
x = double(im) / 255;
x = x - mean(x(:));
end
编辑:hogDraw
exists 但写入以下内容:
V = hogDraw(features, [cell_size], [fhog]);
给我一个错误:
Not enough input arguments.
Error in fhog (line 70)
[M,O]=gradientMex('gradientMag',I,0,1);
我能够完成这项工作。我忽略了这是一件愚蠢的事情。
For V = hogDraw(features, [cell_size], [fhog]);
写:
V = hogDraw(x, [cell_size], 1);
其中 1 表示 hog 设置为真。
要绘图,请执行 plot(V)
我的 MATLAB 代码使用 fhog
(而不是 Hog)来提取特征。但是,我想可视化图像块上使用的 HOG 特征。如果我们使用 MATLAB 中可用的 HOG
,我知道会使用 extractHOGFeatures
或 VLFeat。但是我如何可视化 fhog
?
由于 Piotr 的图像和视频工具箱(其中有 fhog
)现在在 MATLAB 中被广泛使用,我经常需要它,如果有人能告诉我如何可视化 fhog
提取的内容,那就太好了功能。
fhog 的代码可以在 here:
找到代码片段如下:
if features.hog,
%HOG features, from Piotr's Toolbox
x = double(fhog(single(im) / 255, cell_size, features.hog_orientations));
x(:,:,end) = []; %remove all-zeros channel ("truncation feature")
end
if features.gray,
%gray-level (scalar feature)
x = double(im) / 255;
x = x - mean(x(:));
end
编辑:hogDraw
exists 但写入以下内容:
V = hogDraw(features, [cell_size], [fhog]);
给我一个错误:
Not enough input arguments.
Error in fhog (line 70)
[M,O]=gradientMex('gradientMag',I,0,1);
我能够完成这项工作。我忽略了这是一件愚蠢的事情。
For V = hogDraw(features, [cell_size], [fhog]);
写:
V = hogDraw(x, [cell_size], 1);
其中 1 表示 hog 设置为真。
要绘图,请执行 plot(V)