Function File: [bw, thresh] = edge (im, method, …)

Find edges using various methods.

The image im must be 2 dimensional and grayscale. The method must be a string with the string name. The other input arguments are dependent on method.

bw is a binary image with the identified edges. thresh is the threshold value used to identify those edges. Note that thresh is used on a filtered image and not directly on im.

See also: fspecial.

Function File: edge (im, "Canny")
Function File: edge (im, "Canny", thresh)
Function File: edge (im, "Canny", thresh, sigma)

Find edges using the Canny method.

thresh is two element vector for the hysteresis thresholding. The lower and higher threshold values are the first and second elements respectively. If it is a scalar value, the lower value is set to 0.4 * thresh.

sigma is the standard deviation to be used on the Gaussian filter that is used to smooth the input image prior to estimating gradients. Defaults to sqrt (2).

Function File: edge (im, "Kirsch")
Function File: edge (im, "Kirsch", thresh)
Function File: edge (im, "Kirsch", thresh, direction)
Function File: edge (im, "Kirsch", thresh, direction, thinning)

Find edges using the Kirsch approximation to the derivatives.

Edge points are defined as points where the length of the gradient exceeds a threshold thresh.

thresh is the threshold used and defaults to twice the square root of the mean of the gradient squared of im.

direction is the direction of which the gradient is approximated and can be "vertical", "horizontal", or "both" (default).

thinning can be the string "thinning" (default) or "nothinning". This controls if a simple thinning procedure is applied to the edge image such that edge points also need to have a larger gradient than their neighbours. The resulting "thinned" edges are only one pixel wide.

Function File: edge (im, "Lindeberg")
Function File: edge (im, "Lindeberg", sigma)

Find edges using the the differential geometric single-scale edge detector by Tony Lindeberg.

sigma is the scale (spread of Gaussian filter) at which the edges are computed. Defaults to 2.

This method does not use a threshold value and therefore does not return one.

Function File: edge (im, "LoG")
Function File: edge (im, "LoG", thresh, sigma)

Find edges by convolving with the Laplacian of Gaussian (LoG) filter, and finding zero crossings.

Only zero crossings where the filter response is larger than thresh are retained. thresh is automatically computed as 0.75*M, where M is the mean of absolute value of LoG filter response.

sigma sets the spread of the LoG filter. Default to 2.

Function File: edge (im, "Prewitt", …)

Find edges using the Prewitt approximation to the derivatives.

This method is the same as Kirsch except a different approximation gradient is used.

Function File: edge (im, "Roberts")
Function File: edge (im, "Roberts", thresh)
Function File: edge (im, "Roberts", thresh, thinning)

Find edges using the Roberts approximation to the derivatives.

This method is similar to Kirsch except a different approximation gradient is used, and the default thresh is multiplied by sqrt(1.5). In addition, there it does not accept the direction argument.

Function File: edge (im, "Sobel", …)

Find edges using the Sobel approximation to the derivatives.

This method is the same as Kirsch except a different approximation gradient is used.

Function File: edge (im, "zerocross", thresh, filter)

Find edges by convolving with a user-supplied filter and finding zero crossings.

Function File: edge (im, "Andy", thresh, params)

Find edges by the original (Andy Adlers) edge algorithm. The steps are

  1. Do a Sobel edge detection and to generate an image at a high and low threshold.
  2. Edge extend all edges in the LT image by several pixels, in the vertical, horizontal, and 45 degree directions. Combine these into edge extended (EE) image.
  3. Dilate the EE image by 1 step.
  4. Select all EE features that are connected to features in the HT image.

The parameters for the method is given in a vector:

params(1)==0 or 4 or 8

Perform x connected dilatation (step 3).

params(2)

Dilatation coefficient (threshold) in step 3.

params(3)

Length of edge extention convolution (step 2).

params(4)

Coefficient of extention convolution in step 2.

defaults = [8, 1, 3, 3]

Package: image