Log in

View Full Version : Extract MDepan motion figures from pixel values?


martin53
2nd December 2012, 12:31
MDepan calculates motion data between frames. Aside from writing them into a logfile, MDepan also seems to write this information into the luma information of the top left corner of the clip, see example (Edit: found example to be no more existent. I had entered the URL of the to-be-approved jpg. Maybe it was too ugly...)

It is possible to extract the bytes with ~76 calls in the style of
x0 = RT_AverageLuma(x=0, w=1, h=1)
x1 = RT_AverageLuma(x=1, w=1, h=1)
x2 = RT_AverageLuma(x=2, w=1, h=1)
...

but how do x0 ... x75 constitute the 4 float values MDepan delivers (x pan, y pan, rotation and zoom), and is it possible to form the 4 AviSynth float variables, including sign and exponent, from x0 ... x75, using standard AviSynth math operators (Edit: the pixels might as well be a string or a combination of binary and ASCII)?

Maybe someone has too much spare time and feels like solving this puzzle :) - or maybe this kind of "hint extraction" has been done somewhere already?

jmac698
5th December 2012, 10:20
Well, first of all you don't need any plugins to read a pixel. You can use my getpixel script
http://forum.doom9.org/showthread.php?p=1585860&highlight=getpixel#post1585860

just take out the line that says current_frame=0 and call it within a scriptclip.

As far as interpreting the data, if it's what's called a correlation surface, there will be one brightest pixel that represents the offset. If it's using the Fourier method, it's something else.
Anyhow, for now I think Corr2d plugin can be used, because I've decoded it's format, and all the plugins necessary are available to use it - in fact I think I've made this script, in TBC thread.
Maybe some modification from this:
http://forum.doom9.org/showthread.php?p=1533363#post1533363