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.
This function convolves an image matrix with the following two kernels:
1. Read in an image.
2. Apply the freichen function to the image.
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:
Apply the sobel function to the input image.
(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:
Apply the prewitt function to the input image.
(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:
Apply the roberts function to the input image.
(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.