Search code examples
androidnumbersocrtess-two

How can I be output Android only numbers in OCR?


I am developing an Android OCR.

Using tess-two in the Android made ​​the OCR.

I have downloaded the 'traineddata' file. And it has succeeded in output in English . But I want to output a number.

In the Internet gave me inform the sentence 'tesseract image.tif outputbase nobatch digits' and it has advised me to insert the generated files.

But I did not understand what I'm saying . Please tell me the easiest way.


Solution

  • You will need to set tessedit_char_whitelist variable, as follows:

    baseApi.SetVariable("tessedit_char_whitelist", "0123456789");
    

    See Android OCR detecting digits only using popular tessercat fork tess-two or extracting numbers from Bitmap in android using tess-two library.