转自:http://www.cnblogs.com/cxscode/p/8316815.html
运行下面代码
1
2
3
4
5
6
from PIL import Image
from
PIL
import
Image
import pytesseract
pytesseract
img = Image.open('aaa.png')
img
=
Image.
open
(
'aaa.png'
)
text = pytesseract.image_to_string(img,lang='chi_sim')
text
pytesseract.image_to_string(img,lang
'chi_sim'
print (text)
print
(text)
以前主要是识别中文字符,不知怎么设参数:
pytesseract.image_to_string(img,lang='chi_sim')