pyautogui don't find calc button (using locateOnScreen)
See original GitHub issueHi, I’m testing pyautogui and I have some problems with locateOnScreen function. It worked sometimes but now it doesn’t work and I don’t know if I’m making something wrong or it is a issue in the function.
Here is my code:
myscreen = pyautogui.screenshot('myscreenshot.png') result = pyautogui.locateCenterOnScreen('imgsToFind/botao4.PNG') if result is not None: utility.mouseClick(result)
result always receive None
Here is the image that I’m trying to find:
Here is the screenshot taken by pyautogui:
Can you help me ?
Issue Analytics
- State:
- Created 5 years ago
- Comments:7
Top Results From Across the Web
Screenshot Functions - PyAutoGUI documentation
The calculator can appear in a slightly different place each time it is launched, ... If the image can't be found on the...
Read more >Why PyAutoGui LocateOnScreen() only Returns None
The locateOnScreen() function returns None if the image wasn't found on the screen. Remember, the match has to be pixel-perfect in order to ......
Read more >pyautogui don't find calc button (using locateOnScreen)
Hi, I'm testing pyautogui and I have some problems with locateOnScreen function. It worked sometimes but now it doesn't work and I don't...
Read more >PyAutoGUI Documentation - Read the Docs
pyautogui.click('button.png') # Find where button.png appears on the screen and ... you can find it on the screen with locateOnScreen(). > ...
Read more >Pyautogui locate on screen confidence
locate function you call, you can pass the confidence parameter. pyautogui don't find calc button (using locateOnScreen) · Issue #273 , If the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Try different values for confidence. Old Sikuli programs used 0.7 confidence based on heuristics I believe, so 0.99 is certainly a bit optimistic, IMHO.
result = pyautogui.locateCenterOnScreen(‘imgsToFind/botao4.PNG’, confidence=0.8)
@viniciusmaran @bjanzen I didn’t have OpenCV, I’ve not got it running with Python 3.7.x and it’s working great, I feel like my scripts are running at the speed of light now with the confidence parameter working. Thanks!