[Python] Is there a way to pass an image to the Microsoft snipping tool, have it perform text...

Discussão em 'Python' iniciado por Stack, Abril 10, 2025.

  1. Stack

    Stack Membro Participativo

    I'm working on something that uses OCR for fun. I'm currently using PyTesseract, and it has a very high error rate, so I built a user validation function so the ingested text could be verified. As I was testing different things I got tired of hand typing one of the lines that PyTesseract would constantly get wrong, so I took a snip and used the text extraction function in the snipping tool. It had 100% accuracy.

    That got me thinking, that if I could just find a way to get python to invoke the snipping tool, it would A) increase the accuracy of the OCR. B) remove the need to have people who use this thing install Tesseract-OCR so their local python could run the code.

    I can't for the life of me figure out how to do it though, or if it is even possible. I read something on here about how to take a screenshot within PowerShell, but that's only half of my problem. Any help would be great.

    The code I have currently is located on https://github.com/MElse1/Puzzle-So...0c9/Word Search Solver/PyTesseract testing.py it's convoluted and probably badly done, but it gets the job done even if it's very inaccurate due to the OCR solution.

    Since I linked my github, this isn't for anything serious, it's just a way to get better with programming logic in a way that's fun for me. This solution is ultimately to solve word searches. I have the logical part of the program down elsewhere in my github, but I thought it would be cool to use OCR to build the lists to search for the words.

    Continue reading...

Compartilhe esta Página