skimage 0.17.2

NotesParametersReturnsBackRef
canny(image, sigma=1.0, low_threshold=None, high_threshold=None, mask=None, use_quantiles=False)

Notes

The steps of the algorithm are as follows:

Parameters

image : 2D array

Grayscale input image to detect edges on; can be of any dtype.

sigma : float, optional

Standard deviation of the Gaussian filter.

low_threshold : float, optional

Lower bound for hysteresis thresholding (linking edges). If None, low_threshold is set to 10% of dtype's max.

high_threshold : float, optional

Upper bound for hysteresis thresholding (linking edges). If None, high_threshold is set to 20% of dtype's max.

mask : array, dtype=bool, optional

Mask to limit the application of Canny to a certain area.

use_quantiles : bool, optional

If True then treat low_threshold and high_threshold as quantiles of the edge magnitude image, rather than absolute edge magnitude values. If True then the thresholds must be in the range [0, 1].

Returns

output : 2D array (image)

The binary edge map.

Edge filter an image using the Canny algorithm.

See Also

skimage.sobel

Examples

This example is valid syntax, but we were not able to check execution
>>> from skimage import feature
... # Generate noisy image of a square
... im = np.zeros((256, 256))
... im[64:-64, 64:-64] = 1
... im += 0.2 * np.random.rand(*im.shape)
... # First trial with the Canny filter, with the default smoothing
... edges1 = feature.canny(im)
... # Increase the smoothing for better results
... edges2 = feature.canny(im, sigma=3)
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

skimage.feature._canny.canny

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /skimage/feature/_canny.py#53
type: <class 'function'>
Commit: