Answer the question
In order to leave comments, you need to log in
How to do image search with different text in python?
Hello. You need to find the picture in the game and click on it. I already did this through the pyautogui.locateOnScreen function, I also tried it through OpenCV, but I couldn’t set the accuracy there and it often doesn’t find it. Now I have moved to another object, where the text is in a black frame, the text is different, it happens from 1, 2 and 3 words and of different lengths. Tell me how this can be implemented? Examples of pictures:
I tried to smear the text in Photoshop and search for such a picture with reduced accuracy, but either it doesn’t find it, or it only finds the original, and we approach another entrance with a longer or shorter inscription and that’s it, it doesn’t recognize it anymore.
PS The meaning is this - we run the second window behind the main one, moving along the cross on the map, when the cross disappeared - we poke on the passage nearby, which is indicated only by the inscription, and is highlighted only when hovering, do not crawl with the mouse all over the screen until the passage lights up .. Well, there the form is different, I'm not sure that it will always find it, although the option, the current xs how to do it right .. The glow is stupidly white. When you hover over the passage with the mouse, it looks like this:
Another option is to use tensorflow and train to recognize different rectangles with text, but I couldn’t figure out how to pre-train the network and how to connect the network to recognition and whether it will be in time, although it’s just a rectangle to find, but not a complex object.
Answer the question
In order to leave comments, you need to log in
Apply:
1. Erode
2. Corner Detection
Based on the obtained coordinates, select those that are closer to the center of the image and form a rectangle.
Then
click on it
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question