我对此知之甚少 pytesseract ,但这可能会让你开始:
pytesseract
#!/usr/bin/env python3 import numpy as np from PIL import ImageGrab import pytesseract from PIL import Image, ImageEnhance, ImageFilter from textblob import TextBlob # Grab some screen screen = ImageGrab.grab(bbox=(0,0,800,640)) # Make greyscale w = screen.convert('L') # Save so we can see what we grabbed w.save('grabbed.png') text = pytesseract.image_to_string(w) correctedText = TextBlob(text).correct() print(correctedText)
从这个抓斗:
我有:
@ Terminal Shell Edit View Window Help The writing is on the wall