Edge Detection & Boundary Tracing: EE 528 Digital Image Processing
Edge Detection & Boundary Tracing: EE 528 Digital Image Processing
References
A.K. Jain, Chapter 9
All details for edge detection given in this chapter
Milan Sonkas class notes on boundary tracing Other webpages listed where needed
Derivative: enhances noise, 2nd derivative: worse Band-pass filtering: some smoothing followed by taking the first or second derivative, e.g. LoG Compass operators
Edges in 1D
Examples
Choose points where LoG magnitude smaller than all its 4 neighbors
Risk of missing some edge points
Applying Canny
Taken from http://www.pages.drexel.edu/~weg22/edge.html
Compass Operators
Compute magnitude of directional derivative in 4 directions 0, 45, 90, 135 degree Maximum of the derivative values gives gradient magnitude Threshold gradient magnitude Alternatively, if only want to look for 45 degree edges: can do that.
Boundary Tracing
Given a segmented image (an image with foreground pixels labeled 1 and background pixels labeled zero), trace either boundary of the foreground
May need to trace inner boundary (outermost pixels of foreground) or outer boundary (innermost pixels of background): bwtraceboundary command in MATLAB Or if foreground, background labeled 1, -1, may use a zero level set searching method to get subpixel coordinates of boundary: contour command in MATLAB
Segmentation: discussed in next handout, simplest way to segment is to threshold intensity values
MATLAB functions
contour: gives you the contour location in sub-pixel coordinates. Need to have object & background labeled as 1, -1 (not 1,0) Inner boundary: gives the locations of the outermost pixels of the object
bwtraceboundary bwboundaries (for multiple objects)
Edge Linking
Goal: take edge map, convert to a linked boundary representation
Can be closed or open boundary
Convert the edge map with gradient magnitude and gradient directions into a weighted graph Use dynamic programming (based on Bellmans optimality principle) to find the shortest path from origin to destination
Much faster than brute force optimization Idea explained in class Also read pages 359-362 of AK Jain.