The gradient operator is sensitive to local gray level changes and is therefore
a convenient tool to detect edges. If the magnitude
of the gradient
image is larger than a threshold value, the pixel
can be considered as
on an edge. Moreover, the orientation of the edge can be obtained from the
direction
of the gradient vector. Some simple examples of 1D
case is shown below:
Edge detection by gradient operators (Roberts, Sobel and Prewitt):
However, when these gradient operators are used as edge detectors, their performances are very poor. Basically, they can not distinguish edges from textures and/or noise. The Prewitt gradient filter (3 by 3 and 5 by 5) is used to obtain the edges in the following image containing fuzzy edges:
The gradient image
obtained by applying the
gradient operator to the original image
can be used in various ways
to enhance the details of the image. For example, gradient image can be used
to high-boost to emphasize the details in the image while still keeping the
rest as background:
Alternatively, we can emphasize the details while suppressing the back ground: