vcmove


Author V. C. Mohan
Date Apr 2016
All my plugins are available for free download from "here".

vcmove plugin for vapoursynth version r24, is free and the author does not give any guarentee for its operation. It may be downloaded and used at the users risk.

vcmove has functions named Rotate, DeBarrel, Quad2Rect, Rect2Quad. These are ported with suitable modifications from the original avisynth plugins Spinner,DeBarrel,Reformer. More elaborate descriptions of these functions are at those links. All the functions in this plugin move (or reposition) pixels as per some criteria, and hence the name.


------------------------------------------------------------------------------------------------

Rotate

Rotate function as name implies rotates the frame (or a window of it with left x lx, width wd, top y ty and height ht) through a given angle in degrees. The coordinates of axis axx, axy of rotation can be specified. These may be located even outside frame. To enable use asa transition parameter dinc increases the rotation angle by this amount per frame. Interpolation schemes intq can be 0 :Nearest point, 1:Bilinear, 2: Bicubic 4x4 or 3: 6x6 Lanczos. Thevoid spaces created by Rotation in the visible frame space is filled by a specified background clip bkg


the script call for Rotate function is

vcmove.Rotate(clip, clip bkg, float angle [, float dinc = 0] [,int lx = 0] [,int wd = width] [,int ty = 0] [,int ht = height] [ [,int axx = lx + wd /2] [,int axy = ty + ht / 2] [,int intq = 2])


------------------------------------------------------------------------------------------------

DeBarrel

DeBarrel corrects for common distortions introduced by spherical lenses.A rectangular frame is seen slightly curved out (barrel type distortion) or curved in (pin cushion distortion). Due to compound lens optics of cameras it is different amount and style of distortion. Some camera manufacturers do give correction constants, but due so many of them in existence it is impracticable to keep track and use them. DeBarrel attempts to correct the distortion given type and a, b and c of the distortion. While it is easy to know type (parameter pin) ( 0 barrel or 1 pin cushion) guessing constants is a different matter. For this purpose a test mode is provided wherein a pattern that will be straightened with given a, b and c overlain on input frame can be viewed. Defining in python script suitable functions it can be viewed repeatedly with varying values of the constants and best fit can be selected. In some cases the frame is compressed vertically or horizontally (ex: cinemascope). For such video vertical to horizontally ratio vhr can be set. Lanczos 6X6 interpolation is used. If distortions along x and y are different yind can be set to 1 and y constants be specified. a, b , c values and a+b+c must be less than 0.5.
RGB, Gray and such YUV formats which have no sub sampling are processed.


The script call is:

vcmove.DeBarrel(clip, float a, float b, float c [, float vhr = 1.0] [, int pin =0] [, int yind = 0] [, int ypin = 0][ , float ya = 0.05] [, float yb = 0.05] [, float yc = 0.05] [, int test = 0])


------------------------------------------------------------------------------------------------

Quad2Rect

Quad2Rect converts a quadrilateral image to a rectangle. Due to perspective (position of camera} a rectangular image appears as a quadrilateral. By matrix inversion such an image is restored. This function by suitable change of parameters from frame to frame can be used for a transition. A background clip bkg is to be specified to fill up any void space. Interpolation type intq (0 near pt, 1 bilinear,2 bicubic,3 Lanczos) can be specified. The rectangle is specified by array of rect = [ lx, wd, ty, ht]. The quad coordinates are in array quad = [x0,y0,x1,y1,x2,y2,x3,y3] and must be in clockwise. All coordinates can be either absolute or normalized values.



The script call is :

vcmove.Quad2Rect(clip, clip bkg[, int intq = 2][,int norm = 1],float rect[lx,wd,ty,ht],float quad[x0,y0,x1,y1.x2,y2,x3,y3])


------------------------------------------------------------------------------------------------

Rect2Quad

Rect2Quad converts a rectangular image to quadrilateral image and is inverse to Quad2Rect This function by suitable change of parameters from frame to frame can be used for a transition. A background clip bkg is to be specified to fill up any void space. Interpolation type intq (0 near pt, 1 bilinear,2 bicubic,3 Lanczos) can be specified. The rectangle is specified by array of rect = [ lx, wd, ty, ht]. The quad coordinates are in array quad = [x0,y0,x1,y1,x2,y2,x3,y3] and must be in clockwise. All coordinates can be either absolute or normalized values.



The script call is :

vcmove.Rect2Quad(clip, clip bkg[, int intq = 2][,int norm = 1],float rect[lx,wd,ty,ht],float quad[x0,y0,x1,y1.x2,y2,x3,y3])


------------------------------------------------------------------------------------------------




To my index page down load plugin To Avisynth