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