tracking.js icon indicating copy to clipboard operation
tracking.js copied to clipboard

Find image in image?

Open Darker opened this issue 8 years ago • 4 comments

Hello, I want to make a simple AI that plays a game using the screenshots. The game is simple 2D game so it shouldn't be hard. Main thing to do is to be able to find image in the screenshots to locate interactive objects. What's a good getting started guide to do that?

Darker avatar May 31 '16 15:05 Darker

The answer is it depends. =P Depends of how is the image to be found, this image can be rotated, this image is a simple geometric object, this image has particular color.... So, for a better answer I will need more details about this image.

thiago-rocha avatar May 31 '16 20:05 thiago-rocha

The image will be simply cropped screenshot from the game - for example image of an enemy. The object might be animated in the game but will retain the same colors. The image will be the same size and will not rotate. I can't just compare all the pixels due to possible animation. Last time I did this, I made an integral image of the screenshot then seeked by average color of the small image. But I am very lazy to implement all this again in javascript, it's a lot of code...

Darker avatar Jun 01 '16 07:06 Darker

Ok, so I think you can use the color tracker in your game. My suggestion is as following, choice a color to identify the enemy, this color shouldn't in any other object. Use the color tracker to find the position of this color on the screenshot.

So, @Darker , that can work?

thiago-rocha avatar Jun 03 '16 17:06 thiago-rocha

This could also be useful for tracking purposes. Where AR.JS uses Hiro markers, this could provide bitmap support to that.

tomasdev avatar Feb 14 '19 21:02 tomasdev