vcm


example scripts for moving pixels

example for interesting display using function Reform
import vapoursynth as vs
import functools
import math
core = vs.get_core()
core.std.LoadPlugin(path=r'c:\...........vcm.dll')
ret = core.std.BlankClip(width=720,height=480,format = vs.YUV444P8,color=[255,127,127])
ret=core.std.Trim(ret,1,1)
ret  = core.vcm.Grid(ret,lineint=10, color=[55],bcolor=[0,55],vbcolor=[0,55,55],style =1)
ret=core.text.Text(ret, text = "dancing grid", alignment=5)
base = core.std.Loop (ret,1000)
def req(n,clip):	
	
    t = 0.061 * n
    t2 = 0.127 * n
    sint= math.sin(t)
    cost = math.cos(t)
    sint2 = math.sin(t2)
    cost2 = math.cos(t2)
    a = 0.501 + 0.5 * math.sin(t/ math.pi)
    t1x = (-0.2*cost2)     
    t1y = (0.5-0.5*cost2)     
    t2x = (1.0+0.2*cost2) 
    t2y = (0.5-0.5*cost2) 
    t3x = (1.0+0.2*cost2) 
    t3y = (0.5+0.5*cost2) 
    t4x = (-0.2*cost2) 
    t4y = (0.5+0.5*cost2) 
    c1x = (0.5+a*cost) 
    c1y = (0.5+a*sint) 
    c2x = (0.5-a*sint) 
    c2y = (0.5+a*cost) 
    c3x = (0.5-a*cost) 
    c3y = (0.5-a*sint) 
    c4x = (0.5+a*sint) 
    c4y = (0.5-a*cost)
    return core.vcm.Reform(clip,bkg = clip,norm = 1,rect=[t1x, t1y,t3x, t3y],quad=[c1x,c1y,c2x,c2y,c3x,c3y,c4x,c4y], intq = 0, q2r = 1) 
ret = core.std.FrameEval(base,functools.partial(req,clip=base))
The following script can be used to test parameters for DeBarrel inplace of in built facility.
ret = core.std.BlankClip(width=720,height=480,format = vs.YUV444P8,color=[255,127,127])
ret=core.std.Trim(ret,1,1)
ret  = core.vcm.Grid(ret,lineint=10, color=[55],bcolor=[0,55],vbcolor=[0,55,55],style =1)
ret = core.vcm.DeBarrel(ret,abc = [ 0.005, 0.005,0.005],pin = 0)
ret = core.std.Loop (ret,50)

def animator(n,clip):	
	return core.vcm.DeBarrel(clip,abc = [0.001,0.02, n* 0.0002 + 0.0002 ],pin=1, test = 1)
#
dret = core.std.FrameEval(ret,functools.partial(animator,clip=ret)) 
# for  Fisheye correction of input image given 
# Mars fish eye image processing:-
# https://mars.nasa.gov/mars2020-raw-images/pub/ods/surface/sol/00134/ids/edr/browse/rcam/RRF_0134_0678844143_132ECM_N0050894RHAZ02002_01_295J01_320.jpg
#
ret=core.imwri.Read ( r'C:\images\mars.jpg')
#By adding borders ensured the full fisheye image is within frame 
ret = core.std.AddBorders(ret,250,250,0,500)
# Circles to get origin and radius
#ret = core.vcm.Circles(ret, dim = 0.5,dots = 1,xo = 400,yo = 350, frad = 350, cint =50)
#
ret = core.vcm.Fisheye(ret, method = 3, xo = 400,yo = 350, frad = 350, fk = 1.051, rix = 1.13, sqr = 1, test = 0, dim = 0.5, dots = 4, q = 1)
# unnecessary parts deleted
ret = core.std.CropAbs(ret, width = 600,height = 370, left = 200, top = 0)