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:
- Canny edge detection for robust edge extraction
- Connected component contour tracing
- Douglas-Peucker polygon simplification
- Convex hull → best quadrilateral selection
- Multi-candidate ranking with scoring
- Sobel gradient fallback for simple scenes
Constructors
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.