🔷2D Image Edge

Functional Description

This operator uses the classic Canny edge detection algorithm to extract edge features from input images. Through multi-stage processing, it finds locations where grayscale intensity changes dramatically in the image, effectively detecting edges while suppressing noise.

Usage Scenarios

  • Feature Extraction: Extract object contour edges as key features before performing shape recognition, object detection, or image matching tasks.

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

  • Visual Inspection: Detect defects such as scratches and cracks on product surfaces, which typically appear as obvious edges.

Input Output

Input

Image: Image for edge detection, supports grayscale or color images (color images will be automatically converted to grayscale for processing)

Canny input

Output

Result Image: 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.

Canny output

Parameter Description

Low Threshold

Parameter Description

Low threshold. If a pixel’s gradient magnitude is below this value, it will not be considered as an edge candidate point.

Parameter Adjustment

Lowering threshold: May allow weaker, less obvious edges to be retained, making edge lines more complete and coherent, but may also mistakenly identify some "noise" that isn’t originally edges as edges.

Raising threshold: More strictly filters edges, only retaining parts with strong changes, weak edges will be ignored.

Parameter Range

[0, 1000], Default value: 1

Canny output

Canny 1

Canny 2

Canny 3

Low Threshold=1

Low Threshold=50

Low Threshold=100

Low Threshold=200

High Threshold

Parameter Description

High threshold. If a pixel’s change intensity is above this value, it will definitely be identified as an edge point.

Parameter Adjustment

Raising threshold: Will make only very obvious edges detected, the number of edges in results may decrease;

Lowering 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

Canny 5

Canny output

Canny 4

High Threshold=50

High Threshold=100

High Threshold=200

Edge Detection Window Size

Parameter Description

Aperture size of the Sobel operator used when calculating image gradients, affecting the smoothness degree of gradient calculation and sensitivity to noise.

Parameter Adjustment

  • Using smaller values (like 3) is more sensitive to noise and can detect finer edge details;

  • Using larger values (like 5 or 7) will apply more smoothing to the image first, less sensitive to noise, but may lose some details or make edges slightly thicker and less precise in positioning.

Parameter Range

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

Canny output

Canny 6

Canny 7

Edge Detection Window Size=3

Edge Detection Window Size=5

Edge Detection Window Size=7

Precision Mode

Parameter Description

Switch between fast mode (L1 norm) or precision mode (L2 norm) to calculate gradient magnitude, using fast mode by default.

Parameter Adjustment

Off (Default): Uses L1 norm to calculate gradient magnitude, theoretically slightly faster in computation.

Canny output

On: Uses L2 norm to calculate gradient magnitude, theoretically can more accurately represent gradient intensity, may detect relatively fewer edges.

Canny 8