2D Image Edges

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 with sharp changes in grayscale intensity within the image, thereby effectively detecting edges while suppressing noise.

Overview

Extracts edge contours from 2D images as a grayscale image using Canny edge detection.

Scenarios

  • Feature Extraction: Extracting the contour edges of objects as key features before performing 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 appear as distinct edges.

Inputs and Outputs

Inputs

Image: The image requiring edge detection. Supports grayscale or color images (color images are automatically converted to grayscale for processing).

Outputs

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

Parameters

Low Threshold

Description

The low threshold. Pixels whose gradient magnitude falls below this value will not be considered edge candidates.

Tuning Instructions

Decreasing the threshold: may allow weaker, less prominent edges to be retained, resulting in more complete and continuous edge contours; however, it may also cause some non-edge noise to be incorrectly classified as edges.

Increasing the threshold: applies stricter edge filtering, retaining only regions with strong intensity changes while discarding weak edges.

Parameter Range

[0, 1000], default value: 1

Parameter Range

Values/Range: [0.0, 1000.0]

Default: 1

High Threshold

Description

The high threshold. Pixels whose intensity change exceeds this value will be unconditionally identified as edge points.

Tuning Instructions

Increasing the threshold: only very prominent edges will be detected, which may reduce the number of edges in the result.

Decreasing the threshold: more weak edges will be detected, which may increase the number of edges but may also introduce more false edges caused by noise or texture.

Parameter Range

[0, 1000], default value: 100

Parameter Range

Values/Range: [0.0, 1000.0]

Default: 100

Edge Detection Window Size

Description

The aperture size of the Sobel operator used when computing image gradients. This affects the smoothness of gradient computation and sensitivity to noise.

Tuning Instructions

  • 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) applies more smoothing to the image prior to gradient computation, making it less sensitive to noise, but may cause some fine details to be lost or edges to appear slightly thicker and less precisely localized.

Parameter Range

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

Parameter Range

Values/Range:

  • 3

  • 5

  • 7

Default: 3

Precision Mode

Description

Toggles between Fast mode (L1 norm) and Precise mode (L2 norm) for gradient magnitude computation. Fast mode is used by default.

Tuning Instructions

Disabled (default): Uses the L1 norm to compute gradient magnitude. Theoretically slightly faster in computation speed.

Enabled: Uses the L2 norm to compute gradient magnitude. Theoretically provides a more accurate representation of gradient strength, but may detect relatively fewer edges.

Parameter Range

Default: False