我遇到了读取图像中电话号码的问题。我尝试使用tesseract在图像中检测到它们,但是有时它给我一个错误的答案。例如,数字是8 995 005-81-86,但是tesseract给我输出了8 995 0005-81-86。我该如何解决?也许二值化?
代码是基本的
import pytesseract as pt
from PIL import Image
img = Image.open('1.png')
number = pt.image_to_string(img)
print(number)