0

This image_1 image_2

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)
rpy
  • 3,953
  • 2
  • 20
  • 31
Okta
  • 3
  • 5
  • You're running into a problem that has existed for OCR engines for decades: similar characters are easily confused. How many samples did you train for each character? – Rethunk May 30 '16 at 09:10
  • i was try to resize the aspect ratio from that image, and have better result, but still, the problem is same as before, some time the result become unaccurate again – Okta May 31 '16 at 04:11

0 Answers0