美文网首页
OCR——tesseract-ocr

OCR——tesseract-ocr

作者: Aedda | 来源:发表于2020-10-04 03:21 被阅读0次

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

相关文章

网友评论

      本文标题:OCR——tesseract-ocr

      本文链接:https://www.haomeiwen.com/subject/btwguktx.html