Author V. C. Mohan
Oct 4, 2008

This plugin requires libFFTw3f-3.dll or FFTw3.dll to be in the path ( place in windows/system32 folder)

While video recording many scenes are panned horizontally or vertically or both ways. This plugin creates a single scene including the full horizontal and vertical extant. The scene shift in both x and y direction are determined through cross correlation.

expected maximum and minimum shifts in horizontal and vertical directions and default values to be used in case of unreliable correlations can be input. Recommend to cleanup input by deleting bad frames prior to input.

It will try to create the scene even if panning is reversed in direction in between. Shifts between frames are determined to the nearest pixel accuracy. The full scene is created by using these shifts. Accumulation errors may be manifest. Rotation, change of magnification (Zoom) will create inaccuracies or result in complete loss of correlation.

Care must be taken that the resulting output is not too large.By properly choosing max and min values, it will be possible to minimise memory requirement. YV12 or YUY2 requires less memory than rgb formats, though rgb formats yield more accurate composition. By avoiding reverse panning, memory requirement can be reduced.

use progressive or any one type (top or bottom)field as input

This plugin works for RGB, YUY2 and YV12 color spaces.However the results can be different for different color spaces. If YUY2 or YV12 are unsatisfactory try RGB

Note: shifts to left or to top are negative numbers. Shifts to right or bottom of frame are positive numbers.

In the examples given below a pre run with Corr2d plugin enabled determining parameters. For the canvas roll example, as FXpanse does a full frame correlation, the titles on frames does not allow evaluation of correct shift of the scene below. This necessiated use of tight parameters. Unfurl plugin is a better choice for such input.

Details of parameters
Description Name Type Limits Default
Input clip clip short clip none
estimated minimum horizontal shift per frame wmin integer between -1/4 th and 1/4th of frame width minus frame width/16
estimated minimum verticalal shift per frame hmin integer between -1/4 th and 1/4th of frame height minus frame height/16
estimated maximum horizontal shift per frame wmax integer between -1/4 th and 1/4th of frame width frame width/16
estimated maxmum verticalal shift per frame hmax integer between -1/4 th and 1/4th of frame height frame height/16
default horizontal shift per frame wdef integer between wmin and wmax (wmin+wmax)/2
default verticalal shift hdef integer between hmin and hmax (hmin + hmax)/2

loadPlugin ("------------\FXpanse.dll")

#example of using a scene I recorded with a hand held video camera. Pan right directshowsource("E:\...\LasVegas.avi").trim(1200,1800) converttoYV12() assumeframebased() separatefields() selecteven() a=selectevery(16,0) #corr2d(a).grid(color=$ff0f) #return (last) a=FXpanse(a,wmax=80,hmax=8,wmin =-8, hmin=-16,hdef = 0, wdef = 0) #since only half height field is used as input enlarge a=lanczosresize(f,(f.width/4)*4, (f.height/2) *4)

pan left example

# a canvas roll example. note tight specifications

a=FXpanse(wmax=22,hmax=0,wmin =20, hmin=0,hdef = 0, wdef = 20)

# a vertical pan example

a=FXpanse(a,wmax=8,hmax=0,wmin =-16, hmin=-16,hdef = 0, wdef = 0)

To my index page down load plugin To Avisynth