企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
简介 ``` 一个将图象翻译成文字的OCR库 ``` 安装 ``` windows https://code.google.com/p/tesseract-ocr/downloads/list ``` ``` Linux apt-get install tesseract-ocr ``` ``` Mac brew install tesseract ``` 在终端中使用 ``` tesseract test.png text ``` python中使用 ``` pip3 install pytesseract ``` ``` import pytesseract from PIL import Image # 打开图片 img = Image.open("test.png") # 调用tesseract识别图片 data = pytesseract.image_to_string(img) # 输出结果 print(data) ```