substracting a lot of numbers optimisation

  • Thread starter Piotr Sobolewski
  • Start date
P

Piotr Sobolewski

Hello,

I write a program which will stabilize a shaking video made with hand
camera. Of course it involves substracting frames, and it is substracting a
huge lot of one byte values.

The problem is that it takes a lot of time. To find out how was the camera
moved between two consecutive frames I have two substract that two frames
in all possible offsets (something like 40*40=1600 - I assume the camera
hasn't been moved more than 20 pixels in 1/25 s). And substracting two
frames is substracting 640*480*3 one byte values!

I guess it can be somehow optimised. For instance: using mencoder I can
encode videos to mpeg in real time, so probably they have some fast
method...

Does any of you have an idea how such substracting can be optimised?
 
K

Ken Human

Piotr said:
Hello,

I write a program which will stabilize a shaking video made with hand
camera. Of course it involves substracting frames, and it is substracting a
huge lot of one byte values.

The problem is that it takes a lot of time. To find out how was the camera
moved between two consecutive frames I have two substract that two frames
in all possible offsets (something like 40*40=1600 - I assume the camera
hasn't been moved more than 20 pixels in 1/25 s). And substracting two
frames is substracting 640*480*3 one byte values!

I guess it can be somehow optimised. For instance: using mencoder I can
encode videos to mpeg in real time, so probably they have some fast
method...

Does any of you have an idea how such substracting can be optimised?

This isn't really on topic; you'll have a better chance of getting a
useful reply from a group that deals with digital video. Check out
dirac at http://directory.fsf.org/vid/dirac.html and ask the guys at
http://lists.sourceforge.net/lists/listinfo/dirac-discuss . fsf.org has
a number of other programs with source code avalable that deal with
video if you'd like to browse for ideas.

HTH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,565
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top