實(shí)例如下所示:
成都創(chuàng)新互聯(lián)自成立以來,一直致力于為企業(yè)提供從網(wǎng)站策劃、網(wǎng)站設(shè)計(jì)、網(wǎng)站建設(shè)、成都網(wǎng)站制作、電子商務(wù)、網(wǎng)站推廣、網(wǎng)站優(yōu)化到為企業(yè)提供個性化軟件開發(fā)等基于互聯(lián)網(wǎng)的全面整合營銷服務(wù)。公司擁有豐富的網(wǎng)站建設(shè)和互聯(lián)網(wǎng)應(yīng)用系統(tǒng)開發(fā)管理經(jīng)驗(yàn)、成熟的應(yīng)用系統(tǒng)解決方案、優(yōu)秀的網(wǎng)站開發(fā)工程師團(tuán)隊(duì)及專業(yè)的網(wǎng)站設(shè)計(jì)師團(tuán)隊(duì)。import os os.chdir("G:\Python1\Lib\site-packages\pytesser") from pytesser import * from pytesseract import image_to_string from PIL import Image from PIL import ImageGrab #截圖,獲取需要識別的區(qū)域 x = 345 y = 281 m = 462 n = 327 k = 54 for i in range(2,6): box = (x,y,m,n) img = ImageGrab.grab(box) img.save("G:\Python1\Lib\site-packages\pytesser\kangkang"+str(i)+".png") #img.show() y+=54 n+=54 #截圖完畢后,開始圖像識別 names=["kangkang2.png","kangkang3.png","kangkang4.png","kangkang5.png"] for name in names: im = Image.open(name) text = image_to_string(im) print(name+":"+text)