添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

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

According to the docs:

The second stage computes first order image gradients. These capture contour, silhouette and some texture information, while providing further resistance to illumination variations. The locally dominant colour channel is used, which provides colour invariance to a large extent. Variant methods may also include second order image derivatives, which act as primitive bar detectors - a useful feature for capturing, e.g. bar like structures in bicycles and limbs in humans.

But the current implementation only allows greyscale images. Either colour images should be allowed or the documentation needs to reflect this

I reckon it would be good to document this and possibly have the function check if you're giving it something that's more than 2D.

If you wanted to apply this to color images, I assume you'd have to apply HOG to each color channel separately for it to work?

I reckon it would be good to document this and possibly have the function check if you're giving it something that's more than 2D.

The documentation indicates that RGB is accepted, but the function does throw a "ValueError: The parameter image must be a 2-dimensional array". As long as the messaging is consistent, either is fine. Although I would prefer that it allow RGB images :)

And I think you're right as to how to implement it. I'm not sure how they are combined. Max() maybe?

@siddarth-jay if we were to magically combine channels, the best method to do that would be using the luminance channel available via skimage.rgb2gray . But this is not the only way to map RGB data to a grayscale image, so imposing it magically is a little bit dangerous. However, I'd be OK with that design, as it remains possible for users who desire more control to simply apply their own mapping first, then pass the grayscale result to hog .

I am trying to implement this feature. Let me know if my understanding is correct.
If a color image is given, then HOG is calculated on individual channels (R, G and B) and the HOG for the channel with highest norm is returned.
I am implementing this feature based on my understanding as stated above. Please correct me if I am wrong.

I implemented the HOG for color images based on the excerpt from the original paper "For colour images, we calculate separate gradients for each colour channel, and take the one with the largest norm
as the pixel’s gradient vector"[Dalal and Triggs] and the CVPR presentation "For color image, pick the color channel with the highest gradient magnitude for each pixel"[Dalal and Triggs].

I implemented the functionality such that gradient magnitude is calculated for each channel and for each pixel, the gradient vector with maximum magnitude is considered. Let me know if I implemented it correctly.

I want to write a test case to test the correctness of color image. Can someone help me regarding this.