问题是结果不准确,结果应该如下
>>>>>>>>> "Prv:2.700 0p:2,70o Lo1:31.5&5 (mg: —5 Hi:2,71D val: 8.55"
有人知道如何优化图像以达到最佳效果吗?
from PIL import Image
import pytesseract
size = 279,18
im = Image.open("box6_line1.png")
box6_resized_line1 = im.resize(size, Image.ANTIALIAS)
box6_resized_line1.save("box6_resized_line1", "PNG")
box6_rs_line1 = pytesseract.image_to_string(box6_resized_line1, config='-psm 6')
print (box6_rs_line1)
size = 279,18
im = Image.open("box6_line2.png")
box6_resized_line2 = im.resize(size, Image.ANTIALIAS)
box6_resized_line2.save("box6_resized_line2", "PNG")
box6_rs_line2 = pytesseract.image_to_string(box6_resized_line2, config='-psm 6')
print(box6_rs_line2)