Search code examples
ocrtesseracttess4j

Unexpected result of Tesseract while using 'digits' flag


My image is target image and when I do

tesseract myimage.png result digits

I am getting result as 80 1 3047490 though I am expecting to get only digit, that is 4749 in my image. What I am doing wrong ? My Tesseract version is 3.03.

PS: I also tried with no success tesseract myimage.png result nobatch digits


Solution

  • That is the expected result: the output is forced to be all digits. In this case, I would use Regex to extract the digits from the mixed output, or substring if you know the position of the numbers in the string.