Solved

Image comparison techniques

Posted on 2009-04-01
7
837 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
ID: 24046369
Reverse engineer a digital camera with a face detecting feature.
0
 
LVL 27

Expert Comment

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

Expert Comment

by:aburr
ID: 24046452
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
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 19

Author Comment

by:BrianGEFF719
ID: 24046920
>>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
ID: 24049875
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
ID: 24459408
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
ID: 24459563
** 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What is RenderMan: RenderMan is a not any particular piece of software. RenderMan is an industry standard, defining set of rules that any rendering software should use, to be RenderMan-compliant. Pixar's RenderMan is a flagship implementation of …
We are taking giant steps in technological advances in the field of wireless telephony. At just 10 years since the advent of smartphones, it is crucial to examine the benefits and disadvantages that have been report to us.
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

820 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