尝试从屏幕快照图像中提取文本,它适用于最大图像,但是对于某些提取某些不同语言的文本
from PIL import Image
import pytesseract
output=pytesseract.image_to_string(PIL.Image.open(r'C:\Users\ab2\Desktop\Use_case\default.png').convert("RGB"), lang='eng')
预期:
Your iphone could not be activated because the activation server is temporarily unavailable. Try connecting your iPhone to iTunes to activate it, or try again in a couple of minutes.
实际:
w
( am cu-nu Not Activate Whune
Your wihrme um‘ um no ac|vvaled
hm, mu m» ,mmmon «ewev vs‘
1emmr,m\\,r mwmxame Try
conn£chr\u JULJ vP\7:me fin mums to
acma(r3r\ m u», again m a Couple‘ 0!
mmu(e~.
H (his woman pnwsv; Lomact
Ar3p\e Supp'.rV.'.1lunp\e cum:<upDur\
H, Aunm