Sunday, 30 August 2020

PyTesseract not seeing some single-digit numbers in table

I have this image of a table

image_of_table

I'm trying to parse it using PyTesseract. I've gotten pretty darn close using this code:

from PIL import Image, ImageOps
import pytesseract

og_image = Image.open('og_image.png')
grayscale = ImageOps.grayscale(og_image)
inverted = ImageOps.invert(grayscale.convert('RGB'))
print(pytesseract.image_to_string(inverted))

This seems to be very accurate, except the single-digit numbers in the second-to-last column are blank. Do I need to do something different to pick up on those numbers?



from PyTesseract not seeing some single-digit numbers in table

No comments:

Post a Comment