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提取的特征和opencv自带的Hog特征提取,得到的特征不一样啊? #1

Open
fengxin619 opened this issue Dec 20, 2017 · 2 comments

Comments

@fengxin619
Copy link

rt,请问问题在哪里呢?

@PENGZhaoqing
Copy link
Owner

导致不一样的地方多了,首先提取边缘的因子cv2.Sobel有很多种,然后是cell中统计直方图里,有bin_size和cell_size参数不同,再就是多个cell合成一个block中涉及到归一化问题,这些都会导致与opencv里实现的不一样,opencv的实现可能使用矩阵运算实现的,这个效率比较高,你看我到处都是forx循环,这个你代码了解一下原理就行了,主要还是用opencv的

@csukuangfj
Copy link

gradient magnitude 的计算有问题

gradient_magnitude = cv2.addWeighted(gradient_values_x, 0.5, gradient_values_y, 0.5, 0)

cv2.cartToPolar() 应该更好一点.

总之, 代码对理解 HOG 有帮助, 谢谢.

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

3 participants