在Ubuntu 14.04上安装pytesser

时间:2016-06-04 13:38:34

标签: python ubuntu-12.04 pytesser

我想使用pytesser OCR,我想在系统中进行相同的更改,以便我可以从系统中的任何位置将其作为模块导入。 我尝试使用(Installing pytesser)给出的建议,但它不适合我。

1 个答案:

答案 0 :(得分:4)

你可以使用

pip install pytesseract

您应该使用PIL打开图像并输入pytesseract。 PIL是Python Image Library的缩写。只是一个图像库。

pytesseract是tesseract的包装。

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