Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Image Recognition [theory] (please give input)

Author
Message
wickedly kick it
20
Years of Service
User Offline
Joined: 13th Jul 2006
Location: Fort-worth Texas
Posted: 9th May 2010 08:13
After seeing the new Iron Man, i decided that i would make a video/image processing system that can identify targets (possibly for use ingame at some point in my life) and i have a working theory on how this will work.

Basically each frame of the video we will be recorded for use, and then processed after two frames. We will use this plugin to process the image:
http://forum.thegamecreators.com/?m=forum_view&t=158832&b=8

We will first have a scan that will identify all active targets, this will be run every 30 frames. We will scan the whole system, finding the general background color using "Get Image Pixel(Image Number, X, Y)" Scanning from top to bottom (left to right). It will compare its value to the rest of them and the ones that aren't within a certain threshold will be put into "clumps" (an array/type of pixels with the center one being the "position" of the clump. The clump will be assigned as a Unknown Target for now. It will be added to a queue that will later be processed. After the whole thing is scanned and all clumps are formed, they will then be monitored. The base color will be checked within the clump, and if it exists it will reposition the clump to mark the new location of the target. Between all of this the clump will be checked with the pixel colors to see if any other objects in its database are similar to it ( transforms orig image to the scale of the scanned image.) This will then be checked and if it is the exact match of it, it will be classified as that item, if not the pixel images will be averaged (rate of 3x3 pixels, moving up by 3 pixels each dimension until match found).

Would this work? I know it would be slow, but would be useful at some level if executed in a powerful environment.

Dia
21
Years of Service
User Offline
Joined: 16th Jan 2005
Location:
Posted: 9th May 2010 10:18
it is relatively simple to put an analogue of this type of object scanning into a game (since the computer already 'knows' where and what everything is) but it is just that, an analogue.

doing it in reality is ..... difficult, although I admit it is an extremely intriguing idea.

we already have working optical tracking systems (fitted to Typhoon weapons mounts for example) that will TRACK an object, but pattern recognition on the fly requires a little more grunt than can be supplied with current (or near-future) technology.

the tracking systems are built around edge finding algorithms (strangely enough, very similar to graphics programs such as paint shop pro's Effects>Edge>Find All) and then use that edge shape as the template to 'look for' every couple of frames, and keep the target box on that part of the image.

the reason I bring this up is that I would suggest that it might be more efficient to attempt classification based on the shape identified, rather than requiring a scan of every single pixel.

Instead maybe you could use shape recognition to flag certain 'clumps' (your word, not mine ) for more in-depth pixel analysis, which would probably save a lot of processing time (since you are only looking at the 'interesting' shapes instead of the whole screen)

As far as the acutal classification goes, remember that computers are stupid, so instead of looking for an exact match and THEN using pixel averages, I would approach it from the other side. Start with a broad brush approach, and then attempt to narrow it down, with an increasing probability of a correct match.

This is not the Sig you are looking for....

Login to post a reply

Server time is: 2026-07-27 20:18:15
Your offset time is: 2026-07-27 20:18:15