e102
e102

Reputation: 83

How can I check to see if an image is onscreen in python3?

Does anybody know how I can make a program that takes a screenshot and checks if an image appears inside that screenshot?

I've seen similar questions, but they all check where the image is, not if it exists

Upvotes: 0

Views: 145

Answers (1)

Ayush Garg
Ayush Garg

Reputation: 2517

You can use OpenCV. If you get a position, then it exists. If you don't get a position, it doesn't exist.

EDIT: You can use this tutorial. Python-Imagesearch is actually a wrapper around opencv2, so it should work properly.

Upvotes: 1

Related Questions