How to get visualization of HOGfeatures

조회 수: 1 (최근 30일)
Vojtech Raska
Vojtech Raska 2018년 3월 24일
답변: Gayathri 2025년 1월 10일
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