tracking.js
tracking.js copied to clipboard
Find image in image?
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?
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.
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...
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?
This could also be useful for tracking purposes. Where AR.JS uses Hiro markers, this could provide bitmap support to that.