EdgeDetect
✖
EdgeDetect
Details and Options

- Edges of an image are a set of points between image regions and are typically computed by linking high-gradient pixels. In practice, an edge can have an arbitrary shape.
- EdgeDetect uses gradient methods to find edges and works with arbitrary 2D and 3D images.
- EdgeDetect[image] is equivalent to EdgeDetect[image,2].
- The following range specifications r can be used:
-
r radius r in every dimension (default r=2) {rrow,rcol} in 2D, range rrow in height, rcol in width {rslice,rrow,rcol} in 3D, range rslice in height, rrow in depth, and rcol in width - EdgeDetect[image,r,t] uses hysteresis thresholding with a global threshold t. For additional forms of the threshold parameter, see the reference page for MorphologicalBinarize.
- The following options can be specified:
-
Method Automatic edge detection method Padding "Fixed" padding method - Possible settings for Method include:
-
"Canny" first-order directional Gaussian derivatives (default) "ShenCastan" first-order derivatives of exponentials "Sobel" binomial generalization of Sobel masks - By default, all straight and curved edges are returned. Selection of edges based on their straightness can be done by setting Method->{"method","StraightEdges"->s}. The default behavior is equivalent to "StraightEdges"->0. A setting "StraightEdges"->1 selects only the longest and strongest lines.
- "StraightEdges" is ignored when used with Image3D objects.
Examples
open allclose allBasic Examples (1)Summary of the most common use cases
Scope (4)Survey of the scope of standard use cases

https://wolfram.com/xid/0b0kzi65ody-8t432p

Specify the scale of edges to detect:

https://wolfram.com/xid/0b0kzi65ody-mzkcjn

Specify larger scale to detect coarse features:

https://wolfram.com/xid/0b0kzi65ody-i2omgu

Edge selection using an explicit global threshold:

https://wolfram.com/xid/0b0kzi65ody-nx1v0m


https://wolfram.com/xid/0b0kzi65ody-4pr3v8

https://wolfram.com/xid/0b0kzi65ody-9d455m

Options (2)Common values & functionality for each option
Method (2)

https://wolfram.com/xid/0b0kzi65ody-xz6bqi

By default, all edges are returned, regardless of their straightness:

https://wolfram.com/xid/0b0kzi65ody-jdilx8

Filter detected edges with their straightness:

https://wolfram.com/xid/0b0kzi65ody-gxza5v

Properties & Relations (1)Properties of the function, and connections to other functions
EdgeDetect might return edges that are thicker than one pixel:

https://wolfram.com/xid/0b0kzi65ody-6egyrr

Use Thinning to get single-pixel-wide edges:

https://wolfram.com/xid/0b0kzi65ody-ypvsif

Wolfram Research (2010), EdgeDetect, Wolfram Language function, https://reference.wolfram.com/language/ref/EdgeDetect.html (updated 2014).
Text
Wolfram Research (2010), EdgeDetect, Wolfram Language function, https://reference.wolfram.com/language/ref/EdgeDetect.html (updated 2014).
Wolfram Research (2010), EdgeDetect, Wolfram Language function, https://reference.wolfram.com/language/ref/EdgeDetect.html (updated 2014).
CMS
Wolfram Language. 2010. "EdgeDetect." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2014. https://reference.wolfram.com/language/ref/EdgeDetect.html.
Wolfram Language. 2010. "EdgeDetect." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2014. https://reference.wolfram.com/language/ref/EdgeDetect.html.
APA
Wolfram Language. (2010). EdgeDetect. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/EdgeDetect.html
Wolfram Language. (2010). EdgeDetect. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/EdgeDetect.html
BibTeX
@misc{reference.wolfram_2025_edgedetect, author="Wolfram Research", title="{EdgeDetect}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/EdgeDetect.html}", note=[Accessed: 19-June-2025
]}
BibLaTeX
@online{reference.wolfram_2025_edgedetect, organization={Wolfram Research}, title={EdgeDetect}, year={2014}, url={https://reference.wolfram.com/language/ref/EdgeDetect.html}, note=[Accessed: 19-June-2025
]}