Determining the pattern direction of a bitmap image
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.


another question and answers from other community