detect method

  1. @override
Future<AdHocIdentity?> detect(
  1. OcrImage ocrImage
)

Hands over a OcrImage to the extractor and parser.

If the extractor returns null, the parser is not invoked.

Implementation

@override
Future<AdHocIdentity?> detect(OcrImage ocrImage) async {
  final blocksAndLines = await extractor.extract(ocrImage);
  if (blocksAndLines == null) {
    return null;
  }
  final identity = await parser.parse(blocksAndLines);
  return identity;
}