Ask Your Question

Revision history [back]

  • Is my method of calculating the average gradient direction correct? I am aware of a different method (see *) but unsure which is better/more accurate.

I do think that the idea is correct. However your star has no link. Might want to take a look at histogram of oriented gradients, which does exactly what you want, but which is quite a commonly used technique to do so.

  • Is my normalisation of a degrees value to a hue value correct? Ie, normalising a value that can be 0-359 to a value between 0-179 by simply dividing by 2?

There is no relation between degrees and hue values, but your encoding seems correct, however be aware that you loose precision this way.

  • Most importantly am I accurately calculating and representing the average gradient direction over a series of cells?

I do think so. However what I still do not get is why would one want to calculate gradients of the HSV image rather than the RGB image? In my understanding this transformation does not locate gradients better.