#๐Ÿ”’ Text from image to Excel

34 messages ยท Page 1 of 1 (latest)

steep jayBOT
#

@novel anvil

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

coral solar
#

kinda looks like a web interface, what game is this? do you have the font in use?

novel anvil
#

And it is more or less a tab in-game where you can see the performance of each individual alliance member... There's no way to download the whole sheet from the game and the way our stat-keeper has done it till now is manually writing it down for each member... Which is... Well... Really time consuming and stupid

coral solar
#

pytesseract.image_to_string('image.jpeg') what is the result of this?

novel anvil
coral solar
#

it looks more or less sensible

#

what i would do, is to read the image as regions for each row

novel anvil
#

Took me honestly 6 hours just to form this code... As I've said, I'm a complete newbie

neat sorrel
coral solar
#

I have previously used pillow to get rows from an image before putting it to pytesseract

#

!pypi pillow

steep jayBOT
novel anvil
#

Got that one installed already

neat sorrel
#

yeah, you should try and separate each cell before running it through tesseract if you can

novel anvil
#

Have PyAutoGUI, Pytesseract, openpyxl, numpy, opencv-python, pillow and image

novel anvil
coral solar
#

you count the number of pixels for each row, and you iterate over it based on the total height

neat sorrel
#

Is the image guaranteed to always be on the same same format, with the exact same dimensions and offsets?

coral solar
#

you need to make sure it is

#

the screenshot looks very uniform

novel anvil
#

The screenshots are taken manually using windows snipping tool

#

Good luck with on point accuracy ๐Ÿ˜„

coral solar
#

it does not have to be dead on, but it does need to be accorate

novel anvil
#

Gotcha

#

That can be done, yes

neat sorrel
#

You can correct for a few dozen pixels by cropping the top-left, finding the Member Name and offseting it to where it is supposed to be

novel anvil
#

Ya, figured

novel anvil
steep jayBOT
#

:warning: The owner of this post is no longer in the server.

steep jayBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.