320 likes | 1.31k Views
Edge Detection. Edge Detection Algorithms are used to ‘detect’ edges in a image. Edges are displayed in black (or white if inverted). The non-edges are suppressed. Four algorithms used in class and projects. Laplacian Filter Sobel Filter Prewitt Filter Canny Algorithm. Laplacian Filter.
E N D
Edge Detection • Edge Detection Algorithms are used to ‘detect’ edges in a image. • Edges are displayed in black (or white if inverted). The non-edges are suppressed. • Four algorithms used in class and projects. • Laplacian Filter • Sobel Filter • Prewitt Filter • Canny Algorithm
Laplacian Filter • Measure of the second derivative of an image. • Uses a convolution mask to detect edges. • Disadvantage - Noise • Displayed as edges • Can be minimized by applying a Gaussian filter first. Laplacian Mask
Laplacian Filter (cont) Original Image With Laplacian Filter Applied With Gaussian Filter, then Laplacian Filter Applied
Sobel and Prewitt Filters • Measure of the approximate first derivative of an image. • Use two masks to detect vertical and horizontal edges. • Both masks are used on each pixel. • The Root Sum Squared method (RSS) is applied to each pixel and the result is used for the final image.
Sobel and Prewitt Filters (cont) Sobel Horizontal Mask SobelVerticalMask Prewitt Horizontal Mask Prewitt Vertical Mask
Sobel and Prewitt Filters (cont) Original Image With Sobel Filter Applied With Prewitt Filter Applied
Canny Edge Detection • Effective for filtering out noise • Algorithm • Smooth image using Gaussian Filter • Use Roberts Operator to compute Magnitude and Direction for each pixel. • Apply nonmaxima suppression to mimimize the line thickness of lines. • For each pixel magnitude determine direction using the Mag[] and Dir[] values. • Suppress pixels that are not part of the edge. • Detect the edges • Set High and Low threshold values. • For each pixel => High threshold • Follow the edge while there is an adjacent pixel => Low threshold • Changing the high and Low threshold values increases or decreases the edge detection sensitivity.
Canny Edge Detection (cont) Original Image Using the Canny Algorithm with Threshold Low = 50 and High = 100 Using the Canny Algorithm with Threshold Low = 30 and High = 50