Hi VTwin
Hmm I suppose one can compute the gradient orientation by computing the delta of the value in x and y.
For example, using the following coefficients for the variation in x:
[-0.5, 0, 0.5,
-1, 0, 1,
-0.5, 0, 0.5]
and similarly for the variation in y:
[-0.5, -1, -0.5,
0, 0, 0,
0.5, 1, 0.5]
applied on the pixel values V and summed up.
You get a vector (x, y) from which you can compute an angle (using ArcTan2).
If you have some code to propose for filters, it is welcome.
Regards