2D image edges

Feature Description

This operator uses the classic Canny edge detection algorithm to extract edge features from the input image. It employs multi-stage processing to find locations of intense grayscale changes in the image, thereby effectively detecting edges while suppressing noise.

Use Cases

  • Feature Extraction: Extracting object contours as key features before tasks like shape recognition, object detection, or image matching.

  • Image Segmentation Aid: Edge information can serve as input or reference for image segmentation algorithms.

  • Visual Inspection: Detecting defects such as scratches and cracks on product surfaces, which usually manifest as distinct edges.

Inputs and Outputs

Input Item

Image: The image for edge detection, can be grayscale or color.

Output Item

Result image: The edge image obtained after Canny algorithm processing. This is a binarized grayscale image where detected edge pixels are typically white, and background pixels are black.

Parameter Descriptions

Low Threshold

Parameter Description

Low threshold; if the pixel intensity change is below this value, it is definitely not an edge.

Parameter Tuning Guide

Lowering the threshold: May allow less obvious, weaker edges to be retained, making edge lines more complete and coherent, but may also misclassify some "noise" that is not originally an edge as an edge.

Raising the threshold: Screens edges more strictly, only parts with strong changes will be retained, and weak edges will be ignored.

Parameter Range

[0, 1000], Default value: 1

High Threshold

Parameter Description

High threshold; if the pixel intensity change is above this value, it will definitely be judged as an edge point.

Parameter Tuning Guide

Increasing the threshold: Will cause only very obvious edges to be detected, and the number of edges in the result may decrease; Decreasing the threshold: Will detect more weaker edges, the number of edges may increase, but may also include more false edges caused by noise or texture.

Parameter Range

[0, 1000], Default value: 100

Edge Detection Window Size

Parameter Description

The aperture size of the Sobel operator used when calculating the image gradient, affecting the smoothness of the gradient calculation and sensitivity to noise.

Parameter Tuning Guide

  • Using a smaller value (e.g., 3) is more sensitive to noise and can detect finer edge details;

  • Using a larger value (e.g., 5 or 7) will apply more smoothing to the image first, making it less sensitive to noise, but may lose some details or make edges slightly thicker and less precisely located.

Parameter Range

[3,5,7] , Default value: 3

Precision mode

Parameter Description

Switches between fast mode (L1 norm) or precise mode (L2 norm) for calculating gradient magnitude. Fast mode is used by default.

Parameter Tuning Guide

  • Off (default): Uses L1 norm to calculate gradient magnitude, theoretically slightly faster calculation.

  • On: Uses L2 norm to calculate gradient magnitude, theoretically representing gradient strength more accurately, may detect relatively fewer edges.