Canny edge detection in 2-D and 3-D

version (18.2 KB) by David Young
A Canny edge detector for two-dimensional image and three-dimensional volume data.


Updated 5 Mar 2014

View License

This is an implementation of the Canny edge detector, extended to operate on 3-D as well as 2-D data. The function features:
* 3-D capability, using the natural extension of the standard 2-D algorithm.

* A sub-pixel location estimation option.

* Symmetric differences for gradient estimation, so edge positions do not suffer from a systematic bias, with the option to use nearest-neighbour differences.

* Anisotropic smoothing if required, for example for volumes where the resolution differs between axes.

* A flexible range of thresholding options, including simple defaults and precise distribution-based selection. Different images can be treated consistently using absolute thresholds.

* Options for fine-tuning non-maximum suppression.

* Efficient use of the separability of the Gaussian for filtering.

* Independent functions for the different stages of the processing pipeline. This simplifies development of new algorithms; some of the functions (e.g. smoothing) are also useful in other contexts.

All the functions in the submission should be downloaded and placed on the MATLAB path in order to use the CANNY function.

Cite As

David Young (2022). Canny edge detection in 2-D and 3-D (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2013b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!