Is there a python library that recognises colour or text in a particular part of my screen?

Question:

Is there any python library that deals with image/text recognition that tells you if a certain text or colour is there or not?

For example, I have the following screenshot:

enter image description here

I simply want to detect if the ‘Fold’ symbol is there or not. Either by the word ‘Fold’ or by the change in colour, i.e. the white colour in this case.

More generally, I have Python scripts that will autoclick on the screen based on the inputted XY coordinates on my screen.

Is there a Python library that will detect whether certain text or colour is at a particular point on my screen?

Asked By: Patrick_Chong

||

Answers:

OpenCV has all the functionality you need.

How you’ll do it:

  • Grab a snippet of the screenshot that contains the "fold" button.
  • Take a screenshot of your current screen.
  • Then use Template Matching to check if the fold button is onscreen.
Answered By: Someone Else
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.