N
N
Name_Zagotovka2020-08-15 17:43:03
Python
Name_Zagotovka, 2020-08-15 17:43:03

How to find a color image on the screen?

I already know how to display Hello Word. But knowledge is still not enough .. the opinion of the people involved is needed.
Task: Is the desired image on the screen. If so, press the button.
the desired image is accurate, up to a pixel, but up to a color pixel (i.e. the desired image will definitely be in geometry, but you need to find the desired color for a dash of a hue). no matter where it is. the fact that if or not is important. you can get the image through ImageGrab ... and then the author is too stupid.
In theory, you can use cv2.matchTemplate. but I don't care about coordinates. Yes, and attempts to build code on matchTemplate gives long processing.
Question: is it very clumsy, easy, and most importantly fast (the desired result update period is less than a second) to complete the following task
If ThenWhatIDon'tKnow.SuperFunction(Screen,DesiredImage) = True
Some action

of the PS I ask you not to throw slippers and other traumatic objects, but you can buy some manuals and advice.
World

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Kadabrov, 2020-08-16
@Name_Zagotovka

The PyAutoGui locateOnScreen() function performs an immediate search on the screen, you can also use the module to hover over and click

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question