Wrong statement

Hello everyone,

In the OpenCV for Robotics tutorial, in the section where HOG is explained, I came across the following statement:

“The distance to 40 and 60 is 5 and 15, respectively; therefore, the ratios will be 5/20 and 15/20, so the magnitude assigned will be Gm·1/4 for 40 and Gm·3/4 for 60.”

According to my understanding (and a quick check I did with ChatGPT), this seems incorrect and should actually be reversed.

For context, the example is about a gradient orientation of 45 degrees. As far as I know, when using bilinear interpolation between orientation bins, the closer bin should receive the larger weight, which is also what intuitively makes sense. However, in the text above, the farther bin (60°) is assigned the larger weight, which appears to contradict that principle. Does anyone agree or I miss something? The tutorial description is not clear

Hi,

What unit is it exactly? Let us have a look at what you say because, at least from your message, it makes sense

It is section 3.4 where the angle 45 (in the example it is -45 degree thus) is 5 units away from 40 degree bin. So naturally, a bigger weight needs to be assigned to it. On the other hand the distance between 45 to 60 is 15, so the associated weight should be lesser. But the coarse assign the bigger wight to the 60 degree (Gm.3/4).

Completely right! We will make the corrections today in the notebook. Thanks for pointing that out.