rmtheis / android-ocr

Experimental optical character recognition app
Apache License 2.0
2.22k stars 894 forks source link

Recognize only numbers #29

Closed ajinkyapote1 closed 9 years ago

ajinkyapote1 commented 9 years ago

Hi,

How can i train the tess-two to recgnize only numbers?

Thanks in advance.

rmtheis commented 9 years ago

You don't need to re-train. Set the whitelist to "0123456789".

ajinkyapote1 commented 9 years ago

Thanks,

I set the both the "VAR_CHAR_WHITELIST" and "VAR_CHAR_BLACKLIST" to "0123456789" in TessBaseAPI class, but it is still scanning the letters. Please Help me.

rmtheis commented 9 years ago

Don't set a value for the blacklist.

ajinkyapote1 commented 9 years ago

Even if i am setting only "VAR_CHAR_WHITELIST" to "0123456789", it is scanning the numbers. Please help me to scan numbers only.

rmtheis commented 9 years ago

Take a look at how it's being set in this project. [1] Note that the setVariable() call comes before setImage() is called. If you still have questions, ask a question on StackOverflow and include the code you're using.

[1] https://github.com/rmtheis/android-ocr/blob/927c2e9b2adcf8515515fd4a54ebd23123ea664b/android/src/edu/sfsu/cs/orange/ocr/CaptureActivity.java#L396