#๐Ÿ”’ Pytesseract problem with wrong "easy" image recognition

4 messages ยท Page 1 of 1 (latest)

hollow jetty
#

Hello !
Anyone expert with Pytsseract here ?
I'm trying to recognize the set of characters "1, -31" from this picture.

To do so, I'm using pytesseract with this function :

def read_coord(img, lang='fra', config="-c tessedit_char_whitelist=0123456789-, --psm 7 --oem 0"):
    text = pytesseract.image_to_string(img, lang, config)
    current_coord = re.findall("-?[0-9]{1,2}, ?-?[0-9]{1,2}", text)[0].replace(" ", "")
    return current_coord 

But it return 1,31 instead.
The text return 1,3141 so it doesn't come from regex issue.

I setup --psm 7 to read 1 single line, and --oem 0 because I don't need neural ?

halcyon meadowBOT
#

@hollow jetty

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.

halcyon meadowBOT
#

@hollow jetty

Python help channel closed for inactivity

This help channel has been closed. 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.