We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpPrograms › video tracking and comparison
Page Index Toggle Pages: 1
video tracking and comparison (Read 640 times)
video tracking and comparison
Oct 7th, 2005, 3:56am
 
I'm back with question 2 Smiley

I have started playing around with video tracking, and tracking colors, brightness, etc.

I'm wondering about comparison to the previous frame instead.
Not quite sure on the best way to do that.

I've read thats how Sony does their tracking for EyeToy.

I'm using the built in video library and making an array of all the pixels in the image.

Cheers

Re: video tracking and comparison
Reply #1 - Oct 7th, 2005, 10:08am
 
Some kind of threshold would be useful, where you compare 1 frame against the other for a change in value above say...25 and when you get it you increase a variable that keeps track of how many +25's there are which you can then use as another threshold.

Here's a simple psuedo example, you'll probably want to read the brightness value instead, this is just to illustrate the sort of thing that might be useful.

Code:


count =0;

for(int i=0; i<pixels.length; i++) {

value = abs(frame1.pixels[i] - frame2.pixels[i]);
if (value>threshold)

 count++;
}

if(count>limit) new frame

else { no new frame}



search both forums for video compare as there's a lot about this sort of thing, with more elegant solutions than mine, for instance you might want to test 8*8 grids instead of just marching through the whole image.

modification

Just thinking, that by dividing the screen up and testing would be less cpu intensive, depending on what you want to do with the difference.

you could test every other 16*16 block and this would still be reliable enough for most test purposes, or every other scan line.


010101
101010
010101
101010

Re: video tracking and comparison
Reply #2 - Oct 8th, 2005, 4:19pm
 
there is a thread on comparing two images at http://processing.org/discourse/yabb_beta/YaBB.cgi?board=VideoCamera;action=display;num=1117150396

I would also suggest that you read around in the video section as there are quite a lot of different ways to track using video discussed there.
Page Index Toggle Pages: 1