How to get visualization of HOGfeatures
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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?
0 Kommentare
Antworten (1)
Gayathri
am 10 Jan. 2025 um 4:32
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!
0 Kommentare
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!