How can I obtain average direction of the pattern shown in the figure below. It is the direction of the red arrow relative to the yellow (horizontal) line. Any ideas for an approach? I couldn't figure out a way to approach. This is a spatio-temporal image created from a video. Thank you.
Solution is using structure tensors
from skimage.feature import structure_tensor Axx, Axy, Ayy = structure_tensor(gray_image, sigma=1) tan2t = (2*Axy)/(Axx-Ayy) t=np.arctan(tan2t)/2 data = t.ravel() # find the mode of `data` array (can use histogram). it is the direction.