MlKitMrzTextRecognizer

class MlKitMrzTextRecognizer(recognizer: TextRecognizer = TextRecognition.getClient(TextRecognizerOptions.DEFAULT_OPTIONS)) : MrzTextRecognizer<ImageProxy> , AutoCloseable

Recognizes text in CameraX frames with ML Kit Text Recognition (the bundled Latin model).

It reads each ImageProxy and never closes it: the caller closes the frame. Close the recognizer to release the ML Kit client.

A short MRZ-like row next to an exact-width row is read again only after restrictToMrzBand is called; an exact-width second read replaces the first-pass row and marks it with RecognizedLine.secondRead.

Since

0.2.0

Parameters

recognizer

the ML Kit client. The default is the bundled Latin recognizer.

Constructors

Link copied to clipboard
constructor(recognizer: TextRecognizer = TextRecognition.getClient(TextRecognizerOptions.DEFAULT_OPTIONS))

Functions

Link copied to clipboard
open override fun close()

Releases the underlying ML Kit recognizer.

Link copied to clipboard
open suspend override fun recognize(frame: ImageProxy): RecognizedText

Runs ML Kit on frame and returns the recognized lines.

Link copied to clipboard

Limits OCR to a horizontal band in the vertical centre of the upright frame.