Motion detecting using onboard camera
| Fri, 2004-01-16 10:49 | |
|
Hi! Just wondering if anyone knows the techniques used in series 60 games like "Killer Virus" and Mosquitos? They seem to use somekind of motion-detecting using camera view-finder to scroll the screen or the moving targets in it? It would be very interesting to use this kind of technique in different kind of programs, which don't even use or need the actual camera image. For example picture-viewer or browser could use this kind of feature to browse bigger screens that don't fit into small screen of mobile phone...
Is it possible to run camera view-finder on background, analysing the pictures in it without showing it on screen? Does anyone know any links or even libraries that would help? |
|






Forum posts: 363
Think simple
I tried doing something like this once, for an entirely other purpose though. The key is to do hierarchical motion estimation - do it on hierarchically subsampled images and it will be fast and accurate enough.
For example:
Subsample two to N of consecutive 160x120 viewfinder frames to 80x60, then 40x30, then 20x15 "images". Compare always two to N consecutive frames of the same size, starting from the LOWEST resolution, moving the other image around the other one. The comparison operation here can be e.g. sum-of-absolute-differences of pixel values. When you have found a value below some threshold, or you have done enough comparisons (you have a fixed time budget), stop the iteration and you should have a motion vector ready
Oh, I forgot to mention that it may be useful to do lookup table to calculate the difference of two 16-bit pixels. In that way, you can use e.g. squared sum values so the end result will be more accurate.
I hope this helps, no code this time though
The downsize of all this is that you have to have a good amount of non-ambiguous content in the viewfinder for the algorithm to perform well.
Cheers,
Pawel
Forum posts: 52
could you post some snippets in order to get me understand better?!
Forum posts: 1
http://www.inf.ethz.ch/~rohs/visualcodes
It has some info about this and similar subjects, along with books in .pdf and source code.
Hope this helps