OCR——tesseract-ocr

2020-10-04  本文已影响0人  Aedda

python库:pyocr、pytesseract

from pyocr import pyocr
import pytesseract

tools = pyocr.get_available_tools()[:]
print(tools[0].image_to_string(Image.open('D:\\123.png'),lang='eng'))

text = pytesseract.image_to_string(Image.open(img,'r'),lang='eng')
tessdata_dir_config = '--tessdata-dir "C:\\Program Files (x86)\\Tesseract-OCR\\tessdata"'
num = pytesseract.image_to_string(im,config=tessdata_dir_config)

英文:eng、中文:chi_sim

tesseract-ocr:http://jaist.dl.sourceforge.net/project/tesseract-ocr-alt/tesseract-ocr-setup-3.02.02.exe
tesseract-ocr训练集地址:https://codeload.github.com/tesseract-ocr/tessdata/zip/master
https://github.com/tesseract-ocr/tessdata
https://github.com/tesseract-ocr/tessdata/find/master

上一篇 下一篇

猜你喜欢

热点阅读