Gradient direction not consistent (X vs Y) for an image Gradient direction not consistent (X vs Y) for an image numpy numpy

Gradient direction not consistent (X vs Y) for an image


In order to correct for the y-axis being reversed, the quiver plot needs a negative in front of the Iy term.plt.quiver(X,Y, Ix2,-Iy2, color='r')