230 likes | 240 Views
This paper explores the Canny edge detection algorithm and investigates methods to optimize its performance by minimizing false positives and false negatives, improving edge localization, and deriving an optimal detector. The steps involved include CANNY_ENHANCER, NONMAX_SUPPRESSION, and HYSTERESIS_THRESHOLDING. The tradeoff between localization and detection is discussed, along with the usage of optimal 1-D step edge detectors. The paper also addresses the issues with gradient magnitude and presents solutions for detecting thin edges. Edge relaxation parallel is utilized to adjust edge values based on neighboring edges. Experimental results demonstrate the effectiveness of the proposed methods.
E N D
3-D Computational VisionCSc 83020 Canny Edge Detection
Canny Edge Detection • Can we derive an optimal detector? • Good Detection: minimize false positives and false negatives. • Good Localization: close as possible to the true edges. • Single Response Constraint: one edge should be detected for each true edge
Canny Edge Detection • 3 STEPS: • CANNY_ENHANCER • NONMAX_SUPPRESION • HYSTERESIS_THRESH
Localization-Detection Tradeoff • Filter’s spatial scale • Location & • Detection criteria. • Optimal 1-D step edge detector! • Approximated by the 1st derivative of the Gaussian.
From Jana Kosecka Gaussian and its derivative
From Jana Kosecka Vertical edges First derivative
From Jana Kosecka Gradient Magnitude Horizontal edges • Image Gradient
From Jana Kosecka Gradient Orientation
Optimal 1-D step edge detectors… Pixel (i,j) Keep the one that gives you maximum response. Expensive.
Solution… y x Pixel (i,j) Compute derivatives with respect to x & y directions. Compute edge normal.
CANNY_ENHANCER • Compute Ix and Iy the gradient of the image using a derivative of Gaussian filter. • Compute the edge strength from the magnitude of the gradient: Es • Compute the orientation of the edge from arctan(Iy / Ix ): Eo [Canny ’86] n
Problem with detector gradient magnitude (Es) original image • Compute image derivatives • if gradient magnitude > and the value is a local max. along gradient • direction – pixel is an edge candidate • how to detect one pixel thin edges ?
Th Problem with detector • The magnitude image Es has the magnitudes of the smoothed gradient. • Sigma determines the amount of smoothing. • Es has large values at edges: • Find local maxima
Nonmaximum supression • The inputs are Es& Eo Magnitude and orientation • Consider 4 directions D={0,45,90,135} wrt x • For each pixel (i,j) do: • Find the direction dD s.t. d Eo(i,j) (normal to the edge) • If {Es(i,j) is smaller than at least one of its neigh. along d} • IN(i,j)=0 • Otherwise, IN(i,j)= Es(i,j) • The output is the thinned edge image IN x x
Thresholding • Edges are found by thresholding the output of NONMAX_SUPRESSION • If the threshold is too high: • Very few (none) edges • High MISDETECTIONS, many gaps • If the threshold is too low: • Too many (all pixels) edges • High FALSE POSITIVES, many extra edges
Edge Detection With Hysteresis Low threshold High threshold Hysteresis (high and low threshold)
Weak edges Strong edge Edge Tracking Hysteresis thresholding [Canny ’86] edges Strong edges reinforce weak edges. Weak edge removed We call a pixel an edge if it is strong. We also call a pixel an edge if it is weak but is connected to an edge. A pixel is connected to an edge if it is in a direction perpendicular to the edge normal
Es(i,j)>L Es(i,j)<H Es(i,j)> H Es(i,j)<L Es(i,j)>L Hysteresis Thresholding Strong edges reinforce adjacent weak edges
HYSTERESIS_THRESH • Input: In, Eo, high threshold, low threshold. • Output: Lists of connected edges (contours).
Edge Relaxation Parallel – iterative method to adjust edge values on the basis of neighboring edges Crack edges:
Edge Relaxation Parallel – iterative method to adjust edge values on the basis of neighboring edges Notation: Crack edges: Edge to be updated Edge No edge Vertex types: (0) (1) (2) (3)
Action table for edge type: Decrease Increase Unchanged 0-0 1-1 0-1 0-2 1-2 2-2 0-3 1-3 2-3 3-3 Edge Relaxation Parallel – iterative method to adjust edge values on the basis of neighboring edges Notation: Crack edges: Edge to be updated Edge No edge Vertex types: (0) (1) (2) (3)
Action table for edge type: Decrease Increase Unchanged 0-0 1-1 0-1 0-2 1-2 2-2 0-3 1-3 2-3 3-3 Edge Relaxation Parallel – iterative method to adjust edge values on the basis of neighboring edges Notation: Crack edges: Algorithm: Edge to be updated Edge • 0. Compute initial confidence C0(e) of • each edge e • C0(e) = • k = 1 • Compute edge type for all e • Modify Ck(e) based on Ck-1(e) and • edge type. • If all Ck(e) have converged to 1 or 0 • else go to step 1 No edge Vertex types: (0) (1) (2) (3)