Detect edges🔗

Detects prominent edges in images. This tool uses the Canny filtering technique to detect edges:

  1. The input image is smoothed with a Gaussian filter, if smoothness is non-zero.

  2. Sobel gradient filters are used to estimate local gradient.

  3. The gradient image is processed to contain only local maxima.

  4. Final edges are obtained with hysteresis thresholding: all pixels with a gradient magnitude of at least lowThreshold are regarded as edges if they are connected to at least one pixel whose gradient magnitude is at least highThreshold.


  • image: Input image

  • smoothness: The standard deviation of the of the Gaussian smoothing filter. Bigger value means better tolerance against noise, less sensitivity and worse localization. The Gaussian filter is cut at approximately 1.5 times the standard deviation of the Gaussian function. If smoothness is zero, no smoothing filter will be applied.

  • lowThreshold: The minimum gradient that can still be recarded as an edge, if a connected edge pixel exceeds highThreshold. If this value is zero, 0.4 * highThreshold will be used.

  • highThreshold: The gradient value that at least one pixel in a connected edge must exceed. If this value is zero, two times the standard deviation of the gradient magnitude plus the mean gradient magnitude will be used.


  • image: An 8-bit gray-level image in which detected edges are marked with value 255.