Skip to content
This repository has been archived by the owner on Mar 17, 2022. It is now read-only.

How I can init the tesseract to work only with digits? #253

Closed
ibrahimAlii opened this issue Sep 29, 2018 · 5 comments
Closed

How I can init the tesseract to work only with digits? #253

ibrahimAlii opened this issue Sep 29, 2018 · 5 comments

Comments

@ibrahimAlii
Copy link

ibrahimAlii commented Sep 29, 2018

Summary:
Well in my app I just want to initiate the tesseract to work only with digits, specifically arabic digits, Is there any way to avoid recognize characters and just recognize digits instead ?

I've use setVaraible but it's the same

baseAPI.init(dataPath, "ara");
        baseAPI.setVariable(TessBaseAPI.VAR_CHAR_WHITELIST, variable);
        baseAPI.setVariable(TessBaseAPI.VAR_CHAR_BLACKLIST, "ا ب ت ث ج ح خ د ذ ر ز س ش ص ض ط ظ ع غ ف ق ك ل م ن ه و ي ء هو !?@#$%&* >> << ()<>_-+=/:;'\\\"");
        baseAPI.setVariable("classify_bln_numeric_mode", "1");

I'm still getting characters in result.

@rmtheis
Copy link
Owner

rmtheis commented Sep 29, 2018

Hmm, what's the value of variable in your example?

@ibrahimAlii
Copy link
Author

@rmtheis It's all digits in arabic "٠١٢٣٤٥٦٧٨٩١٠"

@rmtheis
Copy link
Owner

rmtheis commented Sep 30, 2018

Hmm, I would try setting just the whitelist value by itself, without setting the blacklist value or the other value.

If that gives you the same result maybe try asking on the Tesseract forum.

@rmtheis rmtheis closed this as completed Sep 30, 2018
@ibrahimAlii
Copy link
Author

@rmtheis Thanks, I still getting the same result, and I didn't get any useful response om Tesseract forum.

Any Idea?

@rmtheis
Copy link
Owner

rmtheis commented Sep 30, 2018

  1. Try different OcrEngineMode values.
  2. Retrain or edit the training data. I don't know enough about this to be able to help.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants