How to get visualization of HOGfeatures

1 次查看(过去 30 天)
I used following code to extract HOG feature from an image in gui
if true
[HogFeature, visualization]= extractHOGFeatures(filepath,1);
axes(handles.axes3);
plot(visualization);
end
where filepath is my image, but when I start that part of code I get error "Error using extractHOGFeatures Expected POINTS to be of size Mx2 when it is actually size 1x1." What´s wrong?

回答(1 个)

Gayathri
Gayathri 2025-1-10
The error you are facing is because the second argument to the "extractHOGFeatures" function must be a center location point of a square neighbourhood. The function extracts descriptors from the neighborhoods that are fully contained within the image boundary.
Please refer to the below code on how to extract the HOG features.
img = imread('cameraman.tif');
[featureVector,hogVisualization] = extractHOGFeatures(img);
If you want to use extract the HOG features around a certain point, please refer to the below code.
I2 = imread('gantrycrane.png');
corners = detectFASTFeatures(im2gray(I2));
strongest = selectStrongest(corners,3);
[hog2,validPoints,ptVis] = extractHOGFeatures(I2,strongest);
For more information on "extractHOGFeatures", please refer to the below documentation link. It also contains different examples which you can refer regarding different input arguments.
Hope you find this information helpful!

类别

Help CenterFile Exchange 中查找有关 Feature Detection and Extraction 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by