4

i am trying to convert a text image into text. I am using pytesser in python for that I have already installed tesseract but on running even the following code:

from pytesser import *
im = Image.open('phototest.tif')
text = image_to_string(im)
print text

I get the following error:

Tesseract Open Source OCR Engine with Leptonica
Please call SetImage before attempting recognition.

and nothing gets printed nothing (no result). Any help on the above problem?

gaborous
  • 15,832
  • 10
  • 83
  • 102
user1615664
  • 591
  • 2
  • 11
  • 24

2 Answers2

4

Try converting your image to another format and see if you have the same issue. I had this same problem using Tesseract form the command line. I had a bmp file, I saved the files in my pre processing to png and tesseract worked fine.

Christopher Hackett
  • 6,042
  • 2
  • 31
  • 41
0

As an alternative, you can use pytesseract, which will automatically convert your image and process it correctly.

gaborous
  • 15,832
  • 10
  • 83
  • 102