next up previous contents
Next: Horizontal Up: 12.3.5 Useful Convolution Filters Previous: Laplacian Filter

Sobel Filter

The Sobel filter consists of two kernels which detect horizontal and vertical changes in an image. If both are applied to an image, the results can by used to compute the magnitude and direction of the edges in the image. If the application of the Sobel kernels results in two images which are stored in the arrays Gh[0..(height-1][0..(width-1)] and Gv[0..(height-1)][0..(width-1)], the magnitude of the edge passing through the pixel x, y is given by:
displaymath8135
(we are justified in using the magnitude representation since the values represent the magnitude of orthogonal vectors). The direction can also be derived from Gh and Gv:
displaymath8136
The 3x3 Sobel kernels are:




David Blythe
Thu Jul 17 21:24:28 PDT 1997