Image derivatives can be computed by using small convolution filters of size 2 × 2 or 3 × 3, such as the Laplacian, Sobel, Roberts and Prewitt operators.
[1] However, a larger mask will generally give a better approximation of the derivative and examples of such filters are Gaussian derivatives[2] and Gabor filters.
[4] The use of Gabor filters[5] in image processing has been motivated by some of its similarities to the perception in the human visual system.
This operator is separable and can be decomposed as the products of an interpolation and a differentiation kernel, so that,
, for an example can be written as Farid and Simoncelli[7][8] propose to use a pair of kernels, one for interpolation and another for differentiation (compare to Sobel above).
These kernels, of fixed sizes 5 x 5 and 7 x 7, are optimized so that the Fourier transform approximates their correct derivative relationship.
In Matlab code the so called 5-tap filter is And the 7-tap filter is As an example the first order derivatives can be computed in the following using Matlab in order to perform the convolution It is noted that Farid and Simoncelli have derived first derivative coefficients which are more accurate compared to the ones provided above.
Derivative filters based on arbitrary cubic splines was presented by Hast.
[9] He showed how both first and second order derivatives can be computed more correctly using cubic or trigonometric splines.
However, any cubic filter is fitted over 4 sample points, giving a centre that falls between pixels.
The idea is to first filter by interpolation so that the interpolated value between pixels are obtained, whereafter the procedure is repeated using a derivative filters, where the centre value now falls on pixel centres.
Hast proves that such a surface can be performed as a separable convolution where
, such as The convolution kernels can now be set to The first order derivatives at the central pixel are hence computed as and Likewise, with the second order derivative kernels are and The cubic spline filter is evaluated in its centre
The example in below in Matlab use the Catmull-Rom spline to compute the derivatives Steerable filters can be used for computing derivatives[10] Moreover, Savitzky and Golay[11] propose a least-squares polynomial smoothing approach, which could be used for computing derivatives and Luo et al[12] discuss this approach in further detail.