ContourDetector class
Contour detection and polygon simplification engine implemented in pure Dart.
Inspired by OpenCV's findContours() + approxPolyDP() and Scanbot SDK's
document quad detection pipeline:
- Connected component labeling (Union-Find)
- Contour boundary tracing (Moore-Neighbor / Suzuki-Abe inspired)
- Douglas-Peucker polygon simplification
- Convex hull computation (Graham scan)
- Best quadrilateral selection
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
-
convexHull(
List< Offset> points) → List<Offset> - Computes the convex hull of a set of points using the Graham scan algorithm.
-
detectDocumentQuad(
Uint8List gray, int width, int height, {int candidateCount = 5, double minAreaRatio = 0.15}) → DocumentCorners - Detects the best document quadrilateral from a grayscale image.
-
findBestQuadrilateral(
List< Offset> contour, int imageWidth, int imageHeight, {double minAreaRatio = 0.1, double maxAreaRatio = 0.95}) → DocumentCorners? - Finds the best quadrilateral approximation from a contour.
-
findContours(
Uint8List edgeMap, int width, int height, {int minContourLength = 20}) → List< List< Offset> > - Detects all contours in a binary edge map.
-
simplifyPolygon(
List< Offset> contour, double epsilon) → List<Offset> - Simplifies a contour using the Douglas-Peucker algorithm.