Ask Your Question

Revision history [back]

Clash of Clans screen image processing

I am turning to you with a question on image processing of Clash of Clans screen image.

I want to process screen in Clash of Clans. More precisely I want to locate all building in the image. Here is a sample image (main image) of Clash of Clans village below:

CoC sample image

In the above image I would use template images to find positions of buildings. For example, following picture (template image) would be used to detect town hall: enter image description here

We can see that position of template image on the main image is under the wall surrounded with three fire camps. We would like to have an algorithm that returns coordinates of template image or multiple coordinates if there are several such building in the main image. We will repeat this process to obtain a full state of the screen.

Here are some conditions:

  • template image might be only partially seen on the main image (looking at main image above several building in the village are only partially seen or covered with walls, workers etc.)

  • main image might have a poor resolution (the above resolution of image of village is a good sample, but resolution might be even worse)

  • we can provide highly detailed images of building as seen above

  • we want a highly reliable algorithm (something like 95%+ reliable)

To solve the above problem I am currently planning to use some sort of fuzzy template matching algorithm in openCV (using Python, Java or C++), however I am not sure what the best approach to resolve such a problem is.

Looking for guidance and possibly some sample code in Python, Java or C++!

Thank you for your help!