MrzScanner class final
Reads the zone in the frames of a camera until enough of them agree.
A frame alone may misread a character no check digit covers, or two that cancel out in the check digit: the scanner returns a zone once agreement frames read it the same, each frame alone or the frames so far together. The frames together also read a zone no single frame reads whole, a reflection moving over the document.
final scanner = MrzScanner();
await for (final frame in camera) {
final result = scanner.add(frame);
if (result != null) return result.accessKey;
}
Constructors
- MrzScanner({int agreement = 2, int memory = 8, MrzRecognizer recognizer = const MrzRecognizer()})
-
A scanner that wants
agreementframes to agree, keeping the lastmemoryframes that found a zone.
Properties
- agreement → int
-
How many frames must read the same zone.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- lastReading → MrzReading?
-
The zone in the last frame that found one, read or not: to show where
it is, or how far the reading got.
no setter
- memory → int
-
How many of the last frames that found a zone count.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
add(
MrzImage frame) → MrzScanResult? -
Reads
frame; returns the zone once agreement frames agree, null until then. -
addReading(
MrzReading? reading) → MrzScanResult? -
Counts a
readingalready made, as by an MrzRecognizer in another isolate; null for a frame without a zone. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
reset(
) → void - Forgets the frames so far: for the next document.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited