AutoCaptureStateMachine class

Real-time automatic document capture state machine inspired by Scanbot SDK.

v3.0 upgrade: Multi-signal fusion scoring combining:

  • Quad corner drift stability (Euclidean sliding window)
  • Blur score (Laplacian variance threshold)
  • Document coverage ratio (quad area / frame area)
  • Glare detection (hot pixel fraction)
  • Low-light tolerance with adjusted thresholds
  • Countdown timer with progress animation support
  • Quality feedback messages for user guidance

Constructors

AutoCaptureStateMachine({int requiredStableFrames = 5, double maxCornerDriftDistance = 15.0, double minBlurScore = 75.0, double minCoverageRatio = 0.15, double maxGlareRatio = 0.05})

Properties

coverageRatio double
Current document coverage ratio (quad area / frame area).
no setter
glareRatio double
Current glare ratio (hot pixels / total sampled).
no setter
hashCode int
The hash code for this object.
no setterinherited
maxCornerDriftDistance double
final
maxGlareRatio double
final
minBlurScore double
final
minCoverageRatio double
final
progress double
Progress fraction towards auto capture (0.0 to 1.0).
no setter
qualityFeedback String
Human-readable quality feedback message for UI display.
no setter
requiredStableFrames int
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stabilityScore double
Recent stability score (1.0 = perfectly steady, 0.0 = moving/unstable).
no setter
stabilizingStartTime DateTime?
Time when stabilizing phase started (for countdown UI).
no setter
stableFrameCount int
Consecutive stable frame count.
no setter
state AutoCaptureState
Current state of the auto capture machine.
no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
processFrame({required DocumentCorners? quad, required double blurScore, required bool isLowLight, double? coverageRatio, double? glareRatio}) bool
Processes an incoming camera frame with multi-signal fusion.
reset() → void
Resets state machine back to idle.
toString() String
A string representation of this object.
inherited

Operators

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