MrzDecodeConsensus

class MrzDecodeConsensus(val threshold: Int = DEFAULT_THRESHOLD)

Accepts a reading only after the same parsed document decodes on threshold frames.

It selects among readings the camera produced and never builds one. Agreement is on the whole MrzDocument, not per character. The frames need not be consecutive: the count is the total since the last reset, and other frames between them do not reset it. A ParseResult.PartialSuccess still counts. A misread that repeats on every frame also reaches agreement. The class is not thread-safe: drive one instance from one collector per scan session, and call reset when a new session begins.

Since

0.5.0

Throws

if threshold is less than 1.

Constructors

Link copied to clipboard
constructor(threshold: Int = DEFAULT_THRESHOLD)

Types

Link copied to clipboard
object Companion

Constants for MrzDecodeConsensus.

Properties

Link copied to clipboard

how many frames in total must decode the same document. At least 1; 1 accepts the first decode. The default is DEFAULT_THRESHOLD.

Functions

Link copied to clipboard

Records one decoded frame and reports whether a reading has been agreed on.

Link copied to clipboard
fun reset()

Clears all votes and the confirmed reading.