# edge

Find edges in 2-D grayscale image

## Syntax

## Description

specifies the orientation of edges to detect. The Sobel and Prewitt methods can
detect edges in the vertical direction, horizontal direction, or both. The
Roberts method can detect edges at angles of 45° from horizontal, 135° from
horizontal, or both. This syntax is valid only when `BW`

= edge(`I`

,`method`

,`threshold`

,`direction`

)`method`

is `"Sobel"`

, `"Prewitt"`

, or
`"Roberts"`

.

`[`

also returns the directional gradients. For the Sobel and Prewitt methods,
`BW`

,`threshOut`

,`Gx`

,`Gy`

]
= edge(___)`Gx`

and `Gy`

correspond to the
horizontal and vertical gradients, respectively. For the Roberts methods,
`Gx`

and `Gy`

correspond to the
gradient at angles of 135° and 45° from horizontal, respectively. This syntax is
valid only when `method`

is `"Sobel"`

,
`"Prewitt"`

, or `"Roberts"`

.

## Examples

## Input Arguments

## Output Arguments

## References

[1] Canny, John, "A Computational Approach to Edge Detection,"
*IEEE Transactions on Pattern Analysis and Machine
Intelligence,* Vol. PAMI-8, No. 6, 1986, pp. 679-698.

[2] Lim, Jae S., *Two-Dimensional
Signal and Image Processing*, Englewood Cliffs, NJ, Prentice
Hall, 1990, pp. 478-488.

[3] Parker, James R., *Algorithms
for Image Processing and Computer Vision,* New York, John
Wiley & Sons, Inc., 1997, pp. 23-29.

## Extended Capabilities

## Version History

**Introduced before R2006a**

## See Also

`edge3`

| `fspecial`

| `imgradient`

| `imgradientxy`