代码:
from PIL import Image
import pytesseract
file_path = "你的图片位置"
img = Image.Open(file_path)
print(pytesseract.image_to_string(img))
把图片里面的内容转换为字符串
代码:
import pytesseract
from PIL import Image
image = Image.open(jpg)
pytesseract.image_to_string(image)