简体   繁体   中英

Flutter - Google ML kit - Text Recognition - Unable to read MRZ correctly

I am working on a flutter project wherein I need to read RMZ code from passport or ID cards.

I am using google ml kit's text recognition package (google_mlkit_text_recognition) to do this job and I am able to read the RMZ code.

The trouble is, the ml kit seems to gobble up a lot of '<'s from the RMZ code and also (only) sometimes seems to be able to convert the dates from 'YYMMDD' as in the passport RMZ to 'DD/MM/YYYY'.

Due to this inconsistency, I am unable to accurately get the required elements from the RMZ code.

Is there a way to make the ml kit simply read the code and spit it out as it is, in its raw form? Or is there some other way to do this - maybe use another plugin?

In case someone asks for the code. It's a boilerplate, see below:

final textDetector = TextRecognizer();

RecognizedText recognisedText = await textDetector.processImage(inputImage)

It would be helpful if you posted an image and the relative model output, pointing out what the model is failing at. Anyways, it seems weird the model does anything more to the output than giving you what it reads block by block. Having said this, the problem might be that the model is not suited for your specific task, in which case I would go on as follows:

  • Switch from your current model to the other available OCR model on Ml Kit. (eg. : from V2 beta to V1 or viceversa);
  • Try pre-trained models from Tensorlfow Hub;
  • Train a pre-trained model on your specific task;
  • Train a model from scratch on your specific task;
  • Look for any cloud based service which offer a model suited for your task;

This is everything I can come up with given the limited context of your question. If you are willing to expand on your specific problem I might be able to give you more precise info.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM