Skip to content

Image should be found, but is not :/ #17

@tgeorgel

Description

@tgeorgel

Hi, i'm following your tutorial on Medium.

I'm kinda lost, the script can't find the image that should easily be found.

Here is the screen shot taken by pyautogui

testarea

And here is my lookup image :

sort_pression

The image fit perfectly it photoshop.. but can't be found by the script :

pos = imagesearch("img/sort_pression.png")

print(pos)

if pos[0] != -1:
    print("position : ", pos[0], pos[1])
    pyautogui.moveTo(pos[0], pos[1])
else:
    print("image not found")

And result :

❯ python3 main.py                                                                                                                                                              
[-1, -1]
image not found

Any idea of what i can't be doing wrong ?

I tested this on a macbook retina, the is_retina is set to 1..

Thanks a lot :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions