asweigart / pyautogui

A cross-platform GUI automation Python module for human beings. Used to programmatically control the mouse & keyboard.
BSD 3-Clause "New" or "Revised" License
10.47k stars 1.27k forks source link

locateOnScreen has some accuracy issues #885

Open 11522514 opened 2 months ago

11522514 commented 2 months ago

I am working with very small fixed regions so any tiny differences should give large accuracy errors, but despite that, I am finding matches with very high confidence levels. The attached two images have a 0.981 confidence difference between them. Below is the command I am using. pyautogui.locateOnScreen("test.png", region=(794, 765, 3, 3)) might500-795,766,3,3 might500-795,766,3,3

11522514 commented 2 months ago

Also the following fails with a 1.000 highest confidence. pyautogui.locateOnScreen("test.png", region=(848, 762, 3, 5)) might900-849,764,3,5 might900-849,764,3,5