使用pytesserract的结果不准确

时间:2016-05-30 08:22:37

标签: python image-processing ocr tesseract pytesser

image_1 image_2

问题是结果不准确,结果如下

>>>>>>>>> "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)

0 个答案:

没有答案