The problem is that the result is not accurate ,the result should be as follows
>>>>>>>>> "Prv:2.700 0p:2,70o Lo1:31.5&5 (mg: —5 Hi:2,71D val: 8.55"
Does anybody know how to optimize the image to achieve the best result ?
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)