khjde1207 / tesseract_ocr

Tesseract OCR for flutter
BSD 3-Clause "New" or "Revised" License
62 stars 31 forks source link

How to use the Tesseract OCR model on the device directory path? #39

Open siri-sinthawat opened 9 months ago

siri-sinthawat commented 9 months ago

Hi, thanks for the awesome Flutter plugin. I have some questions, In the example of applications, I saw some examples using the Tesseract OCR model by adding it to the assets folder and using the .json file as well. Is it possible to use the Tesseract OCR model on the device directory path without creating json files?

String eng_path = "../eng.traineddata"; String jpn_path = "../jpn.traineddata";

String text = await FlutterTesseractOcr.extractText(path, language:[ jpn_path, eng_path ], args: { "preserve_interword_spaces": "1", });

khjde1207 commented 9 months ago

You must put it in the getTessdataPath path. I also imported the project using a fork and only had it built, so I don't know much about its internal structure.

siri-sinthawat commented 9 months ago

Thank you for responding so quickly. I see what you mean.