Image comparison techniques

I'm trying to develop an application that will detect objects inside a picture. The objects that I'm trying to detect are also moving, so I've tried a technique where I sample every 100ms and XOR the old and new pictures and unchanged pixels become black. I didn't have too much success doing this...

I've also tried searching through the 100ms samples for the images I'm trying to detect, this technique is obviously slow. I've tried to optimize it by stepping 3 pixels, but it still takes around 150ms to process the image.

Are there any techniques I can use? Fortunately, noise isn't really an issue in the images as they are computer generated images (it's a video game).

LVL 19
Who is Participating?
aburrConnect With a Mentor Commented:
Reverse engineer a digital camera with a face detecting feature.
Photoshop has a feature which will subtract out from a picture any object which has moved.
do you have a copy of the picture without the object? If so the object will be only those pixels which have changed.
If the object is solid color, different from background, and the object moves from off screen, then the object pixels will change from background to object and later from object to background again. That info might alow you to reconstruct the object.
Obviously I do not know enough of your particular situation to offer much more.
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

BrianGEFF719Author Commented:
>>Photoshop has a feature which will subtract out from a picture any object which has moved.

The subtraction you're talking about is very similar to the XOR technique I previously mentioned. XORing will produce a similar result, all pixels that haven't changed will be black, changed pixel will have some color.

I do appreciate the suggestion but I'm looking for techniques that I can implement myself in my application. Do you perhaps have links to papers written on the subject?

Thanks for your time.

Here are a few papers. They may help. I hope the links come through.

This paper details two moving-image processing algorithms, a visual-information processing we devel- oped to guide a vehicle through white-line detection ... -
by S Shimizu - 1992 -

Image Subtraction for Real Time Moving Object Extraction. Full text, Full text available on the Publisher site Publisher Site. Source, CGIV archive ...

Welcome to IEEE Xplore 2.0: Image subtraction for real time moving ...
Aug 24, 2004 ... Image subtraction for real time moving object extraction. Desa, S.M. Salih, Q.A.. Fac. of Inf. Technol., Multimedia Univ., Malaysia; ...
I've done a bit of work with detection of objects and changing colours. Here are a couple of techniques I've used:

1. For each pixel analyzed, get the R, G, B, and find their the percent difference from the R, G, B of the expected colour (which could be the last colour detected). If the percent difference is low enough, and matches the colour that you were searching for, then you have a match. That's usually a pretty good technique for making bots (eg, shoot when the retical turns red).

2. If you are expecting to run into a lot of gradients, shades, or noise, take an average sample of the surrounding pixels. For instance, the average R, G, and B of (x, y), (x+1, y), (x-1, y), (x, y+1), etc...

3. I once used a function recursion to detect moving objects through a web cam. It was fairly basic - used the above two techniques to detect changes in brightness, and called itself, searching all surrounding sampled pixels to find the size of the moving object, allowing me to predict exactly where the object was and where it was moving. It was fairly complicated but worked quite well!

Hope this helps!
** I started by saying #3 was fairly basic then finished with it being fairly complicated :P.

The concept is basic, but implementation was complicated. **
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.