CannyEdgeDetector class

Complete Canny edge detection pipeline implemented in pure Dart.

Inspired by OpenCV's cv::Canny() and Apple Vision's edge detection, this engine performs the full 5-stage Canny algorithm:

  1. Gaussian smoothing (5×5 kernel, σ=1.4)
  2. Sobel gradient magnitude & direction
  3. Non-maximum suppression (edge thinning)
  4. Double-threshold hysteresis (strong/weak edge classification)
  5. Edge tracking by hysteresis (connectivity-based weak edge promotion)

Constructors

CannyEdgeDetector()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

detect(Uint8List gray, int width, int height, {double? highThreshold, double? lowThreshold, bool useAutoThreshold = true}) Uint8List
Runs the full Canny edge detection pipeline on a grayscale image.
detectWithStats(Uint8List gray, int width, int height, {double? highThreshold, double? lowThreshold, bool useAutoThreshold = true}) EdgeDetectionResult
Convenience method: detects edges and returns edge pixel count and density.