Jump to content

Pyautogui does not detect images that aren't 1:1

12345678

from the docs it seems that "confidence" does the trick , but it does not

x1, y1=pyautogui.center(pyautogui.locateOnScreen('image.png', confidence=0.8))
print(x1, y1)

 

if you get an image like image.png.aa3b0dc5082d2ef3c4d7ec4ad3f650ea.png

by itself then it works fine.

if you put the same under a composite image like

image.png.a2de7c894b16bd6067ce6c67ad5e0a4b.png

then it does not work anymore

Link to comment
Share on other sites

Link to post
Share on other sites

26 minutes ago, 12345678 said:

if you get an image like image.png.aa3b0dc5082d2ef3c4d7ec4ad3f650ea.png

by itself then it works fine.

if you put the same under a composite image like

image.png.a2de7c894b16bd6067ce6c67ad5e0a4b.png

then it does not work anymore

Are you talking about the image you're passing as a parameter to the function, or are you talking about the image you're looking for in your screen?

 

Also, do you have opencv installed?

FX6300 @ 4.2GHz | Gigabyte GA-78LMT-USB3 R2 | Hyper 212x | 3x 8GB + 1x 4GB @ 1600MHz | Gigabyte 2060 Super | Corsair CX650M | LG 43UK6520PSA
ASUS X550LN | i5 4210u | 12GB
Lenovo N23 Yoga

Link to comment
Share on other sites

Link to post
Share on other sites

34 minutes ago, igormp said:

Are you talking about the image you're passing as a parameter to the function, or are you talking about the image you're looking for in your screen?

both? the image is passed as parameter to the function, in which the function should give the xy location of the image

if the image is by itself it works, if the image is in a bigger image with other stuff, it fails

 

34 minutes ago, igormp said:

Also, do you have opencv installed?

yes it is, otherwise it throws an errror

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×