Image Gradient - Flipping Effect of the Convolution Matrix (Kernel) for Edge Detection Prewitt operator is a common operator to compute image gradient in edge detection, and I knew that to apply this Prewitt operator to an image is just to convolve them together, say, the image is represent as $A$, and as the wikipedia page lays out, the Prewitt operator for *x-gradient is $$G_x=\pmatrix{ -1 &amp; 0 &amp; 1\\\ -1 &amp; 0 &amp; 1\\\ -1 &amp; 0 &amp; 1}$$, for y-gradient is $$G_y=\pmatrix{1 &amp; 1 &amp; 1\\\ 0 &amp; 0 &amp; 0\\\ -1 &amp; -1 &amp; -1}$$
So if I want to compute the x-gradient of image $A$, convolve them like this,$$A_x=A*G_x$$, but here comes my problem. $G_x$ is the kernel, when convolve it with $A$, $G_x$ should be flipped which turn it into this, $$G_x=\pmatrix{1 &amp;0 &amp;-1\\\ 1 &amp;0 &amp;-1\\\ 1 &amp;0 &amp;-1}$$
right? If so, the x-gradient will be something like this, $$\nabla A_x=A(x-1,y)-A(x+1,y)$$
, BUT I think it should be $$\nabla A_x=A(x+1,y) - A(x-1,y)$$.
So I presume that either $G_x$ and $G_y$ should not be flipped when convolve them with $A$, or $G_x$ doesn't look like the above, and it should be this,$$G_x=\pmatrix{1&amp; 0&amp; -1\\\ 1&amp; 0&amp; -1\\\ 1&amp; 0&amp; -1}$$
Anyone can help me with this?
This is a common question and there are a few other answers on this site which may be helpful. What you have noticed is correct. To be clear, convolution is defined by this flipping, it gives the convolution operation some nice maths properties. Non-flipping convolution is called cross-correlation.

For these kernels, the only thing flipping changes is the sign of the result. You can safely use the inverse (flip) of the kernels to get the form you desire.