pythonubuntu-12.04pytesser

Installing pytesser on Ubuntu 14.04


I want to use pytesser OCR and I would like to make same changes in the system so that I can import it as a module from anywhere in the system. I tried using advice given on (Installing pytesser) but It's not working for me.


Solution

  • you can use

    pip install pytesseract
    

    You should use PIL to open an image and feed pytesseract. PIL, is short for Python Image Library. Just a image library.

    pytesseract is a wrapper of tesseract.

    from PIL import Image
    import pytesseract 
    im = Image.open('/home/xxxxxxx/Downloads/img.jpg')
    text = pytesseract.image_to_string(im)
    print (text)