Apr 7, 2019 12:48 AM
(This post was last modified: Apr 7, 2019 12:49 AM by District.)
Hi HF. I'm a beginner and I'm trying to learn how to use Python to recognize an image, so that later in the script I can use mouse/keyboard events on said image. In my head it sounds simple but so far I'm struggling to find an answer. All I want the script to do is recognize the image(s) on the screen and allow me to execute commands when it sees them, like clicking it. There may be situations where there are multiple of the same image on the screen and it will need to click them in order.
I've been trying out so many modules/libraries and I can't seem to find an answer. I only have a knowledge of the basics but even reading the docs on certain module features hasn't been helping me, as the information given seems to be very basic.
I've been trying Pytesseract and even when running the code below I get no errors but it prints a blank line. No information whatsoever. I don't know if I'm doing something wrong or if I'll require something else to work with it. The whole point of this is that I want to learn how to make Python recognize the image, and I want to understand what each command/part of the code does.
Can anyone give me some information or recommend a different approach? Talking with someone 1:1 who has done this before would be a big help too. I'd even be willing to pay someone for knowledge on this.
I've been trying out so many modules/libraries and I can't seem to find an answer. I only have a knowledge of the basics but even reading the docs on certain module features hasn't been helping me, as the information given seems to be very basic.
I've been trying Pytesseract and even when running the code below I get no errors but it prints a blank line. No information whatsoever. I don't know if I'm doing something wrong or if I'll require something else to work with it. The whole point of this is that I want to learn how to make Python recognize the image, and I want to understand what each command/part of the code does.
Code
from PIL import Image
import pytesseract
pytesseract.pytesseract.tesseract_cmd = r"C:\Program Files\Tesseract-OCR\tesseract"
print(pytesseract.image_to_string(Image.open('letter_a.png')))Can anyone give me some information or recommend a different approach? Talking with someone 1:1 who has done this before would be a big help too. I'd even be willing to pay someone for knowledge on this.
![[Image: Ijqx9DX.png]](https://i.imgur.com/Ijqx9DX.png)
Quick Love my posts please!



![[Image: 0DvFxnA.gif]](https://i.imgur.com/0DvFxnA.gif)