DocumentDetectorEngine class

Advanced document edge and quadrilateral detection engine inspired by OpenCV & Scanbot SDK.

v3.0 upgrade: Now uses the full Canny → Contour → Quad pipeline:

  1. Canny edge detection for robust edge extraction
  2. Connected component contour tracing
  3. Douglas-Peucker polygon simplification
  4. Convex hull → best quadrilateral selection
  5. Multi-candidate ranking with scoring
  6. Sobel gradient fallback for simple scenes

Constructors

DocumentDetectorEngine()

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

computeCoverageRatio(DocumentCorners corners, int imageWidth, int imageHeight) double
Computes document coverage ratio (quad area / frame area).
detectGlare(Uint8List gray, int width, int height, {int brightnessThreshold = 245}) double
Detects specular glare/highlights in a grayscale image.
detectQuadrilateral(Uint8List gray, int width, int height, {double minAreaRatio = 0.15, int candidateCount = 5}) DocumentCorners
Detects document quad corners from grayscale byte buffer.
detectSkewAngle(DocumentCorners corners) double
Calculates skew angle of detected document quad in degrees.
sortCorners(List<Offset> points) DocumentCorners
Sorts 4 arbitrary points into Top-Left, Top-Right, Bottom-Right, Bottom-Left order.