Solved

Image comparison techniques

Posted on 2009-04-01
7
833 Views
Last Modified: 2013-11-13
Hello,
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).

Thanks.
Brian
0
Comment
Question by:BrianGEFF719
  • 4
  • 2
7 Comments
 
LVL 27

Accepted Solution

by:
aburr earned 500 total points
Comment Utility
Reverse engineer a digital camera with a face detecting feature.
0
 
LVL 27

Expert Comment

by:aburr
Comment Utility
Photoshop has a feature which will subtract out from a picture any object which has moved.
0
 
LVL 27

Expert Comment

by:aburr
Comment Utility
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.
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 19

Author Comment

by:BrianGEFF719
Comment Utility
>>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.

Brian
0
 
LVL 27

Expert Comment

by:aburr
Comment Utility
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 ...
ieeexplore.ieee.org/iel2/637/6472/00254489.pdf?arnumber=254489 -
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 ...
portal.acm.org/citation.cfm?id=1018415.1019172&coll=&dl=&CFID=15151515&CFTOKEN=6184618

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; ...
ieeexplore.ieee.org/xpls/abs_all.jsp?arnumber=1323958
0
 
LVL 5

Expert Comment

by:InvincibleShield
Comment Utility
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!
0
 
LVL 5

Expert Comment

by:InvincibleShield
Comment Utility
** I started by saying #3 was fairly basic then finished with it being fairly complicated :P.

The concept is basic, but implementation was complicated. **
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Complex Numbers are funny things.  Many people have a basic understanding of them, some a more advanced.  The confusion usually arises when that pesky i (or j for Electrical Engineers) appears and understanding the meaning of a square root of a nega…
Artificial Intelligence comes in many forms, and for game developers, Path-Finding is an important ability for making an NPC (Non-Playable Character) maneuver through terrain.  A* is a particularly easy way to approach it.  I’ll start with the algor…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now