Digital Gradient

For discrete digital images, the derivative in gradient operation

$\displaystyle D_x[f(x)]=\frac{d}{dx}f(x)=\lim_{\Delta x \rightarrow 0}
\frac{f(x+\Delta x)-f(x)}{\Delta x}$ (20)

becomes the difference

$\displaystyle D_n[f[n]]=f[n+1]-f[n],\;\;\;\;$or$\displaystyle \;\;\;\;
\frac{f[n+1]-f[n-1]}{2}$ (21)

Two steps for finding discrete gradient of a digital image:

The differences in two directions $g_m$ and $g_n$ can be obtained by convolution with the following kernels:

Note Sobel and Prewitt operators first find the averages of one direction and then find the difference of these averages in the another direction.