Scale-space edge/blur detection

 

 

I have implemented a simple version of the edge detection algorithm described in Local Scale Control for Edge Detection and Blur Estimation by J. Elder and S. Zucker.

 

The basic flow is as follows:

  1. Compute the 1st derivative map of the image at these sigma values [16 8 4 2 1 0.5]
    1. Choose the lowest scale for which the magnitude satisfies the confidence function
    2. Store the direction of the gradient at each pixel
  2. Compute the directed (with angle from step 1b) 2nd derivative map of the image at these sigma values [4 2 1 0.5]
    1. Choose the lowest scale for which the absolute value of the second derivative satisfies the confidence function
  3. Identify edge locations where the directed 2nd derivative is zero between extrema of opposite sign
  4. Identify the blur scale of each edge with the locations of the 2nd derivative extrema
    1. For the purposes of reconstruction, the intensities of the grayscale image are stored at the extrema of the 2nd derivative around an edge

 

The initial results are shown in the Results section.

 

The main problem with accurate edge detection has been the proper sampling of the 2nd derivative of the image at various sigma values.

 

These are the analytical expression for the Gaussian and the three derivative basis functions

 

 

 

 

Three discrete 2nd derivate basis masks are convolved with the input image.  The directional 2nd derivative (in the theta direction) then takes the form of this equation

 

 

Considering the 1-D case, the following is the 2nd derivative plot for sigma = 1.

 

Improper sampling of this function will introduce inaccuracies in the 2nd derivative result.  The biggest problem is a DC bias which can disturb a zero crossing algorithm for edge detection.  My current solution is to interpolate the image and colvolve it with a finely sampled 2nd derivative Gaussian mask, and then decimate the image.  The results improved, but the computation times have increased.

 

I have found another approach to the 2nd derivative Gaussian mask problem that is much faster than the previous method.  This method is to compute the 2nd derivative Gaussian on a larger grid, and then use spline interpolation to subsample back to the original size.  The results look pretty good.  I will not look into this issue further.

 

Elder-Zucker edge detection results

 

The following results demonstrate my implementation of the Elder edge detector for an ideal vertical edge, whose blur scale varies along the vertical axis.

The isolevels show that the zero of the 2nd derivative does indeed exist along the edge.  However, the 2nd derivative has a negative DC bias, which can be better seen in the horizontal profile below.  This issue is addressed in the Implementation section.