新聞中心
說(shuō)明

為本溪等地區(qū)用戶提供了全套網(wǎng)頁(yè)設(shè)計(jì)制作服務(wù),及本溪網(wǎng)站建設(shè)行業(yè)解決方案。主營(yíng)業(yè)務(wù)為網(wǎng)站設(shè)計(jì)、成都做網(wǎng)站、本溪網(wǎng)站設(shè)計(jì),以傳統(tǒng)方式定制建設(shè)網(wǎng)站,并提供域名空間備案等一條龍服務(wù),秉承以專業(yè)、用心的態(tài)度為用戶提供真誠(chéng)的服務(wù)。我們深信只要達(dá)到每一位用戶的要求,就會(huì)得到認(rèn)可,從而選擇與我們長(zhǎng)期合作。這樣,我們也可以走得更遠(yuǎn)!
1、pytesseract需要與安裝在本地的tesseract-ocr.exe文件一起使用。
2、需要注意的是,安裝時(shí)必須選擇中文包,默認(rèn)只支持英文識(shí)別。
安裝命令:
pip install pytesseract
實(shí)例
import pytesseract from PIL import Image text = pytesseract.image_to_string(Image.open(r"d:\Desktop\39DEE621-40EA-4ad1-90CC-79EB51D39347.png")) print(text)
識(shí)別結(jié)果輸出:
Using Tesseract OCR with python
# import the necessary packages
from PIL import Image
import pytesseract
import ergperse
import cv2
import os
# construct the argument parse and parse the arguments
ap = argparse.ArgunentParser()
ap.add_argument("-i", "--image", required-True,
help="path to input image to be OCR'd")
ap.add_argument("-p", "--preprocess", typesstr, default="thresh",
helpe"type of preprocessing to be done")
args = vars (ap.parse_args())以上就是python pytesseract庫(kù)的介紹,希望對(duì)大家有所幫助。更多Python學(xué)習(xí)指路:創(chuàng)新互聯(lián)python教程
本文教程操作環(huán)境:windows7系統(tǒng)、Python 3.9.1,DELL G3電腦。
當(dāng)前文章:創(chuàng)新互聯(lián)Python教程:pythonpytesseract庫(kù)是什么
本文來(lái)源:http://m.fisionsoft.com.cn/article/dhjppdg.html


咨詢
建站咨詢
