Functions > Image Processing > Edge Finders > Example: Convolution Edge Finders
  
Example: Convolution Edge Finders
Use the freichen, sobel, prewitt, and roberts functions to detect edges in an image by convolving various kernels in sequence over the matrix. Edge detection is used to enhance image readability for certain types of features that depend on boundaries.
For information on using this example, refer to About Image Processing Examples.
freichen
This function convolves an image matrix with the following two kernels:
Click to copy this expression
Click to copy this expression
1. Read in an image.
Click to copy this expression
2. Apply the freichen function to the image.
Click to copy this expression
Click to copy this expression
3. Compare the two images.
(brain.bmp)
(brain_fre.bmp)
The freichen edge detector is useful for images in which there are a variety of intensity levels defining the various edges in the picture. These kernels show a greater sensitivity to the relative pixel values, independent of their brightness.
sobel
This function convolves an image matrix with the following two kernels:
Click to copy this expression
Click to copy this expression
Apply the sobel function to the input image.
Click to copy this expression
Click to copy this expression
(brain_sob.bmp)
The sobel kernel provides a uniform edge detection, although it gives increased weight to the orthogonal pixels over the diagonal pixels.
prewitt
This function convolves an image matrix with the following two kernels:
Click to copy this expression
Click to copy this expression
Apply the prewitt function to the input image.
Click to copy this expression
Click to copy this expression
(brain_pre.bmp)
The prewitt kernel considers the orthogonal and diagonal pixel differentials equally.
roberts
This function convolves an image matrix with the following two kernels:
Click to copy this expression
Click to copy this expression
Apply the roberts function to the input image.
Click to copy this expression
Click to copy this expression
(brain_rob.bmp)
The roberts kernel considers only the diagonal pixel differentials, which emphasizes corners more clearly but can blur together small horizontal or vertical features.