You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
hog: gradient calculations are different from OpenCV #2809
Then in this case, the OpenCV implementation looks correct.
I'm not saying that np.gradient is wrong. I'm saying that using it make the gradient deviate from OpenCV and the HoG paper.
Yes, my bad. It was in line with the paper earlier - cdff825#diff-d8734512e866681c570f51f5d398f882L104. I'd revert the corresponding changes (this would also imply regenerating reference HOG matrices in skimage/data), and update the comparison (#2040 (comment)).
Parameterization is also a solution, although I think that the API is quite populated already.
Activity
stefanv commentedon Sep 25, 2017
I'm not sure I understand: the numpy gradient computation seems correct?
rdabane commentedon Sep 25, 2017
Assuming that intention is to reproduce functionality from original HoG paper(http://lear.inrialpes.fr/people/triggs/pubs/Dalal-cvpr05.pdf) which suggests following : "Simple 1-D [−1, 0, 1] masks at σ=0 work best."
Then in this case, the OpenCV implementation looks correct.
I'm not saying that np.gradient is wrong. I'm saying that using it make the gradient deviate from OpenCV and the HoG paper.
stefanv commentedon Sep 25, 2017
I see, thanks for the clarification. OK, so should be fairly easy to fix. And we'll have to compare with OpenCV output to make sure things look right.
/cc @ivoflipse @Korijn @TimSC
rdabane commentedon Sep 25, 2017
Ok. Thanks! Please let me know if I can be of any help.
soupault commentedon Sep 26, 2017
@rdabane you might be interested in the comparison in #2040, especially, this comment #2040 (comment) .
stefanv commentedon Sep 26, 2017
@soupault I think you are, perhaps, in the best position to make a call on this issue.
Korijn commentedon Sep 26, 2017
Parameterize a choice between the two modes perhaps?
soupault commentedon Sep 29, 2017
Yes, my bad. It was in line with the paper earlier - cdff825#diff-d8734512e866681c570f51f5d398f882L104. I'd revert the corresponding changes (this would also imply regenerating reference HOG matrices in
skimage/data), and update the comparison (#2040 (comment)).Parameterization is also a solution, although I think that the API is quite populated already.
stefanv commentedon Sep 30, 2017
This feels more like a bug than a bad API---in which case, I think we should fix it.