Function File: [gradMag, gradDir] = imgradient (img)
Function File: [gradMag, gradDir] = imgradient (img, method)
Function File: [gradMag, gradDir] = imgradient (gx, gy)

Compute the gradient magnitude and direction in degrees for an image.

These are computed from the gx and xy gradients using imgradientxy. The first input img is a gray scale image to compute the edges on. The second input method controls the method used to calculate the gradients. Alternatively the first input gx can be the x gradient and the second input gy can be the y gradient.

The first output gradMag returns the magnitude of the gradient. The second output gradDir returns the direction in degrees.

The method input argument must be a string specifying one of the methods supported by imgradientxy.

See also: edge, imgradientxy.

Package: image