Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HOG Features incorrectly estimated #9

Open
yerzhik opened this issue May 21, 2019 · 1 comment
Open

HOG Features incorrectly estimated #9

yerzhik opened this issue May 21, 2019 · 1 comment

Comments

@yerzhik
Copy link

yerzhik commented May 21, 2019

Is there a logic behind the features being estimated? It says gethogfeature function but it does unnecessary threshodling. Then resized to 32x32 original image is traversed:

for (i = 0; i < image.rows; i+=step) { p = image.ptr<uchar> (i); p_dst = featuretemp.ptr<float>(i); p_dst[0] = 0; for(j = 0; j < image.cols; j+=step) { p_dst[0] += p[j]; } }

By looking at this code I can say this is just a sum of elements of each row.

Then at traindata function:
feature = feature.reshape(1,1);
Which is converting to single channel single row. By looking at how the feature was created, it is a vector of the form (x, 0, 0 ... 0) of size 32.

Am I correct? It's not the HOG feature. What is it and what's the point in saving vector with only one value and the rest being zeroes?

@Gavinic
Copy link
Owner

Gavinic commented Apr 22, 2020

Thanks for your interest in our project. As you mentioned above, the implementation of HOG features is incorrect.
In feature.cpp Mat featuretempMat::zeros(image.rows,image.cols,CV_8UC1);
should be corrected to Mat featuretempMat::zeros(image.rows,1,CV_8UC1);.

Note:
Actually, the "gethogfeature" function is used to achieve the function of row and column projection of binary images. we have modified the function name to "getprofeature".
We will also update the HOG feature extraction function and Harr-related operators as soon as possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants